._option_menu_get_history_text [gtk+ 1.3.11]



i create menu items with gtk_menu_item_new_with_label but after
a short time the label seems to get moved somewhere.  The on-screen
appearance looks fine but i can't figure out where the label is stored
in memory.  Am i asking for trouble doing this?

const gchar *
app_option_menu_get_history_text (GtkOptionMenu *om)
{
  GtkWidget *menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (om));
  if (!menu)
    return NULL;
  gint cur = gtk_option_menu_get_history (om);
  GtkMenuItem *mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, cur);
  GtkWidget *label = gtk_bin_get_child (GTK_BIN (mi));
  if (!label)
    return NULL;
  return gtk_label_get_text (GTK_LABEL (label));
}

How can the menu item work without a child?  Was it reparented somewhere?

-- 
Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org



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