Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
Root
is the interface implemented by all widgets that can act as a toplevel
widget to a hierarchy of widgets. The root widget takes care of providing the
connection to the windowing system and manages layout, drawing and event delivery
for its widget hierarchy.
Synopsis
- newtype Root = Root (ManagedPtr Root)
- class (GObject o, IsDescendantOf Root o) => IsRoot o
- toRoot :: (MonadIO m, IsRoot o) => o -> m Root
- rootGetDisplay :: (HasCallStack, MonadIO m, IsRoot a) => a -> m Display
- rootGetFocus :: (HasCallStack, MonadIO m, IsRoot a) => a -> m (Maybe Widget)
- rootSetFocus :: (HasCallStack, MonadIO m, IsRoot a, IsWidget b) => a -> Maybe b -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Root Source # | |
IsGValue Root Source # | Convert |
ManagedPtrNewtype Root Source # | |
Defined in GI.Gtk.Interfaces.Root toManagedPtr :: Root -> ManagedPtr Root # | |
TypedObject Root Source # | |
Defined in GI.Gtk.Interfaces.Root | |
GObject Root Source # | |
Defined in GI.Gtk.Interfaces.Root | |
HasParentTypes Root Source # | |
Defined in GI.Gtk.Interfaces.Root | |
type ParentTypes Root Source # | |
Defined in GI.Gtk.Interfaces.Root |
class (GObject o, IsDescendantOf Root o) => IsRoot o Source #
Instances
(GObject o, IsDescendantOf Root o) => IsRoot o Source # | |
Defined in GI.Gtk.Interfaces.Root |
Methods
Overloaded methods
getDisplay
:: (HasCallStack, MonadIO m, IsRoot a) | |
=> a |
|
-> m Display | Returns: the display of |
Returns the display that this GtkRoot is on.
getFocus
:: (HasCallStack, MonadIO m, IsRoot a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the currently focused widget,
or |
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 be False
for the
widget.
setFocus
:: (HasCallStack, MonadIO m, IsRoot a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
If focus
is not the current focus widget, and is focusable, sets
it as the focus widget for the root. If focus
is Nothing
, 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 widgetGrabFocus
instead of this function.