Re: GTK TopLevel Window



You can use this handy function from glade:

GtkWidget *get_toplevel_widget (GtkWidget *widget)
{
  GtkWidget *parent;

  for (;;)
  {
    if (GTK_IS_MENU (widget))
      parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
    else
      parent = widget->parent;
    if (parent == NULL)
      break;
    widget = parent;
  }
  return (widget);
}

On Wed, 2001-12-05 at 17:29, jmnogier wrote:
> Hello,
> 
> Here is the problem I am facing :
> 
> How do I get the TopLevel GtkWindow of a MenuItem object from a callback ?
> 
> I'd like to perform some action on the TopLevel Window when a MenuItem is
> selected by the user.
> 
> gtk_widget_get_toplevel( widget ) doesn't work. It returns a pointer that do
> not correspond to the actual window.
> 
> I couldn't find an answer in FAQ or emails.
> 
> Anyone to help me ?
> 
> Jean-Marc
> 
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list





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