Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gtkWidgetGetToplevel

gtkWidgetGetToplevel


Description

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.

Usage

gtkWidgetGetToplevel(object)

Arguments

object

a GtkWidget

Details

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.
}

Value

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

Author(s)

Derived by RGtkGen from GTK+ documentation


RGtk2

R Bindings for Gtk 2.8.0 and Above

v2.20.36
GPL
Authors
Michael Lawrence <michafla@gene.com> and Duncan Temple Lang <duncan@wald.ucdavis.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.