gi-gtk-4.0.6: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.EventControllerFocus

Description

GtkEventControllerFocus is an event controller to keep track of keyboard focus.

The event controller offers EventControllerFocus::enter and EventControllerFocus::leave signals, as well as EventControllerFocus:isFocus and EventControllerFocus:containsFocus properties which are updated to reflect focus changes inside the widget hierarchy that is rooted at the controllers widget.

Synopsis

Exported types

newtype EventControllerFocus Source #

Memory-managed wrapper type.

Constructors

EventControllerFocus (ManagedPtr EventControllerFocus) 

Instances

Instances details
Eq EventControllerFocus Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

GObject EventControllerFocus Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

ManagedPtrNewtype EventControllerFocus Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

TypedObject EventControllerFocus Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

Methods

glibType :: IO GType

HasParentTypes EventControllerFocus Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

IsGValue (Maybe EventControllerFocus) Source #

Convert EventControllerFocus to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

type ParentTypes EventControllerFocus Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

type ParentTypes EventControllerFocus = '[EventController, Object]

class (GObject o, IsDescendantOf EventControllerFocus o) => IsEventControllerFocus o Source #

Type class for types which can be safely cast to EventControllerFocus, for instance with toEventControllerFocus.

Instances

Instances details
(GObject o, IsDescendantOf EventControllerFocus o) => IsEventControllerFocus o Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerFocus

toEventControllerFocus :: (MonadIO m, IsEventControllerFocus o) => o -> m EventControllerFocus Source #

Cast to EventControllerFocus, for types for which this is known to be safe. For general casts, use castTo.

Methods

containsFocus

eventControllerFocusContainsFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerFocus a) 
=> a

self: a GtkEventControllerFocus

-> m Bool

Returns: True if focus is within self or one of its children

Returns True if focus is within self or one of its children.

isFocus

eventControllerFocusIsFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerFocus a) 
=> a

self: a GtkEventControllerFocus

-> m Bool

Returns: True if focus is within self, but not one of its children

Returns True if focus is within self, but not one of its children.

new

eventControllerFocusNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m EventControllerFocus

Returns: a new GtkEventControllerFocus

Creates a new event controller that will handle focus events.

Properties

containsFocus

True if focus is contained in the controllers widget.

See EventControllerFocus:isFocus for whether the focus is in the widget itself or inside a descendent.

When handling focus events, this property is updated before EventControllerFocus::enter or EventControllerFocus::leave are emitted.

getEventControllerFocusContainsFocus :: (MonadIO m, IsEventControllerFocus o) => o -> m Bool Source #

Get the value of the “contains-focus” property. When overloading is enabled, this is equivalent to

get eventControllerFocus #containsFocus

isFocus

True if focus is in the controllers widget itself, as opposed to in a descendent widget.

See also EventControllerFocus:containsFocus.

When handling focus events, this property is updated before EventControllerFocus::enter or EventControllerFocus::leave are emitted.

getEventControllerFocusIsFocus :: (MonadIO m, IsEventControllerFocus o) => o -> m Bool Source #

Get the value of the “is-focus” property. When overloading is enabled, this is equivalent to

get eventControllerFocus #isFocus

Signals

enter

type EventControllerFocusEnterCallback = IO () Source #

Emitted whenever the focus enters into the widget or one of its descendents.

Note that this means you may not get an enter signal even though the widget becomes the focus location, in certain cases (such as when the focus moves from a descendent of the widget to the widget itself). If you are interested in these cases, you can monitor the EventControllerFocus:isFocus property for changes.

afterEventControllerFocusEnter :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusEnterCallback) -> m SignalHandlerId Source #

Connect a signal handler for the enter signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerFocus #enter callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onEventControllerFocusEnter :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusEnterCallback) -> m SignalHandlerId Source #

Connect a signal handler for the enter signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerFocus #enter callback

leave

type EventControllerFocusLeaveCallback = IO () Source #

Emitted whenever the focus leaves the widget hierarchy that is rooted at the widget that the controller is attached to.

Note that this means you may not get a leave signal even though the focus moves away from the widget, in certain cases (such as when the focus moves from the widget to a descendent). If you are interested in these cases, you can monitor the EventControllerFocus:isFocus property for changes.

afterEventControllerFocusLeave :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusLeaveCallback) -> m SignalHandlerId Source #

Connect a signal handler for the leave signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerFocus #leave callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onEventControllerFocusLeave :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusLeaveCallback) -> m SignalHandlerId Source #

Connect a signal handler for the leave signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerFocus #leave callback