gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.EventControllerFocus

Contents

- Exported types
- Methods
  - containsFocus
  - isFocus
  - new
- Properties
  - containsFocus
  - isFocus
- Signals
  - enter
  - leave

Description

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

Constructors

EventControllerFocus (ManagedPtr EventControllerFocus) |

#### Instances

Instances details

Eq EventControllerFocus Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerFocus Methods (==) :: EventControllerFocus -> EventControllerFocus -> Bool Source # (/=) :: EventControllerFocus -> EventControllerFocus -> Bool Source #
GObject EventControllerFocus Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerFocus
ManagedPtrNewtype EventControllerFocus Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerFocus Methods toManagedPtr :: EventControllerFocus -> ManagedPtr EventControllerFocus Source #
TypedObject EventControllerFocus Source # |
Instance details Defined in GI.Gtk.Objects.EventControllerFocus Methods glibType :: IO GType Source #
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 Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe EventControllerFocus -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe EventControllerFocus) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### 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 #

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