RadioButton class

A radio button is a control used for making a choice. It is typically used in groups so the user may select one from several options.

To create a radio button use the wb_create_control() function using RadioButton as the class parameter.

Using radio buttons

Creating radio buttons

// Create two radio button groups

// Group A wb_create_control($mainwin, Frame, "Group A", 10, 6, 85, 89); // For cosmetics only wb_create_control($mainwin, RadioButton, "Option A1", 20, 24, 70, 14, 101, WBC_GROUP, 0); // Group start wb_create_control($mainwin, RadioButton, "Option A2", 20, 48, 70, 14, 102, 0, 1); // Checked wb_create_control($mainwin, RadioButton, "Option A3", 20, 73, 70, 14, 103 0, 0); // Group B wb_create_control($mainwin, Frame, "Group B", 110, 6, 85, 89); // For cosmetics only wb_create_control($mainwin, RadioButton, "Option B1", 120, 24, 70, 14, 201, WBC_GROUP, 1); // Group start, checked
wb_create_control($mainwin, RadioButton, "Option B2", 120, 48, 70, 14, 202, 0, 0);
wb_create_control($mainwin, RadioButton, "Option B3", 120, 73, 70, 14, 203, 0, 0);

Retrieving the selected state of a radio button

To retrieve currently selected state of a radio button, call wb_get_selected() or wb_get_value().

See also

wb_create_control
Control classes