gtk_widget_get_toplevel() weirdness.



  
  I'm getting weird behavior out of gtk_widget_get_toplevel in KDE under
RH Linux, but no similar problems in gtk-Win32....
  
  For example if I retrieve a widget's toplevel window in Linux:  

  GtkWidget *Top=gtk_widget_get_toplevel(child);

and then print the top's name:

  g_print("Top is:%s \n",gtk_widget_get_name(Top));
  
  It *always* returns the string "GtkWindow", no matter what the
toplevel's name really was set to.  In Win32 on the other hand it returns
the right answer.
  More importantly though, none of Top's user-data is accessible either;
it's almost as if Top is a completely different widget from the real top.
 

  My theory is that somehow the KDE wm is holding my gtk windows in
higher-level containers, and gtk_widget_get_toplevel is finding those
instead.  
  
  Any workarounds for this?  I am using Glade-generated code, which
nicely allows one to access every sub-widget by name *if* one can get a
pointer to the toplevel... 
  Each menu widget must therefore find its top-mother before it can talk
to any of its brothers.
  
  Cheers,
  John
  
  

  

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.



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