Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype EventControllerFocus = EventControllerFocus (ManagedPtr EventControllerFocus)
- class (GObject o, IsDescendantOf EventControllerFocus o) => IsEventControllerFocus o
- toEventControllerFocus :: (MonadIO m, IsEventControllerFocus o) => o -> m EventControllerFocus
- eventControllerFocusContainsFocus :: (HasCallStack, MonadIO m, IsEventControllerFocus a) => a -> m Bool
- eventControllerFocusIsFocus :: (HasCallStack, MonadIO m, IsEventControllerFocus a) => a -> m Bool
- eventControllerFocusNew :: (HasCallStack, MonadIO m) => m EventControllerFocus
- getEventControllerFocusContainsFocus :: (MonadIO m, IsEventControllerFocus o) => o -> m Bool
- getEventControllerFocusIsFocus :: (MonadIO m, IsEventControllerFocus o) => o -> m Bool
- type EventControllerFocusEnterCallback = IO ()
- afterEventControllerFocusEnter :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusEnterCallback) -> m SignalHandlerId
- onEventControllerFocusEnter :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusEnterCallback) -> m SignalHandlerId
- type EventControllerFocusLeaveCallback = IO ()
- afterEventControllerFocusLeave :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusLeaveCallback) -> m SignalHandlerId
- onEventControllerFocusLeave :: (IsEventControllerFocus a, MonadIO m) => a -> ((?self :: a) => EventControllerFocusLeaveCallback) -> m SignalHandlerId
Exported types
newtype EventControllerFocus Source #
Memory-managed wrapper type.
EventControllerFocus (ManagedPtr EventControllerFocus) |
Instances
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
(GObject o, IsDescendantOf EventControllerFocus o) => IsEventControllerFocus o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, containsFocus, forceFloating, freezeNotify, getv, isFloating, isFocus, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getData, getName, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getWidget.
Setters
setData, setDataFull, setName, setPropagationLimit, setPropagationPhase, setProperty, setStaticName.
containsFocus
eventControllerFocusContainsFocus Source #
:: (HasCallStack, MonadIO m, IsEventControllerFocus a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if focus is within self
or one of its children.
isFocus
eventControllerFocusIsFocus Source #
:: (HasCallStack, MonadIO m, IsEventControllerFocus a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if focus is within self
, but not one of its children.
new
eventControllerFocusNew Source #
:: (HasCallStack, MonadIO m) | |
=> m EventControllerFocus | Returns: a new |
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