Interface Root
- All Known Implementing Classes:
AboutDialog
,AboutWindow
,AppChooserDialog
,ApplicationWindow
,ApplicationWindow
,Assistant
,ColorChooserDialog
,Dialog
,DragIcon
,FileChooserDialog
,FontChooserDialog
,MessageDialog
,MessageDialog
,PageSetupUnixDialog
,PreferencesWindow
,PrintUnixDialog
,Root.RootImpl
,ShortcutsWindow
,Window
,Window
GtkRoot
is the interface implemented by all widgets that can act as a toplevel
widget.
The root widget takes care of providing the connection to the windowing system and manages layout, drawing and event delivery for its widget hierarchy.
The obvious example of a GtkRoot
is GtkWindow
.
To get the display to which a GtkRoot
belongs, use
getDisplay()
.
GtkRoot
also maintains the location of keyboard focus inside its widget
hierarchy, with setFocus(org.gnome.gtk.Widget)
and getFocus()
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
The RootImpl type represents a native instance of the Root interface.static class
Nested classes/interfaces inherited from interface org.gnome.gtk.Native
Native.NativeImpl, Native.NativeInterface
-
Method Summary
Modifier and TypeMethodDescriptiondefault Display
Returns the display that thisGtkRoot
is on.default Widget
getFocus()
Retrieves the current focused widget within the root.static Type
getType()
Get the GType of the Root classdefault void
Iffocus
is not the current focus widget, and is focusable, sets it as the focus widget for the root.Methods inherited from interface org.gnome.gtk.Native
getRenderer, getSurface, getSurfaceTransform, realize, unrealize
-
Method Details
-
getType
-
getDisplay
Returns the display that thisGtkRoot
is on.- Returns:
- the display of
root
-
getFocus
Retrieves the current focused widget within the root.Note that this is the widget that would have the focus if the root is active; if the root is not focused then
gtk_widget_has_focus (widget)
will befalse
for the widget.- Returns:
- the currently focused widget
-
setFocus
Iffocus
is not the current focus widget, and is focusable, sets it as the focus widget for the root.If
focus
isnull
, unsets the focus widget for the root.To set the focus to a particular widget in the root, it is usually more convenient to use
Widget.grabFocus()
instead of this function.- Parameters:
focus
- widget to be the new focus widget, ornull
to unset the focus widget
-