Getting the label from gtk_radio_menu_item_new_with_label()



I'm borrowing the code from testgtk.c which looks similar to the
following:

static GtkWidget *
build_option_menu(...)
{
  ...
  omenu = gtk_option_menu_new ();
  menu = gtk_menu_new ();
  group = NULL;
  for (i = 0; i < num_items; i++)
    {
      menu_item = gtk_radio_menu_item_new_with_label (group, labeltext);
      gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
    			  (GtkSignalFunc) my_callback, data);
      ...
    }
  ...
}

In the callback function, the first parameter should be the menu item
widget.  That is:

	void
	my_callback(GtkWidget *wgt, gpointer cbdata)
	{
		...
	}

"wgt" should point to the "menu_item" widget from up above.

My question is this: how can get at the label widget which is created
as part of the menu item from gtk_radio_menu_item_new_with_label() ?

any help would be appreciated,
--andy



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]