GtkRadioMenuItem Constructor

GtkRadioMenuItem ([GtkRadioMenuItem group [, string text [, bool use_underline = true]]]);

Creates a new radio menu item. The group is the menu item to which group the new item belongs. Set it to null if you are creating the first radio menu item of the group.

Example 108. Creating GtkRadioMenuItems

//Create a menu bar
$mbar  = new GtkMenuBar();
//Add a menu item
$color  = new GtkMenuItem('_Color');
//with a submenu
$cmenu = new GtkMenu();

//Create a new radio menu item; no group
$red   = new GtkRadioMenuItem(null, '_Red', true);
//Here another one, this time using the $red as group
$blue  = new GtkRadioMenuItem($red, '_Blue', true);
//Again: Same group as the previous, $red
$green = new GtkRadioMenuItem($red, '_Green', true);

//Add the items to the menu

//Set the red item pre-selected

//set some colors to be able to identify the colors
// without reading the text
$red  ->get_child()->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse('#F00'));
$blue ->get_child()->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse('#00F'));
$green->get_child()->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse('#0F0'));

//standard window stuff
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));