gtkWidgetGetToplevel          package:RGtk2          R Documentation

_g_t_k_W_i_d_g_e_t_G_e_t_T_o_p_l_e_v_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     This function returns the topmost widget in the container
     hierarchy 'widget' is a part of. If 'widget' has no parent
     widgets, it will be returned as the topmost widget. No reference
     will be added to the returned widget; it should not be
     unreferenced.

_U_s_a_g_e:

     gtkWidgetGetToplevel(object)

_A_r_g_u_m_e_n_t_s:

'object': ['GtkWidget']  a 'GtkWidget'

_D_e_t_a_i_l_s:

     Note the difference in behavior vs. 'gtkWidgetGetAncestor';
     'gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)'  would return
     'NULL' if 'widget' wasn't inside a toplevel window, and if the
     window was inside a 'GtkWindow-derived' widget which was in turn
     inside the toplevel 'GtkWindow'. While the second case may seem
     unlikely, it actually happens when a 'GtkPlug' is embedded inside
     a 'GtkSocket' within the same application.

     To reliably find the toplevel 'GtkWindow', use
     'gtkWidgetGetToplevel' and check if the 'TOPLEVEL' flags is set on
     the result.


     toplevel <- widget$getToplevel()
     if (toplevel$flags() & GtkWidgetFlags["toplevel"])
     {
       # Perform action on toplevel.
     }


_V_a_l_u_e:

     ['GtkWidget']  the topmost ancestor of 'widget', or 'widget'
     itself  if there's no ancestor.

_A_u_t_h_o_r(_s):

     Derived by RGtkGen from GTK+ documentation

