MildenhallRadioButton

MildenhallRadioButton — MildenhallRadioButton is a widget used to toggle between two states i.e,True or false.

Functions

Properties

gpointer button-id Read / Write
gboolean current-state Read / Write
gchar * group-id Read / Write
gfloat height Read / Write
gboolean highlight Read / Write
gfloat width Read / Write

Signals

void state-change No Recursion

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── LightwoodButton
                ╰── MildenhallRadioButton

Description

MildenhallRadioButton widget can be used to toggle between two states i.e,True or false. Every button must have a group ID in order to differentiate. Button ID is required to differentiate the Button within a group. Initially all buttons will be un-set if not set to true explicitly and once any button is set, at least one button will be in true state in that group. "state-change" signal is emitted for state change if "reactive" property is set true and button ID is passed along the signal.

Freeing the widget

Call g_object_unref() to free the widget.

Sample C Code

1
2
3
4
5
6
7
8
9
10
11
GObject *object = NULL;
ThornburyItemFactory *item_factory = NULL;
MildenhallRadioButton *button = NULL;

item_factory = thornbury_item_factory_generate_widget_with_props (
		MILDENHALL_TYPE_RADIO_BUTTON
     	"PKGDATADIR"/mildenhall_radio_button_prop.json");

g_object_get (item_factory, "object", &object, NULL);
button = MILDENHALL_RADIO_BUTTON (object);
clutter_actor_add_child (stage, CLUTTER_ACTOR (button));

Refer ThornburyItemFactory for Thornbury Item Factory details.

Functions

mildenhall_radio_button_new ()

ClutterActor *
mildenhall_radio_button_new (void);

Creates a Radio button object

Returns

Radio button object.

[transfer full]


mildenhall_radio_button_set_current_state ()

void
mildenhall_radio_button_set_current_state
                               (MildenhallRadioButton *pRadioButton,
                                gboolean inState);

pre -condition: Group Id must be set before setting current state.

Sets the current state of the radio button

Parameters

pObject

radio button object reference

 

bState

current state of the button

 

mildenhall_radio_button_set_group_id ()

void
mildenhall_radio_button_set_group_id (MildenhallRadioButton *pRadioButton,
                                      const GValue *pValue);

Group ID can be App Name and must not be a NULL. Preferable to set this property prior to other properties apart from width,height.

Parameters

pObject

radio button object reference

 

pValue

new value for the property

 

mildenhall_radio_button_set_button_id ()

void
mildenhall_radio_button_set_button_id (MildenhallRadioButton *pRadioButton,
                                       gpointer *pButtonId);

Button id needs to be unique and is a generic gpointer

Parameters

pObject

radio button object reference

 

pButtonId

ID for button, which is sent back in call back

 

mildenhall_radio_button_set_highlight ()

void
mildenhall_radio_button_set_highlight (MildenhallRadioButton *pRadioButton,
                                       gboolean bHighLightState);

This method is to highlight a particular button within a group. The widget will highlight only one button in a group at a time. If one button is already highlighted or two button in a group is tried to be highlighted then resent request is recognized and other button is turned to normal state.

Parameters

pObject

radio button object reference

 

bHighLightState

highlight state of the button

 

mildenhall_radio_button_get_width ()

gfloat
mildenhall_radio_button_get_width (MildenhallRadioButton *pRadioButton);

Function to get the radio button width

Parameters

pObject

radio button object reference

 

Returns

width of the radio button


mildenhall_radio_button_get_height ()

gfloat
mildenhall_radio_button_get_height (MildenhallRadioButton *pRadioButton);

Function to get the radio button height

Parameters

pObject

radio button object reference

 

Returns

height of the radio button


mildenhall_radio_button_get_group_id ()

gchar *
mildenhall_radio_button_get_group_id (MildenhallRadioButton *pRadioButton);

Function to get the radio button Group Id

Parameters

pObject

radio button object reference

 

Returns

Group Id of the radio button


mildenhall_radio_button_get_current_state ()

gboolean
mildenhall_radio_button_get_current_state
                               (MildenhallRadioButton *pRadioButton);

Function to get the radio button current state

Parameters

pObject

radio button object reference

 

Returns

current state of the radio button


mildenhall_radio_button_get_button_id ()

gpointer *
mildenhall_radio_button_get_button_id (MildenhallRadioButton *pRadioButton);

Function to get the radio button ID

Parameters

pObject

radio button object reference

 

Returns

Button ID


mildenhall_radio_button_get_highlight ()

gboolean
mildenhall_radio_button_get_highlight (MildenhallRadioButton *pRadioButton);

Function to get the Active / normal state of button

Parameters

pObject

radio button object reference

 

Returns

highlight state of the button

Types and Values

Property Details

The “button-id” property

  “button-id”                gpointer

button-id as a identity for button Button ID is generic pointer which is returned on signal omission

Flags: Read / Write


The “current-state” property

  “current-state”            gboolean

gives the current state of the button as state index Default: NULL

Flags: Read / Write

Default value: FALSE


The “group-id” property

  “group-id”                 gchar *

Group ID of the button.

Flags: Read / Write

Default value: ""


The “height” property

  “height”                   gfloat

Height of the radio button.

Flags: Read / Write

Allowed values: >= 0

Default value: 64


The “highlight” property

  “highlight”                gboolean

Sets the button to highlight or normal state The widget will highlight only one button in group at a time. If one button is already highlighted or two button in a group is tried to be highlighted then resent request is recognised and other button is turned to normal state. Default: Normal state i.e, False

Flags: Read / Write

Default value: FALSE


The “width” property

  “width”                    gfloat

Width of the radio button.

Flags: Read / Write

Allowed values: >= 0

Default value: 64

Signal Details

The “state-change” signal

void
user_function (MildenhallRadioButton *mildenhallRadioButton,
               gboolean               oldState,
               gpointer               newState,
               gpointer               user_data)

::state-change is emitted when button is changed from true state to flase and vice versa

Parameters

mildenhallRadioButton

The object which received the signal

 

oldState

name of the old state

 

newState

name of the new state

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion

See Also

ClutterActor, ThornburyItemFactory