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

Contents

- Exported types
- Methods
  - addCallbackSymbol
  - new

Description

A `GtkBuilderScope` implementation for the C language.

`GtkBuilderCScope` instances use symbols explicitly added to `builder` with prior calls to `builderCScopeAddCallbackSymbol`. If developers want to do that, they are encouraged to create their own scopes for that purpose.

In the case that symbols are not explicitly added; GTK will uses `GModule`’s introspective features (by opening the module `Nothing`) to look at the application’s symbol table. From here it tries to match the signal function names given in the interface description with symbols in the application.

Note that unless `builderCScopeAddCallbackSymbol` is called for all signal callbacks which are referenced by the loaded XML, this functionality will require that `GModule` be supported on the platform.

Synopsis

- newtype BuilderCScope = BuilderCScope (ManagedPtr BuilderCScope)
- class (GObject o, IsDescendantOf BuilderCScope o) => IsBuilderCScope o
- toBuilderCScope :: (MonadIO m, IsBuilderCScope o) => o -> m BuilderCScope
- builderCScopeAddCallbackSymbol :: (HasCallStack, MonadIO m, IsBuilderCScope a) => a -> Text -> Callback -> m ()
- builderCScopeNew :: (HasCallStack, MonadIO m) => m BuilderCScope

# Exported types

newtype BuilderCScope Source #

Memory-managed wrapper type.

Constructors

BuilderCScope (ManagedPtr BuilderCScope) |

#### Instances

Instances details

Eq BuilderCScope Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope Methods (==) :: BuilderCScope -> BuilderCScope -> Bool Source # (/=) :: BuilderCScope -> BuilderCScope -> Bool Source #
GObject BuilderCScope Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope
ManagedPtrNewtype BuilderCScope Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope Methods toManagedPtr :: BuilderCScope -> ManagedPtr BuilderCScope Source #
TypedObject BuilderCScope Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope Methods glibType :: IO GType Source #
HasParentTypes BuilderCScope Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope
IsGValue (Maybe BuilderCScope) Source # | Convert `BuilderCScope` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.BuilderCScope Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe BuilderCScope -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe BuilderCScope) Source #
type ParentTypes BuilderCScope Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope type ParentTypes BuilderCScope = '[Object, BuilderScope]

class (GObject o, IsDescendantOf BuilderCScope o) => IsBuilderCScope o Source #

Type class for types which can be safely cast to `BuilderCScope`, for instance with `toBuilderCScope`.

#### Instances

Instances details

(GObject o, IsDescendantOf BuilderCScope o) => IsBuilderCScope o Source # |
Instance details Defined in GI.Gtk.Objects.BuilderCScope

toBuilderCScope :: (MonadIO m, IsBuilderCScope o) => o -> m BuilderCScope Source #

Cast to `BuilderCScope`, 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

addCallbackSymbol, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## addCallbackSymbol

builderCScopeAddCallbackSymbol Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuilderCScope a) |
=> a | `self`: a `GtkBuilderCScope`
-> Text | `callbackName`: The name of the callback, as expected in the XML
-> Callback | `callbackSymbol`: The callback pointer
-> m () |

Adds the `callbackSymbol` to the scope of `builder` under the given `callbackName`.

Using this function overrides the behavior of `builderCreateClosure` for any callback symbols that are added. Using this method allows for better encapsulation as it does not require that callback symbols be declared in the global namespace.

## new

builderCScopeNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m BuilderCScope | Returns: a new `GtkBuilderCScope`

Creates a new `GtkBuilderCScope` object to use with future `GtkBuilder` instances.

Calling this function is only necessary if you want to add custom callbacks via `builderCScopeAddCallbackSymbol`.