gi-gtk-3.0.36: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Widget

Contents

Description

GtkWidget is the base class all widgets in GTK+ derive from. It manages the widget lifecycle, states and style.

{geometry-management}

GTK+ uses a height-for-width (and width-for-height) geometry management system. Height-for-width means that a widget can change how much vertical space it needs, depending on the amount of horizontal space that it is given (and similar for width-for-height). The most common example is a label that reflows to fill up the available width, wraps to fewer lines, and therefore needs less height.

Height-for-width geometry management is implemented in GTK+ by way of five virtual methods:

There are some important things to keep in mind when implementing height-for-width and when using it in container implementations.

The geometry management system will query a widget hierarchy in only one orientation at a time. When widgets are initially queried for their minimum sizes it is generally done in two initial passes in the SizeRequestMode chosen by the toplevel.

For example, when queried in the normal SizeRequestModeHeightForWidth mode: First, the default minimum and natural width for each widget in the interface will be computed using widgetGetPreferredWidth. Because the preferred widths for each container depend on the preferred widths of their children, this information propagates up the hierarchy, and finally a minimum and natural width is determined for the entire toplevel. Next, the toplevel will use the minimum width to query for the minimum height contextual to that width using widgetGetPreferredHeightForWidth, which will also be a highly recursive operation. The minimum height for the minimum width is normally used to set the minimum size constraint on the toplevel (unless windowSetGeometryHints is explicitly used instead).

After the toplevel window has initially requested its size in both dimensions it can go on to allocate itself a reasonable size (or a size previously specified with windowSetDefaultSize). During the recursive allocation process it’s important to note that request cycles will be recursively executed while container widgets allocate their children. Each container widget, once allocated a size, will go on to first share the space in one orientation among its children and then request each child's height for its target allocated width or its width for allocated height, depending. In this way a Widget will typically be requested its size a number of times before actually being allocated a size. The size a widget is finally allocated can of course differ from the size it has requested. For this reason, Widget caches a small number of results to avoid re-querying for the same sizes in one allocation cycle.

See [GtkContainer’s geometry management section][container-geometry-management] to learn more about how height-for-width allocations are performed by container widgets.

If a widget does move content around to intelligently use up the allocated size then it must support the request in both GtkSizeRequestModes even if the widget in question only trades sizes in a single orientation.

For instance, a Label that does height-for-width word wrapping will not expect to have WidgetClass.get_preferred_height() called because that call is specific to a width-for-height request. In this case the label must return the height required for its own minimum possible width. By following this rule any widget that handles height-for-width or width-for-height requests will always be allocated at least enough space to fit its own content.

Here are some examples of how a SizeRequestModeHeightForWidth widget generally deals with width-for-height requests, for WidgetClass.get_preferred_height() it will do:

C code

static void
foo_widget_get_preferred_height (GtkWidget *widget,
                                 gint *min_height,
                                 gint *nat_height)
{
   if (i_am_in_height_for_width_mode)
     {
       gint min_width, nat_width;

       GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget,
                                                           &min_width,
                                                           &nat_width);
       GTK_WIDGET_GET_CLASS (widget)->get_preferred_height_for_width
                                                          (widget,
                                                           min_width,
                                                           min_height,
                                                           nat_height);
     }
   else
     {
        ... some widgets do both. For instance, if a GtkLabel is
        rotated to 90 degrees it will return the minimum and
        natural height for the rotated label here.
     }
}

And in WidgetClass.get_preferred_width_for_height() it will simply return the minimum and natural width:

C code

static void
foo_widget_get_preferred_width_for_height (GtkWidget *widget,
                                           gint for_height,
                                           gint *min_width,
                                           gint *nat_width)
{
   if (i_am_in_height_for_width_mode)
     {
       GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget,
                                                           min_width,
                                                           nat_width);
     }
   else
     {
        ... again if a widget is sometimes operating in
        width-for-height mode (like a rotated GtkLabel) it can go
        ahead and do its real width for height calculation here.
     }
}

Often a widget needs to get its own request during size request or allocation. For example, when computing height it may need to also compute width. Or when deciding how to use an allocation, the widget may need to know its natural size. In these cases, the widget should be careful to call its virtual methods directly, like this:

C code

GTK_WIDGET_GET_CLASS(widget)->get_preferred_width (widget,
                                                   &min,
                                                   &natural);

It will not work to use the wrapper functions, such as widgetGetPreferredWidth inside your own size request implementation. These return a request adjusted by SizeGroup and by the WidgetClass.adjust_size_request() virtual method. If a widget used the wrappers inside its virtual method implementations, then the adjustments (such as widget margins) would be applied twice. GTK+ therefore does not allow this and will warn if you try to do it.

Of course if you are getting the size request for another widget, such as a child of a container, you must use the wrapper APIs. Otherwise, you would not properly consider widget margins, SizeGroup, and so forth.

Since 3.10 GTK+ also supports baseline vertical alignment of widgets. This means that widgets are positioned such that the typographical baseline of widgets in the same row are aligned. This happens if a widget supports baselines, has a vertical alignment of AlignBaseline, and is inside a container that supports baselines and has a natural “row” that it aligns to the baseline, or a baseline assigned to it by the grandparent.

Baseline alignment support for a widget is done by the WidgetClass.get_preferred_height_and_baseline_for_width() virtual function. It allows you to report a baseline in combination with the minimum and natural height. If there is no baseline you can return -1 to indicate this. The default implementation of this virtual function calls into the WidgetClass.get_preferred_height() and WidgetClass.get_preferred_height_for_width(), so if baselines are not supported it doesn’t need to be implemented.

If a widget ends up baseline aligned it will be allocated all the space in the parent as if it was AlignFill, but the selected baseline can be found via widgetGetAllocatedBaseline. If this has a value other than -1 you need to align the widget such that the baseline appears at the position.

Style Properties

Widget introduces “style properties” - these are basically object properties that are stored not on the object, but in the style object associated to the widget. Style properties are set in [resource files][gtk3-Resource-Files]. This mechanism is used for configuring such things as the location of the scrollbar arrows through the theme, giving theme authors more control over the look of applications without the need to write a theme engine in C.

Use widgetClassInstallStyleProperty to install style properties for a widget class, widgetClassFindStyleProperty or widgetClassListStyleProperties to get information about existing style properties and widgetStyleGetProperty, gtk_widget_style_get() or gtk_widget_style_get_valist() to obtain the value of a style property.

GtkWidget as GtkBuildable

The GtkWidget implementation of the GtkBuildable interface supports a custom <accelerator> element, which has attributes named ”key”, ”modifiers” and ”signal” and allows to specify accelerators.

An example of a UI definition fragment specifying an accelerator: > >class="GtkButton" > key="q" modifiers="GDK_CONTROL_MASK" signal="clicked"/ >/object

In addition to accelerators, GtkWidget also support a custom <accessible> element, which supports actions and relations. Properties on the accessible implementation of an object can be set by accessing the internal child “accessible” of a Widget.

An example of a UI definition fragment specifying an accessible: > >class="GtkLabel" id="label1"/ > name="label"I am a Label for a Button/property >/object >class="GtkButton" id="button1" > accessibility > action_name="click" translatable="yes"Click the button./action > target="label1" type="labelled-by"/ > /accessibility > internal-child="accessible" > class="AtkObject" id="a11y-button1" > name="accessible-name"Clickable Button/property > /object > /child >/object

Finally, GtkWidget allows style information such as style classes to be associated with widgets, using the custom <style> element: > >class="GtkButton" id="button1" > style > name="my-special-button-class"/ > name="dark-button"/ > /style >/object

# {composite-templates}

GtkWidget exposes some facilities to automate the procedure of creating composite widgets using Builder interface description language.

To create composite widgets with Builder XML, one must associate the interface description with the widget class at class initialization time using widgetClassSetTemplate.

The interface description semantics expected in composite template descriptions is slightly different from regular Builder XML.

Unlike regular interface descriptions, widgetClassSetTemplate will expect a <template> tag as a direct child of the toplevel <interface> tag. The <template> tag must specify the “class” attribute which must be the type name of the widget. Optionally, the “parent” attribute may be specified to specify the direct parent type of the widget type, this is ignored by the GtkBuilder but required for Glade to introspect what kind of properties and internal children exist for a given type when the actual type does not exist.

The XML which is contained inside the <template> tag behaves as if it were added to the <object> tag defining widget itself. You may set properties on widget by inserting <property> tags into the <template> tag, and also add <child> tags to add children and extend widget in the normal way you would with <object> tags.

Additionally, <object> tags can also be added before and after the initial <template> tag in the normal way, allowing one to define auxiliary objects which might be referenced by other widgets declared as children of the <template> tag.

An example of a GtkBuilder Template Definition: > >interface > class="FooWidget" parent="GtkBox" > name="orientation"GTK_ORIENTATION_HORIZONTAL/property > name="spacing"4/property > child > class="GtkButton" id="hello_button" > name="label"Hello World/property > name="clicked" handler="hello_button_clicked" object="FooWidget" swapped="yes"/ > /object > /child > child > class="GtkButton" id="goodbye_button" > name="label"Goodbye World/property > /object > /child > /template >/interface

Typically, you'll place the template fragment into a file that is bundled with your project, using Resource. In order to load the template, you need to call widgetClassSetTemplateFromResource from the class initialization of your Widget type:

C code

static void
foo_widget_class_init (FooWidgetClass *klass)
{
  // ...

  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
                                               "/com/example/ui/foowidget.ui");
}

You will also need to call widgetInitTemplate from the instance initialization function:

C code

static void
foo_widget_init (FooWidget *self)
{
  // ...
  gtk_widget_init_template (GTK_WIDGET (self));
}

You can access widgets defined in the template using the widgetGetTemplateChild function, but you will typically declare a pointer in the instance private data structure of your type using the same name as the widget in the template definition, and call gtk_widget_class_bind_template_child_private() with that name, e.g.

C code

typedef struct {
  GtkWidget *hello_button;
  GtkWidget *goodbye_button;
} FooWidgetPrivate;

G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget, GTK_TYPE_BOX)

static void
foo_widget_class_init (FooWidgetClass *klass)
{
  // ...
  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
                                               "/com/example/ui/foowidget.ui");
  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
                                                FooWidget, hello_button);
  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
                                                FooWidget, goodbye_button);
}

static void
foo_widget_init (FooWidget *widget)
{

}

You can also use gtk_widget_class_bind_template_callback() to connect a signal callback defined in the template with a function visible in the scope of the class, e.g.

C code

// the signal handler has the instance and user data swapped
// because of the swapped="yes" attribute in the template XML
static void
hello_button_clicked (FooWidget *self,
                      GtkButton *button)
{
  g_print ("Hello, world!\n");
}

static void
foo_widget_class_init (FooWidgetClass *klass)
{
  // ...
  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
                                               "/com/example/ui/foowidget.ui");
  gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), hello_button_clicked);
}
Synopsis

Exported types

newtype Widget Source #

Memory-managed wrapper type.

Constructors

Widget (ManagedPtr Widget) 

Instances

Instances details
Eq Widget Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

Methods

(==) :: Widget -> Widget -> Bool #

(/=) :: Widget -> Widget -> Bool #

IsGValue Widget Source #

Convert Widget to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Widget

ManagedPtrNewtype Widget Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

TypedObject Widget Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

Methods

glibType :: IO GType #

GObject Widget Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

HasParentTypes Widget Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

type ParentTypes Widget Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

class (GObject o, IsDescendantOf Widget o) => IsWidget o Source #

Type class for types which can be safely cast to Widget, for instance with toWidget.

Instances

Instances details
(GObject o, IsDescendantOf Widget o) => IsWidget o Source # 
Instance details

Defined in GI.Gtk.Objects.Widget

toWidget :: (MonadIO m, IsWidget o) => o -> m Widget Source #

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

Methods

Overloaded methods

activate

widgetActivate Source #

Arguments

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

widget: a Widget that’s activatable

-> m Bool

Returns: True if the widget was activatable

For widgets that can be “activated” (buttons, menu items, etc.) this function activates them. Activation is what happens when you press Enter on a widget during key navigation. If widget isn't activatable, the function returns False.

addAccelerator

widgetAddAccelerator Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsAccelGroup b) 
=> a

widget: widget to install an accelerator on

-> Text

accelSignal: widget signal to emit on accelerator activation

-> b

accelGroup: accel group for this widget, added to its toplevel

-> Word32

accelKey: GDK keyval of the accelerator

-> [ModifierType]

accelMods: modifier key combination of the accelerator

-> [AccelFlags]

accelFlags: flag accelerators, e.g. AccelFlagsVisible

-> m () 

Installs an accelerator for this widget in accelGroup that causes accelSignal to be emitted if the accelerator is activated. The accelGroup needs to be added to the widget’s toplevel via windowAddAccelGroup, and the signal must be of type SignalFlagsAction. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use accelMapAddEntry and widgetSetAccelPath or menuItemSetAccelPath instead.

addDeviceEvents

widgetAddDeviceEvents Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDevice b) 
=> a

widget: a Widget

-> b

device: a Device

-> [EventMask]

events: an event mask, see EventMask

-> m () 

Adds the device events in the bitfield events to the event mask for widget. See widgetSetDeviceEvents for details.

Since: 3.0

addEvents

widgetAddEvents Source #

Arguments

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

widget: a Widget

-> [EventMask]

events: an event mask, see EventMask

-> m () 

Adds the events in the bitfield events to the event mask for widget. See widgetSetEvents and the [input handling overview][event-masks] for details.

addMnemonicLabel

widgetAddMnemonicLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

widget: a Widget

-> b

label: a Widget that acts as a mnemonic label for widget

-> m () 

Adds a widget to the list of mnemonic labels for this widget. (See widgetListMnemonicLabels). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the destroy signal or a weak notifier.

Since: 2.4

addTickCallback

widgetAddTickCallback Source #

Arguments

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

widget: a Widget

-> TickCallback

callback: function to call for updating animations

-> m Word32

Returns: an id for the connection of this callback. Remove the callback by passing it to widgetRemoveTickCallback

Queues an animation frame update and adds a callback to be called before each frame. Until the tick callback is removed, it will be called frequently (usually at the frame rate of the output device or as quickly as the application can be repainted, whichever is slower). For this reason, is most suitable for handling graphics that change every frame or every few frames. The tick callback does not automatically imply a relayout or repaint. If you want a repaint or relayout, and aren’t changing widget properties that would trigger that (for example, changing the text of a Label), then you will have to call widgetQueueResize or widgetQueueDrawArea yourself.

frameClockGetFrameTime should generally be used for timing continuous animations and frameTimingsGetPredictedPresentationTime if you are trying to display isolated frames at particular times.

This is a more convenient alternative to connecting directly to the update signal of FrameClock, since you don't have to worry about when a FrameClock is assigned to a widget.

Since: 3.8

canActivateAccel

widgetCanActivateAccel Source #

Arguments

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

widget: a Widget

-> Word32

signalId: the ID of a signal installed on widget

-> m Bool

Returns: True if the accelerator can be activated.

Determines whether an accelerator that activates the signal identified by signalId can currently be activated. This is done by emitting the canActivateAccel signal on widget; if the signal isn’t overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped.

Since: 2.4

childFocus

widgetChildFocus Source #

Arguments

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

widget: a Widget

-> DirectionType

direction: direction of focus movement

-> m Bool

Returns: True if focus ended up inside widget

This function is used by custom widget implementations; if you're writing an app, you’d use widgetGrabFocus to move the focus to a particular widget, and containerSetFocusChain to change the focus tab order. So you may want to investigate those functions instead.

widgetChildFocus is called by containers as the user moves around the window using keyboard shortcuts. direction indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). widgetChildFocus emits the focus signal; widgets override the default handler for this signal in order to implement appropriate focus behavior.

The default focus handler for a widget should return True if moving in direction left the focus on a focusable location inside that widget, and False if moving in direction moved the focus outside the widget. If returning True, widgets normally call widgetGrabFocus to place the focus accordingly; if returning False, they don’t modify the current focus location.

childNotify

widgetChildNotify Source #

Arguments

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

widget: a Widget

-> Text

childProperty: the name of a child property installed on the class of widget’s parent

-> m () 

Emits a childNotify signal for the [child property][child-properties] childProperty on widget.

This is the analogue of objectNotify for child properties.

Also see containerChildNotify.

classPath

widgetClassPath Source #

Arguments

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

widget: a Widget

-> m (Word32, Text, Text) 

Deprecated: (Since version 3.0)Use widgetGetPath instead

Same as widgetPath, but always uses the name of a widget’s type, never uses a custom name set with widgetSetName.

computeExpand

widgetComputeExpand Source #

Arguments

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

widget: the widget

-> Orientation

orientation: expand direction

-> m Bool

Returns: whether widget tree rooted here should be expanded

Computes whether a container should give this widget extra space when possible. Containers should check this, rather than looking at widgetGetHexpand or widgetGetVexpand.

This function already checks whether the widget is visible, so visibility does not need to be checked separately. Non-visible widgets are not expanded.

The computed expand value uses either the expand setting explicitly set on the widget itself, or, if none has been explicitly set, the widget may expand if some of its children do.

createPangoContext

widgetCreatePangoContext Source #

Arguments

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

widget: a Widget

-> m Context

Returns: the new Context

Creates a new Context with the appropriate font map, font options, font description, and base direction for drawing text for this widget. See also widgetGetPangoContext.

createPangoLayout

widgetCreatePangoLayout Source #

Arguments

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

widget: a Widget

-> Maybe Text

text: text to set on the layout (can be Nothing)

-> m Layout

Returns: the new Layout

Creates a new Layout with the appropriate font map, font description, and base direction for drawing text for this widget.

If you keep a Layout created in this way around, you need to re-create it when the widget Context is replaced. This can be tracked by using the screenChanged signal on the widget.

destroy

widgetDestroy Source #

Arguments

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

widget: a Widget

-> m () 

Destroys a widget.

When a widget is destroyed all references it holds on other objects will be released:

  • if the widget is inside a container, it will be removed from its parent
  • if the widget is a container, all its children will be destroyed, recursively
  • if the widget is a top level, it will be removed from the list of top level widgets that GTK+ maintains internally

It's expected that all references held on the widget will also be released; you should connect to the destroy signal if you hold a reference to widget and you wish to remove it when this function is called. It is not necessary to do so if you are implementing a Container, as you'll be able to use the ContainerClass.remove() virtual function for that.

It's important to notice that widgetDestroy will only cause the widget to be finalized if no additional references, acquired using objectRef, are held on it. In case additional references are in place, the widget will be in an "inert" state after calling this function; widget will still point to valid memory, allowing you to release the references you hold, but you may not query the widget's own state.

You should typically call this function on top level widgets, and rarely on child widgets.

See also: containerRemove

destroyed

widgetDestroyed Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

widget: a Widget

-> b

widgetPointer: address of a variable that contains widget

-> m Widget 

This function sets *widgetPointer to Nothing if widgetPointer != Nothing. It’s intended to be used as a callback connected to the “destroy” signal of a widget. You connect widgetDestroyed as a signal handler, and pass the address of your widget variable as user data. Then when the widget is destroyed, the variable will be set to Nothing. Useful for example to avoid multiple copies of the same dialog.

deviceIsShadowed

widgetDeviceIsShadowed Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDevice b) 
=> a

widget: a Widget

-> b

device: a Device

-> m Bool

Returns: True if there is an ongoing grab on device by another Widget than widget.

Returns True if device has been shadowed by a GTK+ device grab on another widget, so it would stop sending events to widget. This may be used in the grabNotify signal to check for specific devices. See deviceGrabAdd.

Since: 3.0

dragBegin

widgetDragBegin Source #

Arguments

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

widget: the source widget

-> TargetList

targets: The targets (data formats) in which the source can provide the data

-> [DragAction]

actions: A bitmask of the allowed drag actions for this drag

-> Int32

button: The button the user clicked to start the drag

-> Maybe Event

event: The event that triggered the start of the drag, or Nothing if none can be obtained.

-> m DragContext

Returns: the context for this drag

Deprecated: (Since version 3.10)Use widgetDragBeginWithCoordinates instead

This function is equivalent to widgetDragBeginWithCoordinates, passing -1, -1 as coordinates.

dragBeginWithCoordinates

widgetDragBeginWithCoordinates Source #

Arguments

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

widget: the source widget

-> TargetList

targets: The targets (data formats) in which the source can provide the data

-> [DragAction]

actions: A bitmask of the allowed drag actions for this drag

-> Int32

button: The button the user clicked to start the drag

-> Maybe Event

event: The event that triggered the start of the drag, or Nothing if none can be obtained.

-> Int32

x: The initial x coordinate to start dragging from, in the coordinate space of widget. If -1 is passed, the coordinates are retrieved from event or the current pointer position

-> Int32

y: The initial y coordinate to start dragging from, in the coordinate space of widget. If -1 is passed, the coordinates are retrieved from event or the current pointer position

-> m DragContext

Returns: the context for this drag

Initiates a drag on the source side. The function only needs to be used when the application is starting drags itself, and is not needed when widgetDragSourceSet is used.

The event is used to retrieve the timestamp that will be used internally to grab the pointer. If event is Nothing, then CURRENT_TIME will be used. However, you should try to pass a real event in all cases, since that can be used to get information about the drag.

Generally there are three cases when you want to start a drag by hand by calling this function:

  1. During a buttonPressEvent handler, if you want to start a drag immediately when the user presses the mouse button. Pass the event that you have in your buttonPressEvent handler.
  2. During a motionNotifyEvent handler, if you want to start a drag when the mouse moves past a certain threshold distance after a button-press. Pass the event that you have in your motionNotifyEvent handler.
  3. During a timeout handler, if you want to start a drag after the mouse button is held down for some time. Try to save the last event that you got from the mouse, using eventCopy, and pass it to this function (remember to free the event with eventFree when you are done). If you really cannot pass a real event, pass Nothing instead.

Since: 3.10

dragCheckThreshold

widgetDragCheckThreshold Source #

Arguments

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

widget: a Widget

-> Int32

startX: X coordinate of start of drag

-> Int32

startY: Y coordinate of start of drag

-> Int32

currentX: current X coordinate

-> Int32

currentY: current Y coordinate

-> m Bool

Returns: True if the drag threshold has been passed.

Checks to see if a mouse drag starting at (startX, startY) and ending at (currentX, currentY) has passed the GTK+ drag threshold, and thus should trigger the beginning of a drag-and-drop operation.

dragDestAddImageTargets

widgetDragDestAddImageTargets Source #

Arguments

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

widget: a Widget that’s a drag destination

-> m () 

Add the image targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use targetListAddImageTargets and widgetDragDestSetTargetList.

Since: 2.6

dragDestAddTextTargets

widgetDragDestAddTextTargets Source #

Arguments

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

widget: a Widget that’s a drag destination

-> m () 

Add the text targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use targetListAddTextTargets and widgetDragDestSetTargetList.

Since: 2.6

dragDestAddUriTargets

widgetDragDestAddUriTargets Source #

Arguments

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

widget: a Widget that’s a drag destination

-> m () 

Add the URI targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use targetListAddUriTargets and widgetDragDestSetTargetList.

Since: 2.6

dragDestFindTarget

widgetDragDestFindTarget Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDragContext b) 
=> a

widget: drag destination widget

-> b

context: drag context

-> Maybe TargetList

targetList: list of droppable targets, or Nothing to use gtk_drag_dest_get_target_list (widget).

-> m (Maybe Atom)

Returns: first target that the source offers and the dest can accept, or GDK_NONE

Looks for a match between the supported targets of context and the destTargetList, returning the first matching target, otherwise returning GDK_NONE. destTargetList should usually be the return value from widgetDragDestGetTargetList, but some widgets may have different valid targets for different parts of the widget; in that case, they will have to implement a drag_motion handler that passes the correct target list to this function.

dragDestGetTargetList

widgetDragDestGetTargetList Source #

Arguments

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

widget: a Widget

-> m (Maybe TargetList)

Returns: the TargetList, or Nothing if none

Returns the list of targets this widget can accept from drag-and-drop.

dragDestGetTrackMotion

widgetDragDestGetTrackMotion Source #

Arguments

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

widget: a Widget that’s a drag destination

-> m Bool

Returns: True if the widget always emits dragMotion events

Returns whether the widget has been configured to always emit dragMotion signals.

Since: 2.10

dragDestSet

widgetDragDestSet Source #

Arguments

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

widget: a Widget

-> [DestDefaults]

flags: which types of default drag behavior to use

-> Maybe [TargetEntry]

targets: a pointer to an array of GtkTargetEntrys indicating the drop types that this widget will accept, or Nothing. Later you can access the list with widgetDragDestGetTargetList and widgetDragDestFindTarget.

-> [DragAction]

actions: a bitmask of possible actions for a drop onto this widget.

-> m () 

Sets a widget as a potential drop destination, and adds default behaviors.

The default behaviors listed in flags have an effect similar to installing default handlers for the widget’s drag-and-drop signals ([dragMotion](GI.Gtk.Objects.Widget), dragDrop, ...). They all exist for convenience. When passing GTK_DEST_DEFAULT_ALL for instance it is sufficient to connect to the widget’s dragDataReceived signal to get primitive, but consistent drag-and-drop support.

Things become more complicated when you try to preview the dragged data, as described in the documentation for dragMotion. The default behaviors described by flags make some assumptions, that can conflict with your own signal handlers. For instance GTK_DEST_DEFAULT_DROP causes invokations of dragStatus in the context of dragMotion, and invokations of dragFinish in dragDataReceived. Especially the later is dramatic, when your own dragMotion handler calls widgetDragGetData to inspect the dragged data.

There’s no way to set a default action here, you can use the dragMotion callback for that. Here’s an example which selects the action to use depending on whether the control key is pressed or not:

C code

static void
drag_motion (GtkWidget *widget,
             GdkDragContext *context,
             gint x,
             gint y,
             guint time)
{
  GdkModifierType mask;

  gdk_window_get_pointer (gtk_widget_get_window (widget),
                          NULL, NULL, &mask);
  if (mask & GDK_CONTROL_MASK)
    gdk_drag_status (context, GDK_ACTION_COPY, time);
  else
    gdk_drag_status (context, GDK_ACTION_MOVE, time);
}

dragDestSetProxy

widgetDragDestSetProxy Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWindow b) 
=> a

widget: a Widget

-> b

proxyWindow: the window to which to forward drag events

-> DragProtocol

protocol: the drag protocol which the proxyWindow accepts (You can use gdk_drag_get_protocol() to determine this)

-> Bool

useCoordinates: If True, send the same coordinates to the destination, because it is an embedded subwindow.

-> m () 

Deprecated: (Since version 3.22)

Sets this widget as a proxy for drops to another window.

dragDestSetTargetList

widgetDragDestSetTargetList Source #

Arguments

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

widget: a Widget that’s a drag destination

-> Maybe TargetList

targetList: list of droppable targets, or Nothing for none

-> m () 

Sets the target types that this widget can accept from drag-and-drop. The widget must first be made into a drag destination with widgetDragDestSet.

dragDestSetTrackMotion

widgetDragDestSetTrackMotion Source #

Arguments

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

widget: a Widget that’s a drag destination

-> Bool

trackMotion: whether to accept all targets

-> m () 

Tells the widget to emit dragMotion and dragLeave events regardless of the targets and the DestDefaultsMotion flag.

This may be used when a widget wants to do generic actions regardless of the targets that the source offers.

Since: 2.10

dragDestUnset

widgetDragDestUnset Source #

Arguments

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

widget: a Widget

-> m () 

Clears information about a drop destination set with widgetDragDestSet. The widget will no longer receive notification of drags.

dragGetData

widgetDragGetData Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDragContext b) 
=> a

widget: the widget that will receive the dragDataReceived signal

-> b

context: the drag context

-> Atom

target: the target (form of the data) to retrieve

-> Word32

time_: a timestamp for retrieving the data. This will generally be the time received in a dragMotion or dragDrop signal

-> m () 

Gets the data associated with a drag. When the data is received or the retrieval fails, GTK+ will emit a dragDataReceived signal. Failure of the retrieval is indicated by the length field of the selectionData signal parameter being negative. However, when widgetDragGetData is called implicitely because the DestDefaultsDrop was set, then the widget will not receive notification of failed drops.

dragHighlight

widgetDragHighlight Source #

Arguments

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

widget: a widget to highlight

-> m () 

Highlights a widget as a currently hovered drop target. To end the highlight, call widgetDragUnhighlight. GTK+ calls this automatically if DestDefaultsHighlight is set.

dragSourceAddImageTargets

widgetDragSourceAddImageTargets Source #

Arguments

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

widget: a Widget that’s is a drag source

-> m () 

Add the writable image targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use targetListAddImageTargets and widgetDragSourceSetTargetList.

Since: 2.6

dragSourceAddTextTargets

widgetDragSourceAddTextTargets Source #

Arguments

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

widget: a Widget that’s is a drag source

-> m () 

Add the text targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use targetListAddTextTargets and widgetDragSourceSetTargetList.

Since: 2.6

dragSourceAddUriTargets

widgetDragSourceAddUriTargets Source #

Arguments

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

widget: a Widget that’s is a drag source

-> m () 

Add the URI targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use targetListAddUriTargets and widgetDragSourceSetTargetList.

Since: 2.6

dragSourceGetTargetList

widgetDragSourceGetTargetList Source #

Arguments

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

widget: a Widget

-> m (Maybe TargetList)

Returns: the TargetList, or Nothing if none

Gets the list of targets this widget can provide for drag-and-drop.

Since: 2.4

dragSourceSet

widgetDragSourceSet Source #

Arguments

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

widget: a Widget

-> [ModifierType]

startButtonMask: the bitmask of buttons that can start the drag

-> Maybe [TargetEntry]

targets: the table of targets that the drag will support, may be Nothing

-> [DragAction]

actions: the bitmask of possible actions for a drag from this widget

-> m () 

Sets up a widget so that GTK+ will start a drag operation when the user clicks and drags on the widget. The widget must have a window.

dragSourceSetIconGicon

widgetDragSourceSetIconGicon Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsIcon b) 
=> a

widget: a Widget

-> b

icon: A Icon

-> m () 

Sets the icon that will be used for drags from a particular source to icon. See the docs for IconTheme for more details.

Since: 3.2

dragSourceSetIconName

widgetDragSourceSetIconName Source #

Arguments

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

widget: a Widget

-> Text

iconName: name of icon to use

-> m () 

Sets the icon that will be used for drags from a particular source to a themed icon. See the docs for IconTheme for more details.

Since: 2.8

dragSourceSetIconPixbuf

widgetDragSourceSetIconPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsPixbuf b) 
=> a

widget: a Widget

-> b

pixbuf: the Pixbuf for the drag icon

-> m () 

Sets the icon that will be used for drags from a particular widget from a Pixbuf. GTK+ retains a reference for pixbuf and will release it when it is no longer needed.

dragSourceSetIconStock

widgetDragSourceSetIconStock Source #

Arguments

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

widget: a Widget

-> Text

stockId: the ID of the stock icon to use

-> m () 

Deprecated: (Since version 3.10)Use widgetDragSourceSetIconName instead.

Sets the icon that will be used for drags from a particular source to a stock icon.

dragSourceSetTargetList

widgetDragSourceSetTargetList Source #

Arguments

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

widget: a Widget that’s a drag source

-> Maybe TargetList

targetList: list of draggable targets, or Nothing for none

-> m () 

Changes the target types that this widget offers for drag-and-drop. The widget must first be made into a drag source with widgetDragSourceSet.

Since: 2.4

dragSourceUnset

widgetDragSourceUnset Source #

Arguments

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

widget: a Widget

-> m () 

Undoes the effects of widgetDragSourceSet.

dragUnhighlight

widgetDragUnhighlight Source #

Arguments

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

widget: a widget to remove the highlight from

-> m () 

Removes a highlight set by widgetDragHighlight from a widget.

draw

widgetDraw Source #

Arguments

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

widget: the widget to draw. It must be drawable (see widgetIsDrawable) and a size must have been allocated.

-> Context

cr: a cairo context to draw to

-> m () 

Draws widget to cr. The top left corner of the widget will be drawn to the currently set origin point of cr.

You should pass a cairo context as cr argument that is in an original state. Otherwise the resulting drawing is undefined. For example changing the operator using cairo_set_operator() or the line width using cairo_set_line_width() might have unwanted side effects. You may however change the context’s transform matrix - like with cairo_scale(), cairo_translate() or cairo_set_matrix() and clip region with cairo_clip() prior to calling this function. Also, it is fine to modify the context with cairo_save() and cairo_push_group() prior to calling this function.

Note that special-purpose widgets may contain special code for rendering to the screen and might appear differently on screen and when rendered using widgetDraw.

Since: 3.0

ensureStyle

widgetEnsureStyle Source #

Arguments

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

widget: a Widget

-> m () 

Deprecated: (Since version 3.0)Use StyleContext instead

Ensures that widget has a style (widget->style).

Not a very useful function; most of the time, if you want the style, the widget is realized, and realized widgets are guaranteed to have a style already.

errorBell

widgetErrorBell Source #

Arguments

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

widget: a Widget

-> m () 

Notifies the user about an input-related error on this widget. If the Settings:gtk-error-bell setting is True, it calls windowBeep, otherwise it does nothing.

Note that the effect of windowBeep can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.

Since: 2.12

event

widgetEvent Source #

Arguments

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

widget: a Widget

-> Event

event: a Event

-> m Bool

Returns: return from the event signal emission (True if the event was handled)

Rarely-used function. This function is used to emit the event signals on a widget (those signals should never be emitted without using this function to do so). If you want to synthesize an event though, don’t use this function; instead, use mainDoEvent so the event will behave as if it were in the event queue. Don’t synthesize expose events; instead, use windowInvalidateRect to invalidate a region of the window.

freezeChildNotify

widgetFreezeChildNotify Source #

Arguments

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

widget: a Widget

-> m () 

Stops emission of childNotify signals on widget. The signals are queued until widgetThawChildNotify is called on widget.

This is the analogue of objectFreezeNotify for child properties.

getAccessible

widgetGetAccessible Source #

Arguments

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

widget: a Widget

-> m Object

Returns: the Object associated with widget

Returns the accessible object that describes the widget to an assistive technology.

If accessibility support is not available, this Object instance may be a no-op. Likewise, if no class-specific Object implementation is available for the widget instance in question, it will inherit an Object implementation from the first ancestor class for which such an implementation is defined.

The documentation of the ATK library contains more information about accessible objects and their uses.

getActionGroup

widgetGetActionGroup Source #

Arguments

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

widget: A Widget

-> Text

prefix: The “prefix” of the action group.

-> m (Maybe ActionGroup)

Returns: A ActionGroup or Nothing.

Retrieves the ActionGroup that was registered using prefix. The resulting ActionGroup may have been registered to widget or any Widget in its ancestry.

If no action group was found matching prefix, then Nothing is returned.

Since: 3.16

getAllocatedBaseline

widgetGetAllocatedBaseline Source #

Arguments

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

widget: the widget to query

-> m Int32

Returns: the baseline of the widget, or -1 if none

Returns the baseline that has currently been allocated to widget. This function is intended to be used when implementing handlers for the draw function, and when allocating child widgets in Widget::size_allocate.

Since: 3.10

getAllocatedHeight

widgetGetAllocatedHeight Source #

Arguments

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

widget: the widget to query

-> m Int32

Returns: the height of the widget

Returns the height that has currently been allocated to widget. This function is intended to be used when implementing handlers for the draw function.

getAllocatedSize

widgetGetAllocatedSize Source #

Arguments

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

widget: a Widget

-> m (Rectangle, Int32) 

Retrieves the widget’s allocated size.

This function returns the last values passed to widgetSizeAllocateWithBaseline. The value differs from the size returned in widgetGetAllocation in that functions like widgetSetHalign can adjust the allocation, but not the value returned by this function.

If a widget is not visible, its allocated size is 0.

Since: 3.20

getAllocatedWidth

widgetGetAllocatedWidth Source #

Arguments

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

widget: the widget to query

-> m Int32

Returns: the width of the widget

Returns the width that has currently been allocated to widget. This function is intended to be used when implementing handlers for the draw function.

getAllocation

widgetGetAllocation Source #

Arguments

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

widget: a Widget

-> m Rectangle 

Retrieves the widget’s allocation.

Note, when implementing a Container: a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent container typically calls widgetSizeAllocate with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. widgetGetAllocation returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the widgetSizeAllocate allocation, however. So a Container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned. There is no way to get the original allocation assigned by widgetSizeAllocate, since it isn’t stored; if a container implementation needs that information it will have to track it itself.

Since: 2.18

getAncestor

widgetGetAncestor Source #

Arguments

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

widget: a Widget

-> GType

widgetType: ancestor type

-> m (Maybe Widget)

Returns: the ancestor widget, or Nothing if not found

Gets the first ancestor of widget with type widgetType. For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the first Box that’s an ancestor of widget. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Window in the docs for widgetGetToplevel.

Note that unlike widgetIsAncestor, widgetGetAncestor considers widget to be an ancestor of itself.

getAppPaintable

widgetGetAppPaintable Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is app paintable

Determines whether the application intends to draw on the widget in an draw handler.

See widgetSetAppPaintable

Since: 2.18

getCanDefault

widgetGetCanDefault Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget can be a default widget, False otherwise

Determines whether widget can be a default widget. See widgetSetCanDefault.

Since: 2.18

getCanFocus

widgetGetCanFocus Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget can own the input focus, False otherwise

Determines whether widget can own the input focus. See widgetSetCanFocus.

Since: 2.18

getChildRequisition

widgetGetChildRequisition Source #

Arguments

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

widget: a Widget

-> m Requisition 

Deprecated: (Since version 3.0)Use widgetGetPreferredSize instead.

This function is only for use in widget implementations. Obtains widget->requisition, unless someone has forced a particular geometry on the widget (e.g. with widgetSetSizeRequest), in which case it returns that geometry instead of the widget's requisition.

This function differs from widgetSizeRequest in that it retrieves the last size request value from widget->requisition, while widgetSizeRequest actually calls the "size_request" method on widget to compute the size request and fill in widget->requisition, and only then returns widget->requisition.

Because this function does not call the “size_request” method, it can only be used when you know that widget->requisition is up-to-date, that is, widgetSizeRequest has been called since the last time a resize was queued. In general, only container implementations have this information; applications should use widgetSizeRequest.

getChildVisible

widgetGetChildVisible Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is mapped with the parent.

Gets the value set with widgetSetChildVisible. If you feel a need to use this function, your code probably needs reorganization.

This function is only useful for container implementations and never should be called by an application.

getClip

widgetGetClip Source #

Arguments

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

widget: a Widget

-> m Rectangle 

Retrieves the widget’s clip area.

The clip area is the area in which all of widget's drawing will happen. Other toolkits call it the bounding box.

Historically, in GTK+ the clip area has been equal to the allocation retrieved via widgetGetAllocation.

Since: 3.14

getClipboard

widgetGetClipboard Source #

Arguments

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

widget: a Widget

-> Atom

selection: a Atom which identifies the clipboard to use. GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is GDK_SELECTION_PRIMARY, which gives the primary X selection.

-> m Clipboard

Returns: the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.

Returns the clipboard object for the given selection to be used with widget. widget must have a Display associated with it, so must be attached to a toplevel window.

Since: 2.2

getCompositeName

widgetGetCompositeName Source #

Arguments

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

widget: a Widget

-> m Text

Returns: the composite name of widget, or Nothing if widget is not a composite child. The string should be freed when it is no longer needed.

Deprecated: (Since version 3.10)Use widgetClassSetTemplate, or don’t use this API at all.

Obtains the composite name of a widget.

getDefaultDirection

widgetGetDefaultDirection Source #

Arguments

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

Returns: the current default direction.

Obtains the current default reading direction. See widgetSetDefaultDirection.

getDefaultStyle

widgetGetDefaultStyle Source #

Arguments

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

Returns: the default style. This Style object is owned by GTK+ and should not be modified or freed.

Deprecated: (Since version 3.0)Use StyleContext instead, and cssProviderGetDefault to obtain a StyleProvider with the default widget style information.

Returns the default style used by all widgets initially.

getDeviceEnabled

widgetGetDeviceEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDevice b) 
=> a

widget: a Widget

-> b

device: a Device

-> m Bool

Returns: True is device is enabled for widget

Returns whether device can interact with widget and its children. See widgetSetDeviceEnabled.

Since: 3.0

getDeviceEvents

widgetGetDeviceEvents Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDevice b) 
=> a

widget: a Widget

-> b

device: a Device

-> m [EventMask]

Returns: device event mask for widget

Returns the events mask for the widget corresponding to an specific device. These are the events that the widget will receive when device operates on it.

Since: 3.0

getDirection

widgetGetDirection Source #

Arguments

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

widget: a Widget

-> m TextDirection

Returns: the reading direction for the widget.

Gets the reading direction for a particular widget. See widgetSetDirection.

getDisplay

widgetGetDisplay Source #

Arguments

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

widget: a Widget

-> m Display

Returns: the Display for the toplevel for this widget.

Get the Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top.

In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

Since: 2.2

getDoubleBuffered

widgetGetDoubleBuffered Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is double buffered

Determines whether the widget is double buffered.

See widgetSetDoubleBuffered

Since: 2.18

getEvents

widgetGetEvents Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: event mask for widget

Returns the event mask (see EventMask) for the widget. These are the events that the widget will receive.

Note: Internally, the widget event mask will be the logical OR of the event mask set through widgetSetEvents or widgetAddEvents, and the event mask necessary to cater for every EventController created for the widget.

getFocusOnClick

widgetGetFocusOnClick Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget should grab focus when it is clicked with the mouse.

Returns whether the widget should grab focus when it is clicked with the mouse. See widgetSetFocusOnClick.

Since: 3.20

getFontMap

widgetGetFontMap Source #

Arguments

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

widget: a Widget

-> m (Maybe FontMap)

Returns: A FontMap, or Nothing

Gets the font map that has been set with widgetSetFontMap.

Since: 3.18

getFontOptions

widgetGetFontOptions Source #

Arguments

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

widget: a Widget

-> m (Maybe FontOptions)

Returns: the FontOptions or Nothing if not set

Returns the FontOptions used for Pango rendering. When not set, the defaults font options for the Screen will be used.

Since: 3.18

getFrameClock

widgetGetFrameClock Source #

Arguments

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

widget: a Widget

-> m (Maybe FrameClock)

Returns: a FrameClock, or Nothing if widget is unrealized

Obtains the frame clock for a widget. The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call frameClockGetFrameTime, in order to get a time to use for animating. For example you might record the start of the animation with an initial value from frameClockGetFrameTime, and then update the animation by calling frameClockGetFrameTime again during each repaint.

frameClockRequestPhase will result in a new frame on the clock, but won’t necessarily repaint any widgets. To repaint a widget, you have to use widgetQueueDraw which invalidates the widget (thus scheduling it to receive a draw on the next frame). widgetQueueDraw will also end up requesting a frame on the appropriate frame clock.

A widget’s frame clock will not change while the widget is mapped. Reparenting a widget (which implies a temporary unmap) can change the widget’s frame clock.

Unrealized widgets do not have a frame clock.

Since: 3.8

getHalign

widgetGetHalign Source #

Arguments

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

widget: a Widget

-> m Align

Returns: the horizontal alignment of widget

Gets the value of the Widget:halign property.

For backwards compatibility reasons this method will never return AlignBaseline, but instead it will convert it to AlignFill. Baselines are not supported for horizontal alignment.

getHasTooltip

widgetGetHasTooltip Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: current value of has-tooltip on widget.

Returns the current value of the has-tooltip property. See Widget:has-tooltip for more information.

Since: 2.12

getHasWindow

widgetGetHasWindow Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget has a window, False otherwise

Determines whether widget has a Window of its own. See widgetSetHasWindow.

Since: 2.18

getHexpand

widgetGetHexpand Source #

Arguments

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

widget: the widget

-> m Bool

Returns: whether hexpand flag is set

Gets whether the widget would like any available extra horizontal space. When a user resizes a Window, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Containers should use widgetComputeExpand rather than this function, to see whether a widget, or any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also.

This function only looks at the widget’s own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.

getHexpandSet

widgetGetHexpandSet Source #

Arguments

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

widget: the widget

-> m Bool

Returns: whether hexpand has been explicitly set

Gets whether widgetSetHexpand has been used to explicitly set the expand flag on this widget.

If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

There are few reasons to use this function, but it’s here for completeness and consistency.

getMapped

widgetGetMapped Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is mapped, False otherwise.

Whether the widget is mapped.

Since: 2.20

getMarginBottom

widgetGetMarginBottom Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: The bottom margin of widget

Gets the value of the Widget:margin-bottom property.

Since: 3.0

getMarginEnd

widgetGetMarginEnd Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: The end margin of widget

Gets the value of the Widget:margin-end property.

Since: 3.12

getMarginLeft

widgetGetMarginLeft Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: The left margin of widget

Deprecated: (Since version 3.12)Use widgetGetMarginStart instead.

Gets the value of the Widget:margin-left property.

Since: 3.0

getMarginRight

widgetGetMarginRight Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: The right margin of widget

Deprecated: (Since version 3.12)Use widgetGetMarginEnd instead.

Gets the value of the Widget:margin-right property.

Since: 3.0

getMarginStart

widgetGetMarginStart Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: The start margin of widget

Gets the value of the Widget:margin-start property.

Since: 3.12

getMarginTop

widgetGetMarginTop Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: The top margin of widget

Gets the value of the Widget:margin-top property.

Since: 3.0

getModifierMask

widgetGetModifierMask Source #

Arguments

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

widget: a Widget

-> ModifierIntent

intent: the use case for the modifier mask

-> m [ModifierType]

Returns: the modifier mask used for intent.

Returns the modifier mask the widget’s windowing system backend uses for a particular purpose.

See keymapGetModifierMask.

Since: 3.4

getModifierStyle

widgetGetModifierStyle Source #

Arguments

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

widget: a Widget

-> m RcStyle

Returns: the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using objectRef.

Deprecated: (Since version 3.0)Use StyleContext with a custom StyleProvider instead

Returns the current modifier style for the widget. (As set by widgetModifyStyle.) If no style has previously set, a new RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call widgetModifyStyle, passing in the returned rc style, to make sure that your changes take effect.

Caution: passing the style back to widgetModifyStyle will normally end up destroying it, because widgetModifyStyle copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.

getName

widgetGetName Source #

Arguments

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

widget: a Widget

-> m Text

Returns: name of the widget. This string is owned by GTK+ and should not be modified or freed

Retrieves the name of a widget. See widgetSetName for the significance of widget names.

getNoShowAll

widgetGetNoShowAll Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: the current value of the “no-show-all” property.

Returns the current value of the Widget:no-show-all property, which determines whether calls to widgetShowAll will affect this widget.

Since: 2.4

getOpacity

widgetGetOpacity Source #

Arguments

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

widget: a Widget

-> m Double

Returns: the requested opacity for this widget.

Fetches the requested opacity for this widget. See widgetSetOpacity.

Since: 3.8

getPangoContext

widgetGetPangoContext Source #

Arguments

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

widget: a Widget

-> m Context

Returns: the Context for the widget.

Gets a Context with the appropriate font map, font description, and base direction for this widget. Unlike the context returned by widgetCreatePangoContext, this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by using the screenChanged signal on the widget.

getParent

widgetGetParent Source #

Arguments

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

widget: a Widget

-> m (Maybe Widget)

Returns: the parent container of widget, or Nothing

Returns the parent container of widget.

getParentWindow

widgetGetParentWindow Source #

Arguments

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

widget: a Widget.

-> m (Maybe Window)

Returns: the parent window of widget, or Nothing if it does not have a parent window.

Gets widget’s parent window, or Nothing if it does not have one.

getPath

widgetGetPath Source #

Arguments

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

widget: a Widget

-> m WidgetPath

Returns: The WidgetPath representing widget

Returns the WidgetPath representing widget, if the widget is not connected to a toplevel widget, a partial path will be created.

getPointer

widgetGetPointer Source #

Arguments

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

widget: a Widget

-> m (Int32, Int32) 

Deprecated: (Since version 3.4)Use windowGetDevicePosition instead.

Obtains the location of the mouse pointer in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widget->window coordinates for widgets that return True for widgetGetHasWindow; and are relative to widget->allocation.x, widget->allocation.y otherwise.

getPreferredHeight

widgetGetPreferredHeight Source #

Arguments

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

widget: a Widget instance

-> m (Int32, Int32) 

Retrieves a widget’s initial minimum and natural height.

This call is specific to width-for-height requests.

The returned request will be modified by the GtkWidgetClass[adjust_size_request](#g:signal:adjust_size_request) virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since: 3.0

getPreferredHeightAndBaselineForWidth

widgetGetPreferredHeightAndBaselineForWidth Source #

Arguments

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

widget: a Widget instance

-> Int32

width: the width which is available for allocation, or -1 if none

-> m (Int32, Int32, Int32, Int32) 

Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given the specified width, or the default height if width is -1. The baselines may be -1 which means that no baseline is requested for this widget.

The returned request will be modified by the GtkWidgetClass[adjust_size_request](g:signal:adjust_baseline_request) virtual methods and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since: 3.10

getPreferredHeightForWidth

widgetGetPreferredHeightForWidth Source #

Arguments

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

widget: a Widget instance

-> Int32

width: the width which is available for allocation

-> m (Int32, Int32) 

Retrieves a widget’s minimum and natural height if it would be given the specified width.

The returned request will be modified by the GtkWidgetClass[adjust_size_request](#g:signal:adjust_size_request) virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since: 3.0

getPreferredSize

widgetGetPreferredSize Source #

Arguments

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

widget: a Widget instance

-> m (Requisition, Requisition) 

Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.

This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as GtkLayout.

Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.

Use widgetGetPreferredHeightAndBaselineForWidth if you want to support baseline alignment.

Since: 3.0

getPreferredWidth

widgetGetPreferredWidth Source #

Arguments

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

widget: a Widget instance

-> m (Int32, Int32) 

Retrieves a widget’s initial minimum and natural width.

This call is specific to height-for-width requests.

The returned request will be modified by the GtkWidgetClass[adjust_size_request](#g:signal:adjust_size_request) virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since: 3.0

getPreferredWidthForHeight

widgetGetPreferredWidthForHeight Source #

Arguments

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

widget: a Widget instance

-> Int32

height: the height which is available for allocation

-> m (Int32, Int32) 

Retrieves a widget’s minimum and natural width if it would be given the specified height.

The returned request will be modified by the GtkWidgetClass[adjust_size_request](#g:signal:adjust_size_request) virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since: 3.0

getRealized

widgetGetRealized Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget is realized, False otherwise

Determines whether widget is realized.

Since: 2.20

getReceivesDefault

widgetGetReceivesDefault Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget acts as the default widget when focused, False otherwise

Determines whether widget is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

See widgetSetReceivesDefault.

Since: 2.18

getRequestMode

widgetGetRequestMode Source #

Arguments

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

widget: a Widget instance

-> m SizeRequestMode

Returns: The SizeRequestMode preferred by widget.

Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

Bin widgets generally propagate the preference of their child, container widgets need to request something either in context of their children or in context of their allocation capabilities.

Since: 3.0

getRequisition

widgetGetRequisition Source #

Arguments

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

widget: a Widget

-> m Requisition 

Deprecated: (Since version 3.0)The Requisition cache on the widget wasremoved, If you need to cache sizes across requests and allocations,add an explicit cache to the widget in question instead.

Retrieves the widget’s requisition.

This function should only be used by widget implementations in order to figure whether the widget’s requisition has actually changed after some internal state change (so that they can call widgetQueueResize instead of widgetQueueDraw).

Normally, widgetSizeRequest should be used.

Since: 2.20

getRootWindow

widgetGetRootWindow Source #

Arguments

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

widget: a Widget

-> m Window

Returns: the Window root window for the toplevel for this widget.

Deprecated: (Since version 3.12)Use screenGetRootWindow instead

Get the root window where this widget is located. This function can only be called after the widget has been added to a widget hierarchy with Window at the top.

The root window is useful for such purposes as creating a popup Window associated with the window. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

Since: 2.2

getScaleFactor

widgetGetScaleFactor Source #

Arguments

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

widget: a Widget

-> m Int32

Returns: the scale factor for widget

Retrieves the internal scale factor that maps from window coordinates to the actual device pixels. On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2).

See windowGetScaleFactor.

Since: 3.10

getScreen

widgetGetScreen Source #

Arguments

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

widget: a Widget

-> m Screen

Returns: the Screen for the toplevel for this widget.

Get the Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top.

In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

Since: 2.2

getSensitive

widgetGetSensitive Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is sensitive

Returns the widget’s sensitivity (in the sense of returning the value that has been set using widgetSetSensitive).

The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See widgetIsSensitive.

Since: 2.18

getSettings

widgetGetSettings Source #

Arguments

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

widget: a Widget

-> m Settings

Returns: the relevant Settings object

Gets the settings object holding the settings used for this widget.

Note that this function can only be called when the Widget is attached to a toplevel, since the settings object is specific to a particular Screen.

getSizeRequest

widgetGetSizeRequest Source #

Arguments

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

widget: a Widget

-> m (Int32, Int32) 

Gets the size request that was explicitly set for the widget using widgetSetSizeRequest. A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead. See widgetSetSizeRequest. To get the size a widget will actually request, call widgetGetPreferredSize instead of this function.

getState

widgetGetState Source #

Arguments

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

widget: a Widget

-> m StateType

Returns: the state of widget.

Deprecated: (Since version 3.0)Use widgetGetStateFlags instead.

Returns the widget’s state. See widgetSetState.

Since: 2.18

getStateFlags

widgetGetStateFlags Source #

Arguments

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

widget: a Widget

-> m [StateFlags]

Returns: The state flags for widget

Returns the widget state as a flag set. It is worth mentioning that the effective StateFlagsInsensitive state will be returned, that is, also based on parent insensitivity, even if widget itself is sensitive.

Also note that if you are looking for a way to obtain the StateFlags to pass to a StyleContext method, you should look at styleContextGetState.

Since: 3.0

getStyle

widgetGetStyle Source #

Arguments

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

widget: a Widget

-> m Style

Returns: the widget’s Style

Deprecated: (Since version 3.0)Use StyleContext instead

Simply an accessor function that returns widget->style.

getStyleContext

widgetGetStyleContext Source #

Arguments

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

widget: a Widget

-> m StyleContext

Returns: a StyleContext. This memory is owned by widget and must not be freed.

Returns the style context associated to widget. The returned object is guaranteed to be the same for the lifetime of widget.

getSupportMultidevice

widgetGetSupportMultidevice Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget is multidevice aware.

Returns True if widget is multiple pointer aware. See widgetSetSupportMultidevice for more information.

getTemplateChild

widgetGetTemplateChild Source #

Arguments

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

widget: A Widget

-> GType

widgetType: The GType to get a template child for

-> Text

name: The “id” of the child defined in the template XML

-> m Object

Returns: The object built in the template XML with the id name

Fetch an object build from the template XML for widgetType in this widget instance.

This will only report children which were previously declared with widgetClassBindTemplateChildFull or one of its variants.

This function is only meant to be called for code which is private to the widgetType which declared the child and is meant for language bindings which cannot easily make use of the GObject structure offsets.

getTooltipMarkup

widgetGetTooltipMarkup Source #

Arguments

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

widget: a Widget

-> m (Maybe Text)

Returns: the tooltip text, or Nothing. You should free the returned string with free when done.

Gets the contents of the tooltip for widget.

Since: 2.12

getTooltipText

widgetGetTooltipText Source #

Arguments

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

widget: a Widget

-> m (Maybe Text)

Returns: the tooltip text, or Nothing. You should free the returned string with free when done.

Gets the contents of the tooltip for widget.

Since: 2.12

getTooltipWindow

widgetGetTooltipWindow Source #

Arguments

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

widget: a Widget

-> m Window

Returns: The Window of the current tooltip.

Returns the Window of the current tooltip. This can be the GtkWindow created by default, or the custom tooltip window set using widgetSetTooltipWindow.

Since: 2.12

getToplevel

widgetGetToplevel Source #

Arguments

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

widget: a Widget

-> m Widget

Returns: the topmost ancestor of widget, or widget itself if there’s no ancestor.

This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.

Note the difference in behavior vs. widgetGetAncestor; gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) would return Nothing if widget wasn’t inside a toplevel window, and if the window was inside a Window-derived widget which was in turn inside the toplevel Window. While the second case may seem unlikely, it actually happens when a Plug is embedded inside a Socket within the same application.

To reliably find the toplevel Window, use widgetGetToplevel and call GTK_IS_WINDOW() on the result. For instance, to get the title of a widget's toplevel window, one might use:

C code

static const char *
get_widget_toplevel_title (GtkWidget *widget)
{
  GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
  if (GTK_IS_WINDOW (toplevel))
    {
      return gtk_window_get_title (GTK_WINDOW (toplevel));
    }

  return NULL;
}

getValign

widgetGetValign Source #

Arguments

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

widget: a Widget

-> m Align

Returns: the vertical alignment of widget, ignoring baseline alignment

Gets the value of the Widget:valign property.

For backwards compatibility reasons this method will never return AlignBaseline, but instead it will convert it to AlignFill. If your widget want to support baseline aligned children it must use widgetGetValignWithBaseline, or g_object_get (widget, "valign", &value, NULL), which will also report the true value.

getValignWithBaseline

widgetGetValignWithBaseline Source #

Arguments

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

widget: a Widget

-> m Align

Returns: the vertical alignment of widget

Gets the value of the Widget:valign property, including AlignBaseline.

Since: 3.10

getVexpand

widgetGetVexpand Source #

Arguments

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

widget: the widget

-> m Bool

Returns: whether vexpand flag is set

Gets whether the widget would like any available extra vertical space.

See widgetGetHexpand for more detail.

getVexpandSet

widgetGetVexpandSet Source #

Arguments

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

widget: the widget

-> m Bool

Returns: whether vexpand has been explicitly set

Gets whether widgetSetVexpand has been used to explicitly set the expand flag on this widget.

See widgetGetHexpandSet for more detail.

getVisible

widgetGetVisible Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is visible

Determines whether the widget is visible. If you want to take into account whether the widget’s parent is also marked as visible, use widgetIsVisible instead.

This function does not check if the widget is obscured in any way.

See widgetSetVisible.

Since: 2.18

getVisual

widgetGetVisual Source #

Arguments

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

widget: a Widget

-> m Visual

Returns: the visual for widget

Gets the visual that will be used to render widget.

getWindow

widgetGetWindow Source #

Arguments

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

widget: a Widget

-> m (Maybe Window)

Returns: widget’s window.

Returns the widget’s window if it is realized, Nothing otherwise

Since: 2.14

grabAdd

widgetGrabAdd Source #

Arguments

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

widget: The widget that grabs keyboard and pointer events

-> m () 

Makes widget the current grabbed widget.

This means that interaction with other widgets in the same application is blocked and mouse as well as keyboard events are delivered to this widget.

If widget is not sensitive, it is not set as the current grabbed widget and this function does nothing.

grabDefault

widgetGrabDefault Source #

Arguments

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

widget: a Widget

-> m () 

Causes widget to become the default widget. widget must be able to be a default widget; typically you would ensure this yourself by calling widgetSetCanDefault with a True value. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, widgetActivate should affect them. Note that Entry widgets require the “activates-default” property set to True before they activate the default widget when Enter is pressed and the Entry is focused.

grabFocus

widgetGrabFocus Source #

Arguments

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

widget: a Widget

-> m () 

Causes widget to have the keyboard focus for the Window it's inside. widget must be a focusable widget, such as a Entry; something like Frame won’t work.

More precisely, it must have the GTK_CAN_FOCUS flag set. Use widgetSetCanFocus to modify that flag.

The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings.

grabRemove

widgetGrabRemove Source #

Arguments

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

widget: The widget which gives up the grab

-> m () 

Removes the grab from the given widget.

You have to pair calls to widgetGrabAdd and widgetGrabRemove.

If widget does not have the grab, this function does nothing.

hasDefault

widgetHasDefault Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget is the current default widget within its toplevel, False otherwise

Determines whether widget is the current default widget within its toplevel. See widgetSetCanDefault.

Since: 2.18

hasFocus

widgetHasFocus Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget has the global input focus.

Determines if the widget has the global input focus. See widgetIsFocus for the difference between having the global input focus, and only having the focus within a toplevel.

Since: 2.18

hasGrab

widgetHasGrab Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is in the grab_widgets stack

Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).

See also widgetGrabAdd.

Since: 2.18

hasRcStyle

widgetHasRcStyle Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget has been looked up through the rc mechanism, False otherwise.

Deprecated: (Since version 3.0)Use StyleContext instead

Determines if the widget style has been looked up through the rc mechanism.

Since: 2.20

hasScreen

widgetHasScreen Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if there is a Screen associated with the widget.

Checks whether there is a Screen is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a hierarchy with a toplevel window at the top.

Since: 2.2

hasVisibleFocus

widgetHasVisibleFocus Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget should display a “focus rectangle”

Determines if the widget should show a visible indication that it has the global input focus. This is a convenience function for use in draw handlers that takes into account whether focus indication should currently be shown in the toplevel window of widget. See windowGetFocusVisible for more information about focus indication.

To find out if the widget has the global input focus, use widgetHasFocus.

Since: 3.2

hide

widgetHide Source #

Arguments

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

widget: a Widget

-> m () 

Reverses the effects of widgetShow, causing the widget to be hidden (invisible to the user).

hideOnDelete

widgetHideOnDelete Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True

Utility function; intended to be connected to the deleteEvent signal on a Window. The function calls widgetHide on its argument, then returns True. If connected to deleteEvent, the result is that clicking the close button for a window (on the window frame, top right corner usually) will hide but not destroy the window. By default, GTK+ destroys windows when deleteEvent is received.

inDestruction

widgetInDestruction Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget is being destroyed

Returns whether the widget is currently being destroyed. This information can sometimes be used to avoid doing unnecessary work.

initTemplate

widgetInitTemplate Source #

Arguments

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

widget: a Widget

-> m () 

Creates and initializes child widgets defined in templates. This function must be called in the instance initializer for any class which assigned itself a template using widgetClassSetTemplate

It is important to call this function in the instance initializer of a Widget subclass and not in Object.constructed() or Object.constructor() for two reasons.

One reason is that generally derived widgets will assume that parent class composite widgets have been created in their instance initializers.

Another reason is that when calling g_object_new() on a widget with composite templates, it’s important to build the composite widgets before the construct properties are set. Properties passed to g_object_new() should take precedence over properties set in the private template XML.

Since: 3.10

inputShapeCombineRegion

widgetInputShapeCombineRegion Source #

Arguments

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

widget: a Widget

-> Maybe Region

region: shape to be added, or Nothing to remove an existing shape

-> m () 

Sets an input shape for this widget’s GDK window. This allows for windows which react to mouse click in a nonrectangular region, see windowInputShapeCombineRegion for more information.

Since: 3.0

insertActionGroup

widgetInsertActionGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsActionGroup b) 
=> a

widget: a Widget

-> Text

name: the prefix for actions in group

-> Maybe b

group: a ActionGroup, or Nothing

-> m () 

Inserts group into widget. Children of widget that implement Actionable can then be associated with actions in group by setting their “action-name” to prefix.action-name.

If group is Nothing, a previously inserted group for name is removed from widget.

Since: 3.6

intersect

widgetIntersect Source #

Arguments

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

widget: a Widget

-> Rectangle

area: a rectangle

-> m (Bool, Maybe Rectangle)

Returns: True if there was an intersection

Computes the intersection of a widget’s area and area, storing the intersection in intersection, and returns True if there was an intersection. intersection may be Nothing if you’re only interested in whether there was an intersection.

isAncestor

widgetIsAncestor Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

widget: a Widget

-> b

ancestor: another Widget

-> m Bool

Returns: True if ancestor contains widget as a child, grandchild, great grandchild, etc.

Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.

isComposited

widgetIsComposited Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget can rely on its alpha channel being drawn correctly.

Deprecated: (Since version 3.22)Use screenIsComposited instead.

Whether widget can rely on having its alpha channel drawn correctly. On X11 this function returns whether a compositing manager is running for widget’s screen.

Please note that the semantics of this call will change in the future if used on a widget that has a composited window in its hierarchy (as set by windowSetComposited).

Since: 2.10

isDrawable

widgetIsDrawable Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget is drawable, False otherwise

Determines whether widget can be drawn to. A widget can be drawn to if it is mapped and visible.

Since: 2.18

isFocus

widgetIsFocus Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is the focus widget.

Determines if the widget is the focus widget within its toplevel. (This does not mean that the Widget:has-focus property is necessarily set; Widget:has-focus will only be set if the toplevel widget additionally has the global input focus.)

isSensitive

widgetIsSensitive Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget is effectively sensitive

Returns the widget’s effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive

Since: 2.18

isToplevel

widgetIsToplevel Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if widget is a toplevel, False otherwise

Determines whether widget is a toplevel widget.

Currently only Window and Invisible (and out-of-process GtkPlugs) are toplevel widgets. Toplevel widgets have no parent widget.

Since: 2.18

isVisible

widgetIsVisible Source #

Arguments

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

widget: a Widget

-> m Bool

Returns: True if the widget and all its parents are visible

Determines whether the widget and all its parents are marked as visible.

This function does not check if the widget is obscured in any way.

See also widgetGetVisible and widgetSetVisible

Since: 3.8

keynavFailed

widgetKeynavFailed Source #

Arguments

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

widget: a Widget

-> DirectionType

direction: direction of focus movement

-> m Bool

Returns: True if stopping keyboard navigation is fine, False if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).

This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the keynavFailed signal on the widget and its return value should be interpreted in a way similar to the return value of widgetChildFocus:

When True is returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to.

When False is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling widgetChildFocus on the widget’s toplevel.

The default keynavFailed handler returns False for DirectionTypeTabForward and DirectionTypeTabBackward. For the other values of DirectionType it returns True.

Whenever the default handler returns True, it also calls widgetErrorBell to notify the user of the failed keyboard navigation.

A use case for providing an own implementation of keynavFailed (either by connecting to it or by overriding it) would be a row of Entry widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.

Since: 2.12

listAccelClosures

widgetListAccelClosures Source #

Arguments

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

widget: widget to list accelerator closures for

-> m [GClosure b]

Returns: a newly allocated List of closures

Lists the closures used by widget for accelerator group connections with accelGroupConnectByPath or accelGroupConnect. The closures can be used to monitor accelerator changes on widget, by connecting to the gtkAccelGroupaccelChanged signal of the AccelGroup of a closure which can be found out with accelGroupFromAccelClosure.

listActionPrefixes

widgetListActionPrefixes Source #

Arguments

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

widget: A Widget

-> m [Text]

Returns: a Nothing-terminated array of strings.

Retrieves a Nothing-terminated array of strings containing the prefixes of ActionGroup's available to widget.

Since: 3.16

listMnemonicLabels

widgetListMnemonicLabels Source #

Arguments

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

widget: a Widget

-> m [Widget]

Returns: the list of mnemonic labels; free this list with g_list_free() when you are done with it.

Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, labelSetMnemonicWidget).

The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and then unref all the widgets afterwards.

Since: 2.4

map

widgetMap Source #

Arguments

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

widget: a Widget

-> m () 

This function is only for use in widget implementations. Causes a widget to be mapped if it isn’t already.

mnemonicActivate

widgetMnemonicActivate Source #

Arguments

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

widget: a Widget

-> Bool

groupCycling: True if there are other widgets with the same mnemonic

-> m Bool

Returns: True if the signal has been handled

Emits the mnemonicActivate signal.

modifyBase

widgetModifyBase Source #

Arguments

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

widget: a Widget

-> StateType

state: the state for which to set the base color

-> Maybe Color

color: the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyBase.

-> m () 

Deprecated: (Since version 3.0)Use widgetOverrideBackgroundColor instead

Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see widgetModifyText) for widgets such as Entry and TextView. See also widgetModifyStyle.

Note that “no window” widgets (which have the @/GTK_NO_WINDOW/@
flag set) draw on their parent container’s window and thus may
not draw any background themselves. This is the case for e.g.
t'GI.Gtk.Objects.Label.Label'.

To modify the background of such widgets, you have to set the
base color on their parent; if you want to set the background
of a rectangular area around a label, try placing the label in
a t'GI.Gtk.Objects.EventBox.EventBox' widget and setting the base color on that.

modifyBg

widgetModifyBg Source #

Arguments

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

widget: a Widget

-> StateType

state: the state for which to set the background color

-> Maybe Color

color: the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyBg.

-> m () 

Deprecated: (Since version 3.0)Use widgetOverrideBackgroundColor instead

Sets the background color for a widget in a particular state.

All other style values are left untouched. See also widgetModifyStyle.

Note that “no window” widgets (which have the @/GTK_NO_WINDOW/@
flag set) draw on their parent container’s window and thus may
not draw any background themselves. This is the case for e.g.
t'GI.Gtk.Objects.Label.Label'.

To modify the background of such widgets, you have to set the
background color on their parent; if you want to set the background
of a rectangular area around a label, try placing the label in
a t'GI.Gtk.Objects.EventBox.EventBox' widget and setting the background color on that.

modifyCursor

widgetModifyCursor Source #

Arguments

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

widget: a Widget

-> Maybe Color

primary: the color to use for primary cursor (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyCursor.

-> Maybe Color

secondary: the color to use for secondary cursor (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyCursor.

-> m () 

Deprecated: (Since version 3.0)Use widgetOverrideCursor instead.

Sets the cursor color to use in a widget, overriding the Widget cursor-color and secondary-cursor-color style properties.

All other style values are left untouched. See also widgetModifyStyle.

Since: 2.12

modifyFg

widgetModifyFg Source #

Arguments

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

widget: a Widget

-> StateType

state: the state for which to set the foreground color

-> Maybe Color

color: the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyFg.

-> m () 

Deprecated: (Since version 3.0)Use widgetOverrideColor instead

Sets the foreground color for a widget in a particular state.

All other style values are left untouched. See also widgetModifyStyle.

modifyFont

widgetModifyFont Source #

Arguments

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

widget: a Widget

-> Maybe FontDescription

fontDesc: the font description to use, or Nothing to undo the effect of previous calls to widgetModifyFont

-> m () 

Deprecated: (Since version 3.0)Use widgetOverrideFont instead

Sets the font to use for a widget.

All other style values are left untouched. See also widgetModifyStyle.

modifyStyle

widgetModifyStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsRcStyle b) 
=> a

widget: a Widget

-> b

style: the RcStyle-struct holding the style modifications

-> m () 

Deprecated: (Since version 3.0)Use StyleContext with a custom StyleProvider instead

Modifies style values on the widget.

Modifications made using this technique take precedence over style values set via an RC file, however, they will be overridden if a style is explicitly set on the widget using widgetSetStyle. The RcStyle-struct is designed so each field can either be set or unset, so it is possible, using this function, to modify some style values and leave the others unchanged.

Note that modifications made with this function are not cumulative with previous calls to widgetModifyStyle or with such functions as widgetModifyFg. If you wish to retain previous values, you must first call widgetGetModifierStyle, make your modifications to the returned style, then call widgetModifyStyle with that style. On the other hand, if you first call widgetModifyStyle, subsequent calls to such functions widgetModifyFg will have a cumulative effect with the initial modifications.

modifyText

widgetModifyText Source #

Arguments

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

widget: a Widget

-> StateType

state: the state for which to set the text color

-> Maybe Color

color: the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyText.

-> m () 

Deprecated: (Since version 3.0)Use widgetOverrideColor instead

Sets the text color for a widget in a particular state.

All other style values are left untouched. The text color is the foreground color used along with the base color (see widgetModifyBase) for widgets such as Entry and TextView. See also widgetModifyStyle.

overrideBackgroundColor

widgetOverrideBackgroundColor Source #

Arguments

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

widget: a Widget

-> [StateFlags]

state: the state for which to set the background color

-> Maybe RGBA

color: the color to assign, or Nothing to undo the effect of previous calls to widgetOverrideBackgroundColor

-> m () 

Deprecated: (Since version 3.16)This function is not useful in the context of CSS-based rendering. If you wish to change the way a widget renders its background you should use a custom CSS style, through an application-specific StyleProvider and a CSS style class. You can also override the default drawing of a widget through the draw signal, and use Cairo to draw a specific color, regardless of the CSS style.

Sets the background color to use for a widget.

All other style values are left untouched. See widgetOverrideColor.

Since: 3.0

overrideColor

widgetOverrideColor Source #

Arguments

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

widget: a Widget

-> [StateFlags]

state: the state for which to set the color

-> Maybe RGBA

color: the color to assign, or Nothing to undo the effect of previous calls to widgetOverrideColor

-> m () 

Deprecated: (Since version 3.16)Use a custom style provider and style classes instead

Sets the color to use for a widget.

All other style values are left untouched.

This function does not act recursively. Setting the color of a container does not affect its children. Note that some widgets that you may not think of as containers, for instance GtkButtons, are actually containers.

This API is mostly meant as a quick way for applications to change a widget appearance. If you are developing a widgets library and intend this change to be themeable, it is better done by setting meaningful CSS classes in your widget/container implementation through styleContextAddClass.

This way, your widget library can install a CssProvider with the STYLE_PROVIDER_PRIORITY_FALLBACK priority in order to provide a default styling for those widgets that need so, and this theming may fully overridden by the user’s theme.

Note that for complex widgets this may bring in undesired results (such as uniform background color everywhere), in these cases it is better to fully style such widgets through a CssProvider with the STYLE_PROVIDER_PRIORITY_APPLICATION priority.

Since: 3.0

overrideCursor

widgetOverrideCursor Source #

Arguments

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

widget: a Widget

-> Maybe RGBA

cursor: the color to use for primary cursor (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetOverrideCursor.

-> Maybe RGBA

secondaryCursor: the color to use for secondary cursor (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetOverrideCursor.

-> m () 

Deprecated: (Since version 3.16)This function is not useful in the context of CSS-based rendering. If you wish to change the color used to render the primary and secondary cursors you should use a custom CSS style, through an application-specific StyleProvider and a CSS style class.

Sets the cursor color to use in a widget, overriding the cursor-color and secondary-cursor-color style properties. All other style values are left untouched. See also widgetModifyStyle.

Note that the underlying properties have the Color type, so the alpha value in primary and secondary will be ignored.

Since: 3.0

overrideFont

widgetOverrideFont Source #

Arguments

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

widget: a Widget

-> Maybe FontDescription

fontDesc: the font description to use, or Nothing to undo the effect of previous calls to widgetOverrideFont

-> m () 

Deprecated: (Since version 3.16)This function is not useful in the context of CSS-based rendering. If you wish to change the font a widget uses to render its text you should use a custom CSS style, through an application-specific StyleProvider and a CSS style class.

Sets the font to use for a widget. All other style values are left untouched. See widgetOverrideColor.

Since: 3.0

overrideSymbolicColor

widgetOverrideSymbolicColor Source #

Arguments

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

widget: a Widget

-> Text

name: the name of the symbolic color to modify

-> Maybe RGBA

color: the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to widgetOverrideSymbolicColor

-> m () 

Deprecated: (Since version 3.16)This function is not useful in the context of CSS-based rendering. If you wish to change the color used to render symbolic icons you should use a custom CSS style, through an application-specific StyleProvider and a CSS style class.

Sets a symbolic color for a widget.

All other style values are left untouched. See widgetOverrideColor for overriding the foreground or background color.

Since: 3.0

path

widgetPath Source #

Arguments

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

widget: a Widget

-> m (Word32, Text, Text) 

Deprecated: (Since version 3.0)Use widgetGetPath instead

Obtains the full path to widget. The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods. The name of a widget comes from widgetGetName. Paths are used to apply styles to a widget in gtkrc configuration files. Widget names are the type of the widget by default (e.g. “GtkButton”) or can be set to an application-specific value with widgetSetName. By setting the name of a widget, you allow users or theme authors to apply styles to that specific widget in their gtkrc file. pathReversedP fills in the path in reverse order, i.e. starting with widget’s name instead of starting with the name of widget’s outermost ancestor.

popCompositeChild

widgetPopCompositeChild :: (HasCallStack, MonadIO m) => m () Source #

Deprecated: (Since version 3.10)Use widgetClassSetTemplate, or don’t use this API at all.

Cancels the effect of a previous call to widgetPushCompositeChild.

pushCompositeChild

widgetPushCompositeChild :: (HasCallStack, MonadIO m) => m () Source #

Deprecated: (Since version 3.10)This API never really worked well and was mostly unused, nowwe have a more complete mechanism for composite children, see widgetClassSetTemplate.

Makes all newly-created widgets as composite children until the corresponding widgetPopCompositeChild call.

A composite child is a child that’s an implementation detail of the container it’s inside and should not be visible to people using the container. Composite children aren’t treated differently by GTK+ (but see containerForeach vs. containerForall), but e.g. GUI builders might want to treat them in a different way.

queueAllocate

widgetQueueAllocate Source #

Arguments

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

widget: a Widget

-> m () 

This function is only for use in widget implementations.

Flags the widget for a rerun of the GtkWidgetClass[size_allocate](#g:signal:size_allocate) function. Use this function instead of widgetQueueResize when the widget's size request didn't change but it wants to reposition its contents.

An example user of this function is widgetSetHalign.

Since: 3.20

queueComputeExpand

widgetQueueComputeExpand Source #

Arguments

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

widget: a Widget

-> m () 

Mark widget as needing to recompute its expand flags. Call this function when setting legacy expand child properties on the child of a container.

See widgetComputeExpand.

queueDraw

widgetQueueDraw Source #

Arguments

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

widget: a Widget

-> m () 

Equivalent to calling widgetQueueDrawArea for the entire area of a widget.

queueDrawArea

widgetQueueDrawArea Source #

Arguments

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

widget: a Widget

-> Int32

x: x coordinate of upper-left corner of rectangle to redraw

-> Int32

y: y coordinate of upper-left corner of rectangle to redraw

-> Int32

width: width of region to draw

-> Int32

height: height of region to draw

-> m () 

Convenience function that calls widgetQueueDrawRegion on the region created from the given coordinates.

The region here is specified in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widget->window coordinates for widgets that return True for widgetGetHasWindow, and are relative to widget->allocation.x, widget->allocation.y otherwise.

width or height may be 0, in this case this function does nothing. Negative values for width and height are not allowed.

queueDrawRegion

widgetQueueDrawRegion Source #

Arguments

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

widget: a Widget

-> Region

region: region to draw

-> m () 

Invalidates the area of widget defined by region by calling windowInvalidateRegion on the widget’s window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.

Normally you would only use this function in widget implementations. You might also use it to schedule a redraw of a DrawingArea or some portion thereof.

Since: 3.0

queueResize

widgetQueueResize Source #

Arguments

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

widget: a Widget

-> m () 

This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Label, Label queues a resize to ensure there’s enough space for the new text.

Note that you cannot call widgetQueueResize on a widget from inside its implementation of the GtkWidgetClass[size_allocate](#g:signal:size_allocate) virtual method. Calls to widgetQueueResize from inside GtkWidgetClass[size_allocate](#g:signal:size_allocate) will be silently ignored.

queueResizeNoRedraw

widgetQueueResizeNoRedraw Source #

Arguments

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

widget: a Widget

-> m () 

This function works like widgetQueueResize, except that the widget is not invalidated.

Since: 2.4

realize

widgetRealize Source #

Arguments

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

widget: a Widget

-> m () 

Creates the GDK (windowing system) resources associated with a widget. For example, widget->window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.

Realizing a widget requires all the widget’s parent widgets to be realized; calling widgetRealize realizes the widget’s parents in addition to widget itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen.

This function is primarily used in widget implementations, and isn’t very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as draw. Or simply g_signal_connect () to the realize signal.

regionIntersect

widgetRegionIntersect Source #

Arguments

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

widget: a Widget

-> Region

region: a Region, in the same coordinate system as widget->allocation. That is, relative to widget->window for widgets which return False from widgetGetHasWindow; relative to the parent window of widget->window otherwise.

-> m Region

Returns: A newly allocated region holding the intersection of widget and region.

Deprecated: (Since version 3.14)Use widgetGetAllocation and cairo_region_intersect_rectangle() to get the same behavior.

Computes the intersection of a widget’s area and region, returning the intersection. The result may be empty, use cairo_region_is_empty() to check.

registerWindow

widgetRegisterWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWindow b) 
=> a

widget: a Widget

-> b

window: a Window

-> m () 

Registers a Window with the widget and sets it up so that the widget receives events for it. Call widgetUnregisterWindow when destroying the window.

Before 3.8 you needed to call windowSetUserData directly to set this up. This is now deprecated and you should use widgetRegisterWindow instead. Old code will keep working as is, although some new features like transparency might not work perfectly.

Since: 3.8

removeAccelerator

widgetRemoveAccelerator Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsAccelGroup b) 
=> a

widget: widget to install an accelerator on

-> b

accelGroup: accel group for this widget

-> Word32

accelKey: GDK keyval of the accelerator

-> [ModifierType]

accelMods: modifier key combination of the accelerator

-> m Bool

Returns: whether an accelerator was installed and could be removed

Removes an accelerator from widget, previously installed with widgetAddAccelerator.

removeMnemonicLabel

widgetRemoveMnemonicLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

widget: a Widget

-> b

label: a Widget that was previously set as a mnemonic label for widget with widgetAddMnemonicLabel.

-> m () 

Removes a widget from the list of mnemonic labels for this widget. (See widgetListMnemonicLabels). The widget must have previously been added to the list with widgetAddMnemonicLabel.

Since: 2.4

removeTickCallback

widgetRemoveTickCallback Source #

Arguments

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

widget: a Widget

-> Word32

id: an id returned by widgetAddTickCallback

-> m () 

Removes a tick callback previously registered with widgetAddTickCallback.

Since: 3.8

renderIcon

widgetRenderIcon Source #

Arguments

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

widget: a Widget

-> Text

stockId: a stock ID

-> Int32

size: a stock size (tIconSize). A size of (GtkIconSize)-1 means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).

-> Maybe Text

detail: render detail to pass to theme engine

-> m (Maybe Pixbuf)

Returns: a new pixbuf, or Nothing if the stock ID wasn’t known

Deprecated: (Since version 3.0)Use widgetRenderIconPixbuf instead.

A convenience function that uses the theme settings for widget to look up stockId and render it to a pixbuf. stockId should be a stock icon ID such as STOCK_OPEN or STOCK_OK. size should be a size such as GTK_ICON_SIZE_MENU. detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.

The pixels in the returned Pixbuf are shared with the rest of the application and should not be modified. The pixbuf should be freed after use with objectUnref.

renderIconPixbuf

widgetRenderIconPixbuf Source #

Arguments

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

widget: a Widget

-> Text

stockId: a stock ID

-> Int32

size: a stock size (tIconSize). A size of (GtkIconSize)-1 means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes).

-> m (Maybe Pixbuf)

Returns: a new pixbuf, or Nothing if the stock ID wasn’t known

Deprecated: (Since version 3.10)Use iconThemeLoadIcon instead.

A convenience function that uses the theme engine and style settings for widget to look up stockId and render it to a pixbuf. stockId should be a stock icon ID such as STOCK_OPEN or STOCK_OK. size should be a size such as GTK_ICON_SIZE_MENU.

The pixels in the returned Pixbuf are shared with the rest of the application and should not be modified. The pixbuf should be freed after use with objectUnref.

Since: 3.0

reparent

widgetReparent Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

widget: a Widget

-> b

newParent: a Container to move the widget into

-> m () 

Deprecated: (Since version 3.14)Use containerRemove and containerAdd.

Moves a widget from one Container to another, handling reference count issues to avoid destroying the widget.

resetRcStyles

widgetResetRcStyles Source #

Arguments

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

widget: a Widget.

-> m () 

Deprecated: (Since version 3.0)Use StyleContext instead, and widgetResetStyle

Reset the styles of widget and all descendents, so when they are looked up again, they get the correct values for the currently loaded RC file settings.

This function is not useful for applications.

resetStyle

widgetResetStyle Source #

Arguments

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

widget: a Widget

-> m () 

Updates the style context of widget and all descendants by updating its widget path. GtkContainers may want to use this on a child when reordering it in a way that a different style might apply to it. See also containerGetPathForChild.

Since: 3.0

sendExpose

widgetSendExpose Source #

Arguments

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

widget: a Widget

-> Event

event: a expose Event

-> m Int32

Returns: return from the event signal emission (True if the event was handled)

Deprecated: (Since version 3.22)Application and widget code should not handle expose events directly; invalidation should use the Widget API, and drawing should only happen inside draw implementations

Very rarely-used function. This function is used to emit an expose event on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a windowless child widget (widgetGetHasWindow is False), and that is normally done using containerPropagateDraw.

If you want to force an area of a window to be redrawn, use windowInvalidateRect or windowInvalidateRegion. To cause the redraw to be done immediately, follow that call with a call to windowProcessUpdates.

sendFocusChange

widgetSendFocusChange Source #

Arguments

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

widget: a Widget

-> Event

event: a Event of type GDK_FOCUS_CHANGE

-> m Bool

Returns: the return value from the event signal emission: True if the event was handled, and False otherwise

Sends the focus change event to widget

This function is not meant to be used by applications. The only time it should be used is when it is necessary for a Widget to assign focus to a widget that is semantically owned by the first widget even though it’s not a direct child - for instance, a search entry in a floating window similar to the quick search in TreeView.

An example of its usage is:

C code

 GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);

 fevent->focus_change.type = GDK_FOCUS_CHANGE;
 fevent->focus_change.in = TRUE;
 fevent->focus_change.window = _gtk_widget_get_window (widget);
 if (fevent->focus_change.window != NULL)
   g_object_ref (fevent->focus_change.window);

 gtk_widget_send_focus_change (widget, fevent);

 gdk_event_free (event);

Since: 2.20

setAccelPath

widgetSetAccelPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsAccelGroup b) 
=> a

widget: a Widget

-> Maybe Text

accelPath: path used to look up the accelerator

-> Maybe b

accelGroup: a AccelGroup.

-> m () 

Given an accelerator group, accelGroup, and an accelerator path, accelPath, sets up an accelerator in accelGroup so whenever the key binding that is defined for accelPath is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to widgetSetAccelPath. Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See accelMapSave.)

This function is a low level function that would most likely be used by a menu creation system like UIManager. If you use UIManager, setting up accelerator paths will be done automatically.

Even when you you aren’t using UIManager, if you only want to set up accelerators on menu items menuItemSetAccelPath provides a somewhat more convenient interface.

Note that accelPath string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with internStaticString.

setAllocation

widgetSetAllocation Source #

Arguments

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

widget: a Widget

-> Rectangle

allocation: a pointer to a GtkAllocation to copy from

-> m () 

Sets the widget’s allocation. This should not be used directly, but from within a widget’s size_allocate method.

The allocation set should be the “adjusted” or actual allocation. If you’re implementing a Container, you want to use widgetSizeAllocate instead of widgetSetAllocation. The GtkWidgetClass[adjust_size_allocation](#g:signal:adjust_size_allocation) virtual method adjusts the allocation inside widgetSizeAllocate to create an adjusted allocation.

Since: 2.18

setAppPaintable

widgetSetAppPaintable Source #

Arguments

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

widget: a Widget

-> Bool

appPaintable: True if the application will paint on the widget

-> m () 

Sets whether the application intends to draw on the widget in an draw handler.

This is a hint to the widget and does not affect the behavior of the GTK+ core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as EventBox and Window, the effect is to suppress default themed drawing of the widget's background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background.

Note that the background is still drawn when the widget is mapped.

setCanDefault

widgetSetCanDefault Source #

Arguments

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

widget: a Widget

-> Bool

canDefault: whether or not widget can be a default widget.

-> m () 

Specifies whether widget can be a default widget. See widgetGrabDefault for details about the meaning of “default”.

Since: 2.18

setCanFocus

widgetSetCanFocus Source #

Arguments

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

widget: a Widget

-> Bool

canFocus: whether or not widget can own the input focus.

-> m () 

Specifies whether widget can own the input focus. See widgetGrabFocus for actually setting the input focus on a widget.

Since: 2.18

setChildVisible

widgetSetChildVisible Source #

Arguments

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

widget: a Widget

-> Bool

isVisible: if True, widget should be mapped along with its parent.

-> m () 

Sets whether widget should be mapped along with its when its parent is mapped and widget has been shown with widgetShow.

The child visibility can be set for widget before it is added to a container with widgetSetParent, to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of True when the widget is removed from a container.

Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.

This function is only useful for container implementations and never should be called by an application.

setClip

widgetSetClip Source #

Arguments

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

widget: a Widget

-> Rectangle

clip: a pointer to a GtkAllocation to copy from

-> m () 

Sets the widget’s clip. This must not be used directly, but from within a widget’s size_allocate method. It must be called after widgetSetAllocation (or after chaining up to the parent class), because that function resets the clip.

The clip set should be the area that widget draws on. If widget is a Container, the area must contain all children's clips.

If this function is not called by widget during a sizeAllocate handler, the clip will be set to widget's allocation.

Since: 3.14

setCompositeName

widgetSetCompositeName Source #

Arguments

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

widget: a Widget.

-> Text

name: the name to set

-> m () 

Deprecated: (Since version 3.10)Use widgetClassSetTemplate, or don’t use this API at all.

Sets a widgets composite name. The widget must be a composite child of its parent; see widgetPushCompositeChild.

setDefaultDirection

widgetSetDefaultDirection Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TextDirection

dir: the new default direction. This cannot be TextDirectionNone.

-> m () 

Sets the default reading direction for widgets where the direction has not been explicitly set by widgetSetDirection.

setDeviceEnabled

widgetSetDeviceEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDevice b) 
=> a

widget: a Widget

-> b

device: a Device

-> Bool

enabled: whether to enable the device

-> m () 

Enables or disables a Device to interact with widget and all its children.

It does so by descending through the Window hierarchy and enabling the same mask that is has for core events (i.e. the one that windowGetEvents returns).

Since: 3.0

setDeviceEvents

widgetSetDeviceEvents Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsDevice b) 
=> a

widget: a Widget

-> b

device: a Device

-> [EventMask]

events: event mask

-> m () 

Sets the device event mask (see EventMask) for a widget. The event mask determines which events a widget will receive from device. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider widgetAddDeviceEvents for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with windowless widgets (which return False from widgetGetHasWindow); to get events on those widgets, place them inside a EventBox and receive events on the event box.

Since: 3.0

setDirection

widgetSetDirection Source #

Arguments

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

widget: a Widget

-> TextDirection

dir: the new direction

-> m () 

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification).

If the direction is set to TextDirectionNone, then the value set by widgetSetDefaultDirection will be used.

setDoubleBuffered

widgetSetDoubleBuffered Source #

Arguments

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

widget: a Widget

-> Bool

doubleBuffered: True to double-buffer a widget

-> m () 

Deprecated: (Since version 3.14)This function does not work under non-X11 backends or withnon-native windows.It should not be used in newly written code.

Widgets are double buffered by default; you can use this function to turn off the buffering. “Double buffered” simply means that windowBeginDrawFrame and windowEndDrawFrame are called automatically around expose events sent to the widget. windowBeginDrawFrame diverts all drawing to a widget's window to an offscreen buffer, and windowEndDrawFrame draws the buffer to the screen. The result is that users see the window update in one smooth step, and don’t see individual graphics primitives being rendered.

In very simple terms, double buffered widgets don’t flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing.

Note: if you turn off double-buffering, you have to handle expose events, since even the clearing to the background color or pixmap will not happen automatically (as it is done in windowBeginDrawFrame).

In 3.10 GTK and GDK have been restructured for translucent drawing. Since then expose events for double-buffered widgets are culled into a single event to the toplevel GDK window. If you now unset double buffering, you will cause a separate rendering pass for every widget. This will likely cause rendering problems - in particular related to stacking - and usually increases rendering times significantly.

setEvents

widgetSetEvents Source #

Arguments

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

widget: a Widget

-> [EventMask]

events: event mask

-> m () 

Sets the event mask (see EventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider widgetAddEvents for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with widgets that have no window. (See widgetGetHasWindow). To get events on those widgets, place them inside a EventBox and receive events on the event box.

setFocusOnClick

widgetSetFocusOnClick Source #

Arguments

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

widget: a Widget

-> Bool

focusOnClick: whether the widget should grab focus when clicked with the mouse

-> m () 

Sets whether the widget should grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

Since: 3.20

setFontMap

widgetSetFontMap Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsFontMap b) 
=> a

widget: a Widget

-> Maybe b

fontMap: a FontMap, or Nothing to unset any previously set font map

-> m () 

Sets the font map to use for Pango rendering. When not set, the widget will inherit the font map from its parent.

Since: 3.18

setFontOptions

widgetSetFontOptions Source #

Arguments

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

widget: a Widget

-> Maybe FontOptions

options: a FontOptions, or Nothing to unset any previously set default font options.

-> m () 

Sets the FontOptions used for Pango rendering in this widget. When not set, the default font options for the Screen will be used.

Since: 3.18

setHalign

widgetSetHalign Source #

Arguments

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

widget: a Widget

-> Align

align: the horizontal alignment

-> m () 

Sets the horizontal alignment of widget. See the Widget:halign property.

setHasTooltip

widgetSetHasTooltip Source #

Arguments

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

widget: a Widget

-> Bool

hasTooltip: whether or not widget has a tooltip.

-> m () 

Sets the has-tooltip property on widget to hasTooltip. See Widget:has-tooltip for more information.

Since: 2.12

setHasWindow

widgetSetHasWindow Source #

Arguments

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

widget: a Widget

-> Bool

hasWindow: whether or not widget has a window.

-> m () 

Specifies whether widget has a Window of its own. Note that all realized widgets have a non-Nothing “window” pointer (widgetGetWindow never returns a Nothing window when a widget is realized), but for many of them it’s actually the Window of one of its parent widgets. Widgets that do not create a window for themselves in realize must announce this by calling this function with hasWindow = False.

This function should only be called by widget implementations, and they should call it in their init() function.

Since: 2.18

setHexpand

widgetSetHexpand Source #

Arguments

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

widget: the widget

-> Bool

expand: whether to expand

-> m () 

Sets whether the widget would like any available extra horizontal space. When a user resizes a Window, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room.

By default, widgets automatically expand if any of their children want to expand. (To see if a widget will automatically expand given its current children and state, call widgetComputeExpand. A container can decide how the expandability of children affects the expansion of the container by overriding the compute_expand virtual method on Widget.).

Setting hexpand explicitly with this function will override the automatic expand behavior.

This function forces the widget to expand or not to expand, regardless of children. The override occurs because widgetSetHexpand sets the hexpand-set property (see widgetSetHexpandSet) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.

setHexpandSet

widgetSetHexpandSet Source #

Arguments

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

widget: the widget

-> Bool

set: value for hexpand-set property

-> m () 

Sets whether the hexpand flag (see widgetGetHexpand) will be used.

The hexpand-set property will be set automatically when you call widgetSetHexpand to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag.

If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

There are few reasons to use this function, but it’s here for completeness and consistency.

setMapped

widgetSetMapped Source #

Arguments

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

widget: a Widget

-> Bool

mapped: True to mark the widget as mapped

-> m () 

Marks the widget as being mapped.

This function should only ever be called in a derived widget's “map” or “unmap” implementation.

Since: 2.20

setMarginBottom

widgetSetMarginBottom Source #

Arguments

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

widget: a Widget

-> Int32

margin: the bottom margin

-> m () 

Sets the bottom margin of widget. See the Widget:margin-bottom property.

Since: 3.0

setMarginEnd

widgetSetMarginEnd Source #

Arguments

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

widget: a Widget

-> Int32

margin: the end margin

-> m () 

Sets the end margin of widget. See the Widget:margin-end property.

Since: 3.12

setMarginLeft

widgetSetMarginLeft Source #

Arguments

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

widget: a Widget

-> Int32

margin: the left margin

-> m () 

Deprecated: (Since version 3.12)Use widgetSetMarginStart instead.

Sets the left margin of widget. See the Widget:margin-left property.

Since: 3.0

setMarginRight

widgetSetMarginRight Source #

Arguments

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

widget: a Widget

-> Int32

margin: the right margin

-> m () 

Deprecated: (Since version 3.12)Use widgetSetMarginEnd instead.

Sets the right margin of widget. See the Widget:margin-right property.

Since: 3.0

setMarginStart

widgetSetMarginStart Source #

Arguments

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

widget: a Widget

-> Int32

margin: the start margin

-> m () 

Sets the start margin of widget. See the Widget:margin-start property.

Since: 3.12

setMarginTop

widgetSetMarginTop Source #

Arguments

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

widget: a Widget

-> Int32

margin: the top margin

-> m () 

Sets the top margin of widget. See the Widget:margin-top property.

Since: 3.0

setName

widgetSetName Source #

Arguments

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

widget: a Widget

-> Text

name: name for the widget

-> m () 

Widgets can be named, which allows you to refer to them from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for StyleContext).

Note that the CSS syntax has certain special characters to delimit and represent elements in a selector (period, #, >, *...), so using these will make your widget impossible to match by name. Any combination of alphanumeric symbols, dashes and underscores will suffice.

setNoShowAll

widgetSetNoShowAll Source #

Arguments

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

widget: a Widget

-> Bool

noShowAll: the new value for the “no-show-all” property

-> m () 

Sets the Widget:no-show-all property, which determines whether calls to widgetShowAll will affect this widget.

This is mostly for use in constructing widget hierarchies with externally controlled visibility, see UIManager.

Since: 2.4

setOpacity

widgetSetOpacity Source #

Arguments

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

widget: a Widget

-> Double

opacity: desired opacity, between 0 and 1

-> m () 

Request the widget to be rendered partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Opacity values are clamped to the [0,1] range.). This works on both toplevel widget, and child widgets, although there are some limitations:

For toplevel widgets this depends on the capabilities of the windowing system. On X11 this has any effect only on X screens with a compositing manager running. See widgetIsComposited. On Windows it should work always, although setting a window’s opacity after the window has been shown causes it to flicker once on Windows.

For child widgets it doesn’t work if any affected widget has a native window, or disables double buffering.

Since: 3.8

setParent

widgetSetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

widget: a Widget

-> b

parent: parent container

-> m () 

This function is useful only when implementing subclasses of Container. Sets the container as the parent of widget, and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is widgetUnparent.

setParentWindow

widgetSetParentWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWindow b) 
=> a

widget: a Widget.

-> b

parentWindow: the new parent window.

-> m () 

Sets a non default parent window for widget.

For Window classes, setting a parentWindow effects whether the window is a toplevel window or can be embedded into other widgets.

For Window classes, this needs to be called before the window is realized.

setRealized

widgetSetRealized Source #

Arguments

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

widget: a Widget

-> Bool

realized: True to mark the widget as realized

-> m () 

Marks the widget as being realized. This function must only be called after all GdkWindows for the widget have been created and registered.

This function should only ever be called in a derived widget's “realize” or “unrealize” implementation.

Since: 2.20

setReceivesDefault

widgetSetReceivesDefault Source #

Arguments

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

widget: a Widget

-> Bool

receivesDefault: whether or not widget can be a default widget.

-> m () 

Specifies whether widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

See widgetGrabDefault for details about the meaning of “default”.

Since: 2.18

setRedrawOnAllocate

widgetSetRedrawOnAllocate Source #

Arguments

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

widget: a Widget

-> Bool

redrawOnAllocate: if True, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.

-> m () 

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is True and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance.

Note that for widgets where widgetGetHasWindow is False setting this flag to False turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don’t draw anything to avoid excess invalidations. If you set this flag on a widget with no window that does draw on widget->window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.

setSensitive

widgetSetSensitive Source #

Arguments

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

widget: a Widget

-> Bool

sensitive: True to make the widget sensitive

-> m () 

Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits.

setSizeRequest

widgetSetSizeRequest Source #

Arguments

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

widget: a Widget

-> Int32

width: width widget should request, or -1 to unset

-> Int32

height: height widget should request, or -1 to unset

-> m () 

Sets the minimum size of a widget; that is, the widget’s size request will be at least width by height. You can use this function to force a widget to be larger than it normally would be.

In most cases, windowSetDefaultSize is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, windowSetGeometryHints can be a useful function as well.

Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.

The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead.

The size request set here does not include any margin from the Widget properties margin-left, margin-right, margin-top, and margin-bottom, but it does include pretty much all other padding or border properties set by any subclass of Widget.

setState

widgetSetState Source #

Arguments

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

widget: a Widget

-> StateType

state: new state for widget

-> m () 

Deprecated: (Since version 3.0)Use widgetSetStateFlags instead.

This function is for use in widget implementations. Sets the state of a widget (insensitive, prelighted, etc.) Usually you should set the state using wrapper functions such as widgetSetSensitive.

setStateFlags

widgetSetStateFlags Source #

Arguments

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

widget: a Widget

-> [StateFlags]

flags: State flags to turn on

-> Bool

clear: Whether to clear state before turning on flags

-> m () 

This function is for use in widget implementations. Turns on flag values in the current widget state (insensitive, prelighted, etc.).

This function accepts the values StateFlagsDirLtr and StateFlagsDirRtl but ignores them. If you want to set the widget's direction, use widgetSetDirection.

It is worth mentioning that any other state than StateFlagsInsensitive, will be propagated down to all non-internal children if widget is a Container, while StateFlagsInsensitive itself will be propagated down to all Container children by different means than turning on the state flag down the hierarchy, both widgetGetStateFlags and widgetIsSensitive will make use of these.

Since: 3.0

setStyle

widgetSetStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsStyle b) 
=> a

widget: a Widget

-> Maybe b

style: a Style, or Nothing to remove the effect of a previous call to widgetSetStyle and go back to the default style

-> m () 

Deprecated: (Since version 3.0)Use StyleContext instead

Used to set the Style for a widget (widget->style). Since GTK 3, this function does nothing, the passed in style is ignored.

setSupportMultidevice

widgetSetSupportMultidevice Source #

Arguments

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

widget: a Widget

-> Bool

supportMultidevice: True to support input from multiple devices.

-> m () 

Enables or disables multiple pointer awareness. If this setting is True, widget will start receiving multiple, per device enter/leave events. Note that if custom GdkWindows are created in realize, windowSetSupportMultidevice will have to be called manually on them.

Since: 3.0

setTooltipMarkup

widgetSetTooltipMarkup Source #

Arguments

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

widget: a Widget

-> Maybe Text

markup: the contents of the tooltip for widget, or Nothing

-> m () 

Sets markup as the contents of the tooltip, which is marked up with the [Pango text markup language][PangoMarkupFormat].

This function will take care of setting Widget:has-tooltip to True and of the default handler for the queryTooltip signal.

See also the Widget:tooltip-markup property and tooltipSetMarkup.

Since: 2.12

setTooltipText

widgetSetTooltipText Source #

Arguments

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

widget: a Widget

-> Maybe Text

text: the contents of the tooltip for widget

-> m () 

Sets text as the contents of the tooltip. This function will take care of setting Widget:has-tooltip to True and of the default handler for the queryTooltip signal.

See also the Widget:tooltip-text property and tooltipSetText.

Since: 2.12

setTooltipWindow

widgetSetTooltipWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWindow b) 
=> a

widget: a Widget

-> Maybe b

customWindow: a Window, or Nothing

-> m () 

Replaces the default window used for displaying tooltips with customWindow. GTK+ will take care of showing and hiding customWindow at the right moment, to behave likewise as the default tooltip window. If customWindow is Nothing, the default tooltip window will be used.

Since: 2.12

setValign

widgetSetValign Source #

Arguments

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

widget: a Widget

-> Align

align: the vertical alignment

-> m () 

Sets the vertical alignment of widget. See the Widget:valign property.

setVexpand

widgetSetVexpand Source #

Arguments

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

widget: the widget

-> Bool

expand: whether to expand

-> m () 

Sets whether the widget would like any available extra vertical space.

See widgetSetHexpand for more detail.

setVexpandSet

widgetSetVexpandSet Source #

Arguments

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

widget: the widget

-> Bool

set: value for vexpand-set property

-> m () 

Sets whether the vexpand flag (see widgetGetVexpand) will be used.

See widgetSetHexpandSet for more detail.

setVisible

widgetSetVisible Source #

Arguments

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

widget: a Widget

-> Bool

visible: whether the widget should be shown or not

-> m () 

Sets the visibility state of widget. Note that setting this to True doesn’t mean the widget is actually viewable, see widgetGetVisible.

This function simply calls widgetShow or widgetHide but is nicer to use when the visibility of the widget depends on some condition.

Since: 2.18

setVisual

widgetSetVisual Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsVisual b) 
=> a

widget: a Widget

-> Maybe b

visual: visual to be used or Nothing to unset a previous one

-> m () 

Sets the visual that should be used for by widget and its children for creating GdkWindows. The visual must be on the same Screen as returned by widgetGetScreen, so handling the screenChanged signal is necessary.

Setting a new visual will not cause widget to recreate its windows, so you should call this function before widget is realized.

setWindow

widgetSetWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWindow b) 
=> a

widget: a Widget

-> b

window: a Window

-> m () 

Sets a widget’s window. This function should only be used in a widget’s realize implementation. The window passed is usually either new window created with windowNew, or the window of its parent widget as returned by widgetGetParentWindow.

Widgets must indicate whether they will create their own Window by calling widgetSetHasWindow. This is usually done in the widget’s init() function.

Note that this function does not add any reference to window.

Since: 2.18

shapeCombineRegion

widgetShapeCombineRegion Source #

Arguments

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

widget: a Widget

-> Maybe Region

region: shape to be added, or Nothing to remove an existing shape

-> m () 

Sets a shape for this widget’s GDK window. This allows for transparent windows etc., see windowShapeCombineRegion for more information.

Since: 3.0

show

widgetShow Source #

Arguments

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

widget: a Widget

-> m () 

Flags a widget to be displayed. Any widget that isn’t shown will not appear on the screen. If you want to show all the widgets in a container, it’s easier to call widgetShowAll on the container, instead of individually showing the widgets.

Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.

When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

showAll

widgetShowAll Source #

Arguments

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

widget: a Widget

-> m () 

Recursively shows a widget, and any child widgets (if the widget is a container).

showNow

widgetShowNow Source #

Arguments

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

widget: a Widget

-> m () 

Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.

sizeAllocate

widgetSizeAllocate Source #

Arguments

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

widget: a Widget

-> Rectangle

allocation: position and size to be allocated to widget

-> m () 

This function is only used by Container subclasses, to assign a size and position to their child widgets.

In this function, the allocation may be adjusted. It will be forced to a 1x1 minimum size, and the adjust_size_allocation virtual method on the child will be used to adjust the allocation. Standard adjustments include removing the widget’s margins, and applying the widget’s Widget:halign and Widget:valign properties.

For baseline support in containers you need to use widgetSizeAllocateWithBaseline instead.

sizeAllocateWithBaseline

widgetSizeAllocateWithBaseline Source #

Arguments

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

widget: a Widget

-> Rectangle

allocation: position and size to be allocated to widget

-> Int32

baseline: The baseline of the child, or -1

-> m () 

This function is only used by Container subclasses, to assign a size, position and (optionally) baseline to their child widgets.

In this function, the allocation and baseline may be adjusted. It will be forced to a 1x1 minimum size, and the adjust_size_allocation virtual and adjust_baseline_allocation methods on the child will be used to adjust the allocation and baseline. Standard adjustments include removing the widget's margins, and applying the widget’s Widget:halign and Widget:valign properties.

If the child widget does not have a valign of AlignBaseline the baseline argument is ignored and -1 is used instead.

Since: 3.10

sizeRequest

widgetSizeRequest Source #

Arguments

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

widget: a Widget

-> m Requisition 

Deprecated: (Since version 3.0)Use widgetGetPreferredSize instead.

This function is typically used when implementing a Container subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with widgetSizeAllocate.

You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind.

Also remember that the size request is not necessarily the size a widget will actually be allocated.

styleAttach

widgetStyleAttach Source #

Arguments

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

widget: a Widget

-> m () 

Deprecated: (Since version 3.0)This step is unnecessary with StyleContext.

This function attaches the widget’s Style to the widget's Window. It is a replacement for

widget->style = gtk_style_attach (widget->style, widget->window);

and should only ever be called in a derived widget’s “realize” implementation which does not chain up to its parent class' “realize” implementation, because one of the parent classes (finally Widget) would attach the style itself.

Since: 2.20

styleGetProperty

widgetStyleGetProperty Source #

Arguments

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

widget: a Widget

-> Text

propertyName: the name of a style property

-> GValue

value: location to return the property value

-> m () 

Gets the value of a style property of widget.

thawChildNotify

widgetThawChildNotify Source #

Arguments

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

widget: a Widget

-> m () 

Reverts the effect of a previous call to widgetFreezeChildNotify. This causes all queued childNotify signals on widget to be emitted.

translateCoordinates

widgetTranslateCoordinates Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWidget b) 
=> a

srcWidget: a Widget

-> b

destWidget: a Widget

-> Int32

srcX: X position relative to srcWidget

-> Int32

srcY: Y position relative to srcWidget

-> m (Bool, Int32, Int32)

Returns: False if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *destX and *destY. Otherwise True.

Translate coordinates relative to srcWidget’s allocation to coordinates relative to destWidget’s allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.

triggerTooltipQuery

widgetTriggerTooltipQuery Source #

Arguments

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

widget: a Widget

-> m () 

Triggers a tooltip query on the display where the toplevel of widget is located. See tooltipTriggerTooltipQuery for more information.

Since: 2.12

unmap

widgetUnmap Source #

Arguments

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

widget: a Widget

-> m () 

This function is only for use in widget implementations. Causes a widget to be unmapped if it’s currently mapped.

unparent

widgetUnparent Source #

Arguments

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

widget: a Widget

-> m () 

This function is only for use in widget implementations. Should be called by implementations of the remove method on Container, to dissociate a child from the container.

unrealize

widgetUnrealize Source #

Arguments

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

widget: a Widget

-> m () 

This function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as widget->window).

unregisterWindow

widgetUnregisterWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a, IsWindow b) 
=> a

widget: a Widget

-> b

window: a Window

-> m () 

Unregisters a Window from the widget that was previously set up with widgetRegisterWindow. You need to call this when the window is no longer used by the widget, such as when you destroy it.

Since: 3.8

unsetStateFlags

widgetUnsetStateFlags Source #

Arguments

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

widget: a Widget

-> [StateFlags]

flags: State flags to turn off

-> m () 

This function is for use in widget implementations. Turns off flag values for the current widget state (insensitive, prelighted, etc.). See widgetSetStateFlags.

Since: 3.0

Properties

appPaintable

No description available in the introspection data.

constructWidgetAppPaintable :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “app-paintable” property. This is rarely needed directly, but it is used by new.

getWidgetAppPaintable :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #appPaintable

setWidgetAppPaintable :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “app-paintable” property. When overloading is enabled, this is equivalent to

set widget [ #appPaintable := value ]

canDefault

No description available in the introspection data.

constructWidgetCanDefault :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “can-default” property. This is rarely needed directly, but it is used by new.

getWidgetCanDefault :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #canDefault

setWidgetCanDefault :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “can-default” property. When overloading is enabled, this is equivalent to

set widget [ #canDefault := value ]

canFocus

No description available in the introspection data.

constructWidgetCanFocus :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “can-focus” property. This is rarely needed directly, but it is used by new.

getWidgetCanFocus :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #canFocus

setWidgetCanFocus :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

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

set widget [ #canFocus := value ]

compositeChild

No description available in the introspection data.

getWidgetCompositeChild :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #compositeChild

doubleBuffered

Whether the widget is double buffered.

Since: 2.18

constructWidgetDoubleBuffered :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “double-buffered” property. This is rarely needed directly, but it is used by new.

getWidgetDoubleBuffered :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #doubleBuffered

setWidgetDoubleBuffered :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “double-buffered” property. When overloading is enabled, this is equivalent to

set widget [ #doubleBuffered := value ]

events

No description available in the introspection data.

constructWidgetEvents :: (IsWidget o, MonadIO m) => [EventMask] -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “events” property. This is rarely needed directly, but it is used by new.

getWidgetEvents :: (MonadIO m, IsWidget o) => o -> m [EventMask] Source #

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

get widget #events

setWidgetEvents :: (MonadIO m, IsWidget o) => o -> [EventMask] -> m () Source #

Set the value of the “events” property. When overloading is enabled, this is equivalent to

set widget [ #events := value ]

expand

Whether to expand in both directions. Setting this sets both Widget:hexpand and Widget:vexpand

Since: 3.0

constructWidgetExpand :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “expand” property. This is rarely needed directly, but it is used by new.

getWidgetExpand :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #expand

setWidgetExpand :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “expand” property. When overloading is enabled, this is equivalent to

set widget [ #expand := value ]

focusOnClick

Whether the widget should grab focus when it is clicked with the mouse.

This property is only relevant for widgets that can take focus.

Before 3.20, several widgets (GtkButton, GtkFileChooserButton, GtkComboBox) implemented this property individually.

Since: 3.20

constructWidgetFocusOnClick :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “focus-on-click” property. This is rarely needed directly, but it is used by new.

getWidgetFocusOnClick :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #focusOnClick

setWidgetFocusOnClick :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

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

set widget [ #focusOnClick := value ]

halign

How to distribute horizontal space if widget gets extra space, see Align

Since: 3.0

constructWidgetHalign :: (IsWidget o, MonadIO m) => Align -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “halign” property. This is rarely needed directly, but it is used by new.

getWidgetHalign :: (MonadIO m, IsWidget o) => o -> m Align Source #

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

get widget #halign

setWidgetHalign :: (MonadIO m, IsWidget o) => o -> Align -> m () Source #

Set the value of the “halign” property. When overloading is enabled, this is equivalent to

set widget [ #halign := value ]

hasDefault

No description available in the introspection data.

constructWidgetHasDefault :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “has-default” property. This is rarely needed directly, but it is used by new.

getWidgetHasDefault :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #hasDefault

setWidgetHasDefault :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “has-default” property. When overloading is enabled, this is equivalent to

set widget [ #hasDefault := value ]

hasFocus

No description available in the introspection data.

constructWidgetHasFocus :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “has-focus” property. This is rarely needed directly, but it is used by new.

getWidgetHasFocus :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #hasFocus

setWidgetHasFocus :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

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

set widget [ #hasFocus := value ]

hasTooltip

Enables or disables the emission of queryTooltip on widget. A value of True indicates that widget can have a tooltip, in this case the widget will be queried using queryTooltip to determine whether it will provide a tooltip or not.

Note that setting this property to True for the first time will change the event masks of the GdkWindows of this widget to include leave-notify and motion-notify events. This cannot and will not be undone when the property is set to False again.

Since: 2.12

constructWidgetHasTooltip :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “has-tooltip” property. This is rarely needed directly, but it is used by new.

getWidgetHasTooltip :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #hasTooltip

setWidgetHasTooltip :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “has-tooltip” property. When overloading is enabled, this is equivalent to

set widget [ #hasTooltip := value ]

heightRequest

No description available in the introspection data.

constructWidgetHeightRequest :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “height-request” property. This is rarely needed directly, but it is used by new.

getWidgetHeightRequest :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #heightRequest

setWidgetHeightRequest :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “height-request” property. When overloading is enabled, this is equivalent to

set widget [ #heightRequest := value ]

hexpand

Whether to expand horizontally. See widgetSetHexpand.

Since: 3.0

constructWidgetHexpand :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “hexpand” property. This is rarely needed directly, but it is used by new.

getWidgetHexpand :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #hexpand

setWidgetHexpand :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “hexpand” property. When overloading is enabled, this is equivalent to

set widget [ #hexpand := value ]

hexpandSet

Whether to use the Widget:hexpand property. See widgetGetHexpandSet.

Since: 3.0

constructWidgetHexpandSet :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “hexpand-set” property. This is rarely needed directly, but it is used by new.

getWidgetHexpandSet :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #hexpandSet

setWidgetHexpandSet :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “hexpand-set” property. When overloading is enabled, this is equivalent to

set widget [ #hexpandSet := value ]

isFocus

No description available in the introspection data.

constructWidgetIsFocus :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-focus” property. This is rarely needed directly, but it is used by new.

getWidgetIsFocus :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #isFocus

setWidgetIsFocus :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

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

set widget [ #isFocus := value ]

margin

Sets all four sides' margin at once. If read, returns max margin on any side.

Since: 3.0

constructWidgetMargin :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin” property. This is rarely needed directly, but it is used by new.

getWidgetMargin :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #margin

setWidgetMargin :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin” property. When overloading is enabled, this is equivalent to

set widget [ #margin := value ]

marginBottom

Margin on bottom side of widget.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from widgetSetSizeRequest for example.

Since: 3.0

constructWidgetMarginBottom :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin-bottom” property. This is rarely needed directly, but it is used by new.

getWidgetMarginBottom :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #marginBottom

setWidgetMarginBottom :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin-bottom” property. When overloading is enabled, this is equivalent to

set widget [ #marginBottom := value ]

marginEnd

Margin on end of widget, horizontally. This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from widgetSetSizeRequest for example.

Since: 3.12

constructWidgetMarginEnd :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin-end” property. This is rarely needed directly, but it is used by new.

getWidgetMarginEnd :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #marginEnd

setWidgetMarginEnd :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin-end” property. When overloading is enabled, this is equivalent to

set widget [ #marginEnd := value ]

marginLeft

Margin on left side of widget.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from widgetSetSizeRequest for example.

Since: 3.0

constructWidgetMarginLeft :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin-left” property. This is rarely needed directly, but it is used by new.

getWidgetMarginLeft :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #marginLeft

setWidgetMarginLeft :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin-left” property. When overloading is enabled, this is equivalent to

set widget [ #marginLeft := value ]

marginRight

Margin on right side of widget.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from widgetSetSizeRequest for example.

Since: 3.0

constructWidgetMarginRight :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin-right” property. This is rarely needed directly, but it is used by new.

getWidgetMarginRight :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #marginRight

setWidgetMarginRight :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin-right” property. When overloading is enabled, this is equivalent to

set widget [ #marginRight := value ]

marginStart

Margin on start of widget, horizontally. This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from widgetSetSizeRequest for example.

Since: 3.12

constructWidgetMarginStart :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin-start” property. This is rarely needed directly, but it is used by new.

getWidgetMarginStart :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #marginStart

setWidgetMarginStart :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin-start” property. When overloading is enabled, this is equivalent to

set widget [ #marginStart := value ]

marginTop

Margin on top side of widget.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from widgetSetSizeRequest for example.

Since: 3.0

constructWidgetMarginTop :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “margin-top” property. This is rarely needed directly, but it is used by new.

getWidgetMarginTop :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #marginTop

setWidgetMarginTop :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “margin-top” property. When overloading is enabled, this is equivalent to

set widget [ #marginTop := value ]

name

No description available in the introspection data.

constructWidgetName :: (IsWidget o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “name” property. This is rarely needed directly, but it is used by new.

getWidgetName :: (MonadIO m, IsWidget o) => o -> m Text Source #

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

get widget #name

setWidgetName :: (MonadIO m, IsWidget o) => o -> Text -> m () Source #

Set the value of the “name” property. When overloading is enabled, this is equivalent to

set widget [ #name := value ]

noShowAll

No description available in the introspection data.

constructWidgetNoShowAll :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “no-show-all” property. This is rarely needed directly, but it is used by new.

getWidgetNoShowAll :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #noShowAll

setWidgetNoShowAll :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “no-show-all” property. When overloading is enabled, this is equivalent to

set widget [ #noShowAll := value ]

opacity

The requested opacity of the widget. See widgetSetOpacity for more details about window opacity.

Before 3.8 this was only available in GtkWindow

Since: 3.8

constructWidgetOpacity :: (IsWidget o, MonadIO m) => Double -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “opacity” property. This is rarely needed directly, but it is used by new.

getWidgetOpacity :: (MonadIO m, IsWidget o) => o -> m Double Source #

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

get widget #opacity

setWidgetOpacity :: (MonadIO m, IsWidget o) => o -> Double -> m () Source #

Set the value of the “opacity” property. When overloading is enabled, this is equivalent to

set widget [ #opacity := value ]

parent

No description available in the introspection data.

clearWidgetParent :: (MonadIO m, IsWidget o) => o -> m () Source #

Set the value of the “parent” property to Nothing. When overloading is enabled, this is equivalent to

clear #parent

constructWidgetParent :: (IsWidget o, MonadIO m, IsContainer a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “parent” property. This is rarely needed directly, but it is used by new.

getWidgetParent :: (MonadIO m, IsWidget o) => o -> m (Maybe Container) Source #

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

get widget #parent

setWidgetParent :: (MonadIO m, IsWidget o, IsContainer a) => o -> a -> m () Source #

Set the value of the “parent” property. When overloading is enabled, this is equivalent to

set widget [ #parent := value ]

receivesDefault

No description available in the introspection data.

constructWidgetReceivesDefault :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “receives-default” property. This is rarely needed directly, but it is used by new.

getWidgetReceivesDefault :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #receivesDefault

setWidgetReceivesDefault :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “receives-default” property. When overloading is enabled, this is equivalent to

set widget [ #receivesDefault := value ]

scaleFactor

The scale factor of the widget. See widgetGetScaleFactor for more details about widget scaling.

Since: 3.10

getWidgetScaleFactor :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #scaleFactor

sensitive

No description available in the introspection data.

constructWidgetSensitive :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “sensitive” property. This is rarely needed directly, but it is used by new.

getWidgetSensitive :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #sensitive

setWidgetSensitive :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “sensitive” property. When overloading is enabled, this is equivalent to

set widget [ #sensitive := value ]

style

The style of the widget, which contains information about how it will look (colors, etc).

clearWidgetStyle :: (MonadIO m, IsWidget o) => o -> m () Source #

Set the value of the “style” property to Nothing. When overloading is enabled, this is equivalent to

clear #style

constructWidgetStyle :: (IsWidget o, MonadIO m, IsStyle a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “style” property. This is rarely needed directly, but it is used by new.

getWidgetStyle :: (MonadIO m, IsWidget o) => o -> m Style Source #

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

get widget #style

setWidgetStyle :: (MonadIO m, IsWidget o, IsStyle a) => o -> a -> m () Source #

Set the value of the “style” property. When overloading is enabled, this is equivalent to

set widget [ #style := value ]

tooltipMarkup

Sets the text of tooltip to be the given string, which is marked up with the [Pango text markup language][PangoMarkupFormat]. Also see tooltipSetMarkup.

This is a convenience property which will take care of getting the tooltip shown if the given string is not Nothing: Widget:has-tooltip will automatically be set to True and there will be taken care of queryTooltip in the default signal handler.

Note that if both Widget:tooltip-text and Widget:tooltip-markup are set, the last one wins.

Since: 2.12

clearWidgetTooltipMarkup :: (MonadIO m, IsWidget o) => o -> m () Source #

Set the value of the “tooltip-markup” property to Nothing. When overloading is enabled, this is equivalent to

clear #tooltipMarkup

constructWidgetTooltipMarkup :: (IsWidget o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “tooltip-markup” property. This is rarely needed directly, but it is used by new.

getWidgetTooltipMarkup :: (MonadIO m, IsWidget o) => o -> m (Maybe Text) Source #

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

get widget #tooltipMarkup

setWidgetTooltipMarkup :: (MonadIO m, IsWidget o) => o -> Text -> m () Source #

Set the value of the “tooltip-markup” property. When overloading is enabled, this is equivalent to

set widget [ #tooltipMarkup := value ]

tooltipText

Sets the text of tooltip to be the given string.

Also see tooltipSetText.

This is a convenience property which will take care of getting the tooltip shown if the given string is not Nothing: Widget:has-tooltip will automatically be set to True and there will be taken care of queryTooltip in the default signal handler.

Note that if both Widget:tooltip-text and Widget:tooltip-markup are set, the last one wins.

Since: 2.12

clearWidgetTooltipText :: (MonadIO m, IsWidget o) => o -> m () Source #

Set the value of the “tooltip-text” property to Nothing. When overloading is enabled, this is equivalent to

clear #tooltipText

constructWidgetTooltipText :: (IsWidget o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “tooltip-text” property. This is rarely needed directly, but it is used by new.

getWidgetTooltipText :: (MonadIO m, IsWidget o) => o -> m (Maybe Text) Source #

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

get widget #tooltipText

setWidgetTooltipText :: (MonadIO m, IsWidget o) => o -> Text -> m () Source #

Set the value of the “tooltip-text” property. When overloading is enabled, this is equivalent to

set widget [ #tooltipText := value ]

valign

How to distribute vertical space if widget gets extra space, see Align

Since: 3.0

constructWidgetValign :: (IsWidget o, MonadIO m) => Align -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “valign” property. This is rarely needed directly, but it is used by new.

getWidgetValign :: (MonadIO m, IsWidget o) => o -> m Align Source #

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

get widget #valign

setWidgetValign :: (MonadIO m, IsWidget o) => o -> Align -> m () Source #

Set the value of the “valign” property. When overloading is enabled, this is equivalent to

set widget [ #valign := value ]

vexpand

Whether to expand vertically. See widgetSetVexpand.

Since: 3.0

constructWidgetVexpand :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “vexpand” property. This is rarely needed directly, but it is used by new.

getWidgetVexpand :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #vexpand

setWidgetVexpand :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “vexpand” property. When overloading is enabled, this is equivalent to

set widget [ #vexpand := value ]

vexpandSet

Whether to use the Widget:vexpand property. See widgetGetVexpandSet.

Since: 3.0

constructWidgetVexpandSet :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “vexpand-set” property. This is rarely needed directly, but it is used by new.

getWidgetVexpandSet :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #vexpandSet

setWidgetVexpandSet :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “vexpand-set” property. When overloading is enabled, this is equivalent to

set widget [ #vexpandSet := value ]

visible

No description available in the introspection data.

constructWidgetVisible :: (IsWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “visible” property. This is rarely needed directly, but it is used by new.

getWidgetVisible :: (MonadIO m, IsWidget o) => o -> m Bool Source #

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

get widget #visible

setWidgetVisible :: (MonadIO m, IsWidget o) => o -> Bool -> m () Source #

Set the value of the “visible” property. When overloading is enabled, this is equivalent to

set widget [ #visible := value ]

widthRequest

No description available in the introspection data.

constructWidgetWidthRequest :: (IsWidget o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “width-request” property. This is rarely needed directly, but it is used by new.

getWidgetWidthRequest :: (MonadIO m, IsWidget o) => o -> m Int32 Source #

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

get widget #widthRequest

setWidgetWidthRequest :: (MonadIO m, IsWidget o) => o -> Int32 -> m () Source #

Set the value of the “width-request” property. When overloading is enabled, this is equivalent to

set widget [ #widthRequest := value ]

window

The widget's window if it is realized, Nothing otherwise.

Since: 2.14

getWidgetWindow :: (MonadIO m, IsWidget o) => o -> m (Maybe Window) Source #

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

get widget #window

Signals

accelClosuresChanged

type C_WidgetAccelClosuresChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetAccelClosuresChangedCallback = IO () Source #

No description available in the introspection data.

afterWidgetAccelClosuresChanged :: (IsWidget a, MonadIO m) => a -> WidgetAccelClosuresChangedCallback -> m SignalHandlerId Source #

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

after widget #accelClosuresChanged callback

onWidgetAccelClosuresChanged :: (IsWidget a, MonadIO m) => a -> WidgetAccelClosuresChangedCallback -> m SignalHandlerId Source #

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

on widget #accelClosuresChanged callback

buttonPressEvent

type C_WidgetButtonPressEventCallback = Ptr () -> Ptr EventButton -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetButtonPressEventCallback Source #

Arguments

 = EventButton

event: the EventButton which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The buttonPressEvent signal will be emitted when a button (typically from a mouse) is pressed.

To receive this signal, the Window associated to the widget needs to enable the GDK_BUTTON_PRESS_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetButtonPressEvent :: (IsWidget a, MonadIO m) => a -> WidgetButtonPressEventCallback -> m SignalHandlerId Source #

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

after widget #buttonPressEvent callback

onWidgetButtonPressEvent :: (IsWidget a, MonadIO m) => a -> WidgetButtonPressEventCallback -> m SignalHandlerId Source #

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

on widget #buttonPressEvent callback

buttonReleaseEvent

type C_WidgetButtonReleaseEventCallback = Ptr () -> Ptr EventButton -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetButtonReleaseEventCallback Source #

Arguments

 = EventButton

event: the EventButton which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The buttonReleaseEvent signal will be emitted when a button (typically from a mouse) is released.

To receive this signal, the Window associated to the widget needs to enable the GDK_BUTTON_RELEASE_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetButtonReleaseEvent :: (IsWidget a, MonadIO m) => a -> WidgetButtonReleaseEventCallback -> m SignalHandlerId Source #

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

after widget #buttonReleaseEvent callback

onWidgetButtonReleaseEvent :: (IsWidget a, MonadIO m) => a -> WidgetButtonReleaseEventCallback -> m SignalHandlerId Source #

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

on widget #buttonReleaseEvent callback

canActivateAccel

type C_WidgetCanActivateAccelCallback = Ptr () -> Word32 -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetCanActivateAccelCallback Source #

Arguments

 = Word32

signalId: the ID of a signal installed on widget

-> IO Bool

Returns: True if the signal can be activated.

Determines whether an accelerator that activates the signal identified by signalId can currently be activated. This signal is present to allow applications and derived widgets to override the default Widget handling for determining whether an accelerator can be activated.

afterWidgetCanActivateAccel :: (IsWidget a, MonadIO m) => a -> WidgetCanActivateAccelCallback -> m SignalHandlerId Source #

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

after widget #canActivateAccel callback

onWidgetCanActivateAccel :: (IsWidget a, MonadIO m) => a -> WidgetCanActivateAccelCallback -> m SignalHandlerId Source #

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

on widget #canActivateAccel callback

childNotify

type C_WidgetChildNotifyCallback = Ptr () -> Ptr GParamSpec -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetChildNotifyCallback Source #

Arguments

 = GParamSpec

childProperty: the ParamSpec of the changed child property

-> IO () 

The childNotify signal is emitted for each [child property][child-properties] that has changed on an object. The signal's detail holds the property name.

afterWidgetChildNotify :: (IsWidget a, MonadIO m) => a -> Maybe Text -> WidgetChildNotifyCallback -> m SignalHandlerId Source #

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

after widget #childNotify callback

This signal admits a optional parameter detail. If it's not Nothing, we will connect to “child-notify::detail” instead.

onWidgetChildNotify :: (IsWidget a, MonadIO m) => a -> Maybe Text -> WidgetChildNotifyCallback -> m SignalHandlerId Source #

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

on widget #childNotify callback

This signal admits a optional parameter detail. If it's not Nothing, we will connect to “child-notify::detail” instead.

compositedChanged

type C_WidgetCompositedChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetCompositedChangedCallback = IO () Source #

Deprecated: (Since version 3.22)Use GdkScreen[compositedChanged](#g:signal:compositedChanged) instead.

The compositedChanged signal is emitted when the composited status of widgets screen changes. See screenIsComposited.

afterWidgetCompositedChanged :: (IsWidget a, MonadIO m) => a -> WidgetCompositedChangedCallback -> m SignalHandlerId Source #

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

after widget #compositedChanged callback

onWidgetCompositedChanged :: (IsWidget a, MonadIO m) => a -> WidgetCompositedChangedCallback -> m SignalHandlerId Source #

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

on widget #compositedChanged callback

configureEvent

type C_WidgetConfigureEventCallback = Ptr () -> Ptr EventConfigure -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetConfigureEventCallback Source #

Arguments

 = EventConfigure

event: the EventConfigure which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The configureEvent signal will be emitted when the size, position or stacking of the widget's window has changed.

To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

afterWidgetConfigureEvent :: (IsWidget a, MonadIO m) => a -> WidgetConfigureEventCallback -> m SignalHandlerId Source #

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

after widget #configureEvent callback

onWidgetConfigureEvent :: (IsWidget a, MonadIO m) => a -> WidgetConfigureEventCallback -> m SignalHandlerId Source #

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

on widget #configureEvent callback

damageEvent

type C_WidgetDamageEventCallback = Ptr () -> Ptr EventExpose -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDamageEventCallback Source #

Arguments

 = EventExpose

event: the EventExpose event

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when a redirected window belonging to widget gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.

Since: 2.14

afterWidgetDamageEvent :: (IsWidget a, MonadIO m) => a -> WidgetDamageEventCallback -> m SignalHandlerId Source #

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

after widget #damageEvent callback

onWidgetDamageEvent :: (IsWidget a, MonadIO m) => a -> WidgetDamageEventCallback -> m SignalHandlerId Source #

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

on widget #damageEvent callback

deleteEvent

type C_WidgetDeleteEventCallback = Ptr () -> Ptr Event -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDeleteEventCallback Source #

Arguments

 = Event

event: the event which triggered this signal

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The deleteEvent signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connecting widgetHideOnDelete to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.

afterWidgetDeleteEvent :: (IsWidget a, MonadIO m) => a -> WidgetDeleteEventCallback -> m SignalHandlerId Source #

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

after widget #deleteEvent callback

onWidgetDeleteEvent :: (IsWidget a, MonadIO m) => a -> WidgetDeleteEventCallback -> m SignalHandlerId Source #

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

on widget #deleteEvent callback

destroy

type C_WidgetDestroyCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDestroyCallback = IO () Source #

Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released.

This signal is not suitable for saving widget state.

afterWidgetDestroy :: (IsWidget a, MonadIO m) => a -> WidgetDestroyCallback -> m SignalHandlerId Source #

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

after widget #destroy callback

mk_WidgetDestroyCallback :: C_WidgetDestroyCallback -> IO (FunPtr C_WidgetDestroyCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetDestroyCallback.

onWidgetDestroy :: (IsWidget a, MonadIO m) => a -> WidgetDestroyCallback -> m SignalHandlerId Source #

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

on widget #destroy callback

destroyEvent

type C_WidgetDestroyEventCallback = Ptr () -> Ptr Event -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDestroyEventCallback Source #

Arguments

 = Event

event: the event which triggered this signal

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The destroyEvent signal is emitted when a Window is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time.

To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

afterWidgetDestroyEvent :: (IsWidget a, MonadIO m) => a -> WidgetDestroyEventCallback -> m SignalHandlerId Source #

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

after widget #destroyEvent callback

onWidgetDestroyEvent :: (IsWidget a, MonadIO m) => a -> WidgetDestroyEventCallback -> m SignalHandlerId Source #

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

on widget #destroyEvent callback

directionChanged

type C_WidgetDirectionChangedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDirectionChangedCallback Source #

Arguments

 = TextDirection

previousDirection: the previous text direction of widget

-> IO () 

The directionChanged signal is emitted when the text direction of a widget changes.

afterWidgetDirectionChanged :: (IsWidget a, MonadIO m) => a -> WidgetDirectionChangedCallback -> m SignalHandlerId Source #

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

after widget #directionChanged callback

onWidgetDirectionChanged :: (IsWidget a, MonadIO m) => a -> WidgetDirectionChangedCallback -> m SignalHandlerId Source #

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

on widget #directionChanged callback

dragBegin

type C_WidgetDragBeginCallback = Ptr () -> Ptr DragContext -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragBeginCallback Source #

Arguments

 = DragContext

context: the drag context

-> IO () 

The dragBegin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g. widgetDragSourceSetIconPixbuf.

Note that some widgets set up a drag icon in the default handler of this signal, so you may have to use g_signal_connect_after() to override what the default handler did.

afterWidgetDragBegin :: (IsWidget a, MonadIO m) => a -> WidgetDragBeginCallback -> m SignalHandlerId Source #

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

after widget #dragBegin callback

onWidgetDragBegin :: (IsWidget a, MonadIO m) => a -> WidgetDragBeginCallback -> m SignalHandlerId Source #

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

on widget #dragBegin callback

dragDataDelete

type C_WidgetDragDataDeleteCallback = Ptr () -> Ptr DragContext -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragDataDeleteCallback Source #

Arguments

 = DragContext

context: the drag context

-> IO () 

The dragDataDelete signal is emitted on the drag source when a drag with the action DragActionMove is successfully completed. The signal handler is responsible for deleting the data that has been dropped. What "delete" means depends on the context of the drag operation.

afterWidgetDragDataDelete :: (IsWidget a, MonadIO m) => a -> WidgetDragDataDeleteCallback -> m SignalHandlerId Source #

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

after widget #dragDataDelete callback

onWidgetDragDataDelete :: (IsWidget a, MonadIO m) => a -> WidgetDragDataDeleteCallback -> m SignalHandlerId Source #

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

on widget #dragDataDelete callback

dragDataGet

type C_WidgetDragDataGetCallback = Ptr () -> Ptr DragContext -> Ptr SelectionData -> Word32 -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragDataGetCallback Source #

Arguments

 = DragContext

context: the drag context

-> SelectionData

data: the SelectionData to be filled with the dragged data

-> Word32

info: the info that has been registered with the target in the TargetList

-> Word32

time: the timestamp at which the data was requested

-> IO () 

The dragDataGet signal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to fill data with the data in the format which is indicated by info. See selectionDataSet and selectionDataSetText.

afterWidgetDragDataGet :: (IsWidget a, MonadIO m) => a -> WidgetDragDataGetCallback -> m SignalHandlerId Source #

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

after widget #dragDataGet callback

onWidgetDragDataGet :: (IsWidget a, MonadIO m) => a -> WidgetDragDataGetCallback -> m SignalHandlerId Source #

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

on widget #dragDataGet callback

dragDataReceived

type C_WidgetDragDataReceivedCallback = Ptr () -> Ptr DragContext -> Int32 -> Int32 -> Ptr SelectionData -> Word32 -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragDataReceivedCallback Source #

Arguments

 = DragContext

context: the drag context

-> Int32

x: where the drop happened

-> Int32

y: where the drop happened

-> SelectionData

data: the received data

-> Word32

info: the info that has been registered with the target in the TargetList

-> Word32

time: the timestamp at which the data was received

-> IO () 

The dragDataReceived signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call dragStatus and not finish the drag. If the data was received in response to a dragDrop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call dragFinish, setting the success parameter depending on whether the data was processed successfully.

Applications must create some means to determine why the signal was emitted and therefore whether to call dragStatus or dragFinish.

The handler may inspect the selected action with dragContextGetSelectedAction before calling dragFinish, e.g. to implement DragActionAsk as shown in the following example:

C code

void
drag_data_received (GtkWidget          *widget,
                    GdkDragContext     *context,
                    gint                x,
                    gint                y,
                    GtkSelectionData   *data,
                    guint               info,
                    guint               time)
{
  if ((data->length >= 0) && (data->format == 8))
    {
      GdkDragAction action;

      // handle data here

      action = gdk_drag_context_get_selected_action (context);
      if (action == GDK_ACTION_ASK)
        {
          GtkWidget *dialog;
          gint response;

          dialog = gtk_message_dialog_new (NULL,
                                           GTK_DIALOG_MODAL |
                                           GTK_DIALOG_DESTROY_WITH_PARENT,
                                           GTK_MESSAGE_INFO,
                                           GTK_BUTTONS_YES_NO,
                                           "Move the data ?\n");
          response = gtk_dialog_run (GTK_DIALOG (dialog));
          gtk_widget_destroy (dialog);

          if (response == GTK_RESPONSE_YES)
            action = GDK_ACTION_MOVE;
          else
            action = GDK_ACTION_COPY;
         }

      gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
    }
  else
    gtk_drag_finish (context, FALSE, FALSE, time);
 }

afterWidgetDragDataReceived :: (IsWidget a, MonadIO m) => a -> WidgetDragDataReceivedCallback -> m SignalHandlerId Source #

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

after widget #dragDataReceived callback

onWidgetDragDataReceived :: (IsWidget a, MonadIO m) => a -> WidgetDragDataReceivedCallback -> m SignalHandlerId Source #

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

on widget #dragDataReceived callback

dragDrop

type C_WidgetDragDropCallback = Ptr () -> Ptr DragContext -> Int32 -> Int32 -> Word32 -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragDropCallback Source #

Arguments

 = DragContext

context: the drag context

-> Int32

x: the x coordinate of the current cursor position

-> Int32

y: the y coordinate of the current cursor position

-> Word32

time: the timestamp of the motion event

-> IO Bool

Returns: whether the cursor position is in a drop zone

The dragDrop signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns False and no further processing is necessary. Otherwise, the handler returns True. In this case, the handler must ensure that dragFinish is called to let the source know that the drop is done. The call to dragFinish can be done either directly or in a dragDataReceived handler which gets triggered by calling widgetDragGetData to receive the data for one or more of the supported targets.

afterWidgetDragDrop :: (IsWidget a, MonadIO m) => a -> WidgetDragDropCallback -> m SignalHandlerId Source #

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

after widget #dragDrop callback

onWidgetDragDrop :: (IsWidget a, MonadIO m) => a -> WidgetDragDropCallback -> m SignalHandlerId Source #

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

on widget #dragDrop callback

dragEnd

type C_WidgetDragEndCallback = Ptr () -> Ptr DragContext -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragEndCallback Source #

Arguments

 = DragContext

context: the drag context

-> IO () 

The dragEnd signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in dragBegin.

afterWidgetDragEnd :: (IsWidget a, MonadIO m) => a -> WidgetDragEndCallback -> m SignalHandlerId Source #

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

after widget #dragEnd callback

mk_WidgetDragEndCallback :: C_WidgetDragEndCallback -> IO (FunPtr C_WidgetDragEndCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetDragEndCallback.

onWidgetDragEnd :: (IsWidget a, MonadIO m) => a -> WidgetDragEndCallback -> m SignalHandlerId Source #

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

on widget #dragEnd callback

dragFailed

type C_WidgetDragFailedCallback = Ptr () -> Ptr DragContext -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragFailedCallback Source #

Arguments

 = DragContext

context: the drag context

-> DragResult

result: the result of the drag operation

-> IO Bool

Returns: True if the failed drag operation has been already handled.

The dragFailed signal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DnD operation based on the type of error, it returns True is the failure has been already handled (not showing the default "drag operation failed" animation), otherwise it returns False.

Since: 2.12

afterWidgetDragFailed :: (IsWidget a, MonadIO m) => a -> WidgetDragFailedCallback -> m SignalHandlerId Source #

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

after widget #dragFailed callback

onWidgetDragFailed :: (IsWidget a, MonadIO m) => a -> WidgetDragFailedCallback -> m SignalHandlerId Source #

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

on widget #dragFailed callback

dragLeave

type C_WidgetDragLeaveCallback = Ptr () -> Ptr DragContext -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragLeaveCallback Source #

Arguments

 = DragContext

context: the drag context

-> Word32

time: the timestamp of the motion event

-> IO () 

The dragLeave signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in dragMotion, e.g. undo highlighting with widgetDragUnhighlight.

Likewise, the dragLeave signal is also emitted before the dragDrop signal, for instance to allow cleaning up of a preview item created in the dragMotion signal handler.

afterWidgetDragLeave :: (IsWidget a, MonadIO m) => a -> WidgetDragLeaveCallback -> m SignalHandlerId Source #

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

after widget #dragLeave callback

onWidgetDragLeave :: (IsWidget a, MonadIO m) => a -> WidgetDragLeaveCallback -> m SignalHandlerId Source #

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

on widget #dragLeave callback

dragMotion

type C_WidgetDragMotionCallback = Ptr () -> Ptr DragContext -> Int32 -> Int32 -> Word32 -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDragMotionCallback Source #

Arguments

 = DragContext

context: the drag context

-> Int32

x: the x coordinate of the current cursor position

-> Int32

y: the y coordinate of the current cursor position

-> Word32

time: the timestamp of the motion event

-> IO Bool

Returns: whether the cursor position is in a drop zone

The dragMotion signal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns False and no further processing is necessary. Otherwise, the handler returns True. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling dragStatus.

If the decision whether the drop will be accepted or rejected can't be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling widgetDragGetData and defer the dragStatus call to the dragDataReceived handler. Note that you must pass GTK_DEST_DEFAULT_DROP, GTK_DEST_DEFAULT_MOTION or GTK_DEST_DEFAULT_ALL to widgetDragDestSet when using the drag-motion signal that way.

Also note that there is no drag-enter signal. The drag receiver has to keep track of whether he has received any drag-motion signals since the last dragLeave and if not, treat the drag-motion signal as an "enter" signal. Upon an "enter", the handler will typically highlight the drop site with widgetDragHighlight.

C code

static void
drag_motion (GtkWidget      *widget,
             GdkDragContext *context,
             gint            x,
             gint            y,
             guint           time)
{
  GdkAtom target;

  PrivateData *private_data = GET_PRIVATE_DATA (widget);

  if (!private_data->drag_highlight)
   {
     private_data->drag_highlight = 1;
     gtk_drag_highlight (widget);
   }

  target = gtk_drag_dest_find_target (widget, context, NULL);
  if (target == GDK_NONE)
    gdk_drag_status (context, 0, time);
  else
   {
     private_data->pending_status
        = gdk_drag_context_get_suggested_action (context);
     gtk_drag_get_data (widget, context, target, time);
   }

  return TRUE;
}

static void
drag_data_received (GtkWidget        *widget,
                    GdkDragContext   *context,
                    gint              x,
                    gint              y,
                    GtkSelectionData *selection_data,
                    guint             info,
                    guint             time)
{
  PrivateData *private_data = GET_PRIVATE_DATA (widget);

  if (private_data->suggested_action)
   {
     private_data->suggested_action = 0;

     // We are getting this data due to a request in drag_motion,
     // rather than due to a request in drag_drop, so we are just
     // supposed to call gdk_drag_status(), not actually paste in
     // the data.

     str = gtk_selection_data_get_text (selection_data);
     if (!data_is_acceptable (str))
       gdk_drag_status (context, 0, time);
     else
       gdk_drag_status (context,
                        private_data->suggested_action,
                        time);
   }
  else
   {
     // accept the drop
   }
}

afterWidgetDragMotion :: (IsWidget a, MonadIO m) => a -> WidgetDragMotionCallback -> m SignalHandlerId Source #

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

after widget #dragMotion callback

onWidgetDragMotion :: (IsWidget a, MonadIO m) => a -> WidgetDragMotionCallback -> m SignalHandlerId Source #

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

on widget #dragMotion callback

draw

type C_WidgetDrawCallback = Ptr () -> Ptr Context -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetDrawCallback Source #

Arguments

 = Context

cr: the cairo context to draw to

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

This signal is emitted when a widget is supposed to render itself. The widget's top left corner must be painted at the origin of the passed in context and be sized to the values returned by widgetGetAllocatedWidth and widgetGetAllocatedHeight.

Signal handlers connected to this signal can modify the cairo context passed as cr in any way they like and don't need to restore it. The signal emission takes care of calling cairo_save() before and cairo_restore() after invoking the handler.

The signal handler will get a cr with a clip region already set to the widget's dirty region, i.e. to the area that needs repainting. Complicated widgets that want to avoid redrawing themselves completely can get the full extents of the clip region with cairoGetClipRectangle, or they can get a finer-grained representation of the dirty region with cairo_copy_clip_rectangle_list().

Since: 3.0

afterWidgetDraw :: (IsWidget a, MonadIO m) => a -> WidgetDrawCallback -> m SignalHandlerId Source #

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

after widget #draw callback

mk_WidgetDrawCallback :: C_WidgetDrawCallback -> IO (FunPtr C_WidgetDrawCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetDrawCallback.

onWidgetDraw :: (IsWidget a, MonadIO m) => a -> WidgetDrawCallback -> m SignalHandlerId Source #

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

on widget #draw callback

enterNotifyEvent

type C_WidgetEnterNotifyEventCallback = Ptr () -> Ptr EventCrossing -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetEnterNotifyEventCallback Source #

Arguments

 = EventCrossing

event: the EventCrossing which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The enterNotifyEvent will be emitted when the pointer enters the widget's window.

To receive this signal, the Window associated to the widget needs to enable the GDK_ENTER_NOTIFY_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetEnterNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetEnterNotifyEventCallback -> m SignalHandlerId Source #

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

after widget #enterNotifyEvent callback

onWidgetEnterNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetEnterNotifyEventCallback -> m SignalHandlerId Source #

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

on widget #enterNotifyEvent callback

event

type C_WidgetEventCallback = Ptr () -> Ptr Event -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetEventCallback Source #

Arguments

 = Event

event: the Event which triggered this signal

-> IO Bool

Returns: True to stop other handlers from being invoked for the event and to cancel the emission of the second specific event signal. False to propagate the event further and to allow the emission of the second signal. The eventAfter signal is emitted regardless of the return value.

The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic event signal, another, more specific, signal that matches the type of event delivered (e.g. keyPressEvent) and finally a generic eventAfter signal.

afterWidgetEvent :: (IsWidget a, MonadIO m) => a -> WidgetEventCallback -> m SignalHandlerId Source #

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

after widget #event callback

mk_WidgetEventCallback :: C_WidgetEventCallback -> IO (FunPtr C_WidgetEventCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetEventCallback.

onWidgetEvent :: (IsWidget a, MonadIO m) => a -> WidgetEventCallback -> m SignalHandlerId Source #

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

on widget #event callback

eventAfter

type C_WidgetEventAfterCallback = Ptr () -> Ptr Event -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetEventAfterCallback Source #

Arguments

 = Event

event: the Event which triggered this signal

-> IO () 

After the emission of the event signal and (optionally) the second more specific signal, eventAfter will be emitted regardless of the previous two signals handlers return values.

afterWidgetEventAfter :: (IsWidget a, MonadIO m) => a -> WidgetEventAfterCallback -> m SignalHandlerId Source #

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

after widget #eventAfter callback

onWidgetEventAfter :: (IsWidget a, MonadIO m) => a -> WidgetEventAfterCallback -> m SignalHandlerId Source #

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

on widget #eventAfter callback

focus

type C_WidgetFocusCallback = Ptr () -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetFocusCallback Source #

Arguments

 = DirectionType 
-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

No description available in the introspection data.

afterWidgetFocus :: (IsWidget a, MonadIO m) => a -> WidgetFocusCallback -> m SignalHandlerId Source #

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

after widget #focus callback

mk_WidgetFocusCallback :: C_WidgetFocusCallback -> IO (FunPtr C_WidgetFocusCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetFocusCallback.

onWidgetFocus :: (IsWidget a, MonadIO m) => a -> WidgetFocusCallback -> m SignalHandlerId Source #

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

on widget #focus callback

focusInEvent

type C_WidgetFocusInEventCallback = Ptr () -> Ptr EventFocus -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetFocusInEventCallback Source #

Arguments

 = EventFocus

event: the EventFocus which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The focusInEvent signal will be emitted when the keyboard focus enters the widget's window.

To receive this signal, the Window associated to the widget needs to enable the GDK_FOCUS_CHANGE_MASK mask.

afterWidgetFocusInEvent :: (IsWidget a, MonadIO m) => a -> WidgetFocusInEventCallback -> m SignalHandlerId Source #

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

after widget #focusInEvent callback

onWidgetFocusInEvent :: (IsWidget a, MonadIO m) => a -> WidgetFocusInEventCallback -> m SignalHandlerId Source #

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

on widget #focusInEvent callback

focusOutEvent

type C_WidgetFocusOutEventCallback = Ptr () -> Ptr EventFocus -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetFocusOutEventCallback Source #

Arguments

 = EventFocus

event: the EventFocus which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The focusOutEvent signal will be emitted when the keyboard focus leaves the widget's window.

To receive this signal, the Window associated to the widget needs to enable the GDK_FOCUS_CHANGE_MASK mask.

afterWidgetFocusOutEvent :: (IsWidget a, MonadIO m) => a -> WidgetFocusOutEventCallback -> m SignalHandlerId Source #

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

after widget #focusOutEvent callback

onWidgetFocusOutEvent :: (IsWidget a, MonadIO m) => a -> WidgetFocusOutEventCallback -> m SignalHandlerId Source #

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

on widget #focusOutEvent callback

grabBrokenEvent

type C_WidgetGrabBrokenEventCallback = Ptr () -> Ptr EventGrabBroken -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetGrabBrokenEventCallback Source #

Arguments

 = EventGrabBroken

event: the EventGrabBroken event

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Emitted when a pointer or keyboard grab on a window belonging to widget gets broken.

On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again.

Since: 2.8

afterWidgetGrabBrokenEvent :: (IsWidget a, MonadIO m) => a -> WidgetGrabBrokenEventCallback -> m SignalHandlerId Source #

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

after widget #grabBrokenEvent callback

onWidgetGrabBrokenEvent :: (IsWidget a, MonadIO m) => a -> WidgetGrabBrokenEventCallback -> m SignalHandlerId Source #

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

on widget #grabBrokenEvent callback

grabFocus

type C_WidgetGrabFocusCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetGrabFocusCallback = IO () Source #

No description available in the introspection data.

afterWidgetGrabFocus :: (IsWidget a, MonadIO m) => a -> WidgetGrabFocusCallback -> m SignalHandlerId Source #

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

after widget #grabFocus callback

onWidgetGrabFocus :: (IsWidget a, MonadIO m) => a -> WidgetGrabFocusCallback -> m SignalHandlerId Source #

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

on widget #grabFocus callback

grabNotify

type C_WidgetGrabNotifyCallback = Ptr () -> CInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetGrabNotifyCallback Source #

Arguments

 = Bool

wasGrabbed: False if the widget becomes shadowed, True if it becomes unshadowed

-> IO () 

The grabNotify signal is emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.

A widget is shadowed by a widgetGrabAdd when the topmost grab widget in the grab stack of its window group is not its ancestor.

afterWidgetGrabNotify :: (IsWidget a, MonadIO m) => a -> WidgetGrabNotifyCallback -> m SignalHandlerId Source #

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

after widget #grabNotify callback

onWidgetGrabNotify :: (IsWidget a, MonadIO m) => a -> WidgetGrabNotifyCallback -> m SignalHandlerId Source #

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

on widget #grabNotify callback

hide

type C_WidgetHideCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetHideCallback = IO () Source #

The hide signal is emitted when widget is hidden, for example with widgetHide.

afterWidgetHide :: (IsWidget a, MonadIO m) => a -> WidgetHideCallback -> m SignalHandlerId Source #

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

after widget #hide callback

mk_WidgetHideCallback :: C_WidgetHideCallback -> IO (FunPtr C_WidgetHideCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetHideCallback.

onWidgetHide :: (IsWidget a, MonadIO m) => a -> WidgetHideCallback -> m SignalHandlerId Source #

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

on widget #hide callback

hierarchyChanged

type C_WidgetHierarchyChangedCallback = Ptr () -> Ptr Widget -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetHierarchyChangedCallback Source #

Arguments

 = Maybe Widget

previousToplevel: the previous toplevel ancestor, or Nothing if the widget was previously unanchored

-> IO () 

The hierarchyChanged signal is emitted when the anchored state of a widget changes. A widget is “anchored” when its toplevel ancestor is a Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.

afterWidgetHierarchyChanged :: (IsWidget a, MonadIO m) => a -> WidgetHierarchyChangedCallback -> m SignalHandlerId Source #

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

after widget #hierarchyChanged callback

onWidgetHierarchyChanged :: (IsWidget a, MonadIO m) => a -> WidgetHierarchyChangedCallback -> m SignalHandlerId Source #

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

on widget #hierarchyChanged callback

keyPressEvent

type C_WidgetKeyPressEventCallback = Ptr () -> Ptr EventKey -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetKeyPressEventCallback Source #

Arguments

 = EventKey

event: the EventKey which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The keyPressEvent signal is emitted when a key is pressed. The signal emission will reoccur at the key-repeat rate when the key is kept pressed.

To receive this signal, the Window associated to the widget needs to enable the GDK_KEY_PRESS_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetKeyPressEvent :: (IsWidget a, MonadIO m) => a -> WidgetKeyPressEventCallback -> m SignalHandlerId Source #

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

after widget #keyPressEvent callback

onWidgetKeyPressEvent :: (IsWidget a, MonadIO m) => a -> WidgetKeyPressEventCallback -> m SignalHandlerId Source #

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

on widget #keyPressEvent callback

keyReleaseEvent

type C_WidgetKeyReleaseEventCallback = Ptr () -> Ptr EventKey -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetKeyReleaseEventCallback Source #

Arguments

 = EventKey

event: the EventKey which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The keyReleaseEvent signal is emitted when a key is released.

To receive this signal, the Window associated to the widget needs to enable the GDK_KEY_RELEASE_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetKeyReleaseEvent :: (IsWidget a, MonadIO m) => a -> WidgetKeyReleaseEventCallback -> m SignalHandlerId Source #

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

after widget #keyReleaseEvent callback

onWidgetKeyReleaseEvent :: (IsWidget a, MonadIO m) => a -> WidgetKeyReleaseEventCallback -> m SignalHandlerId Source #

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

on widget #keyReleaseEvent callback

keynavFailed

type C_WidgetKeynavFailedCallback = Ptr () -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetKeynavFailedCallback Source #

Arguments

 = DirectionType

direction: the direction of movement

-> IO Bool

Returns: True if stopping keyboard navigation is fine, False if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).

Gets emitted if keyboard navigation fails. See widgetKeynavFailed for details.

Since: 2.12

afterWidgetKeynavFailed :: (IsWidget a, MonadIO m) => a -> WidgetKeynavFailedCallback -> m SignalHandlerId Source #

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

after widget #keynavFailed callback

onWidgetKeynavFailed :: (IsWidget a, MonadIO m) => a -> WidgetKeynavFailedCallback -> m SignalHandlerId Source #

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

on widget #keynavFailed callback

leaveNotifyEvent

type C_WidgetLeaveNotifyEventCallback = Ptr () -> Ptr EventCrossing -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetLeaveNotifyEventCallback Source #

Arguments

 = EventCrossing

event: the EventCrossing which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The leaveNotifyEvent will be emitted when the pointer leaves the widget's window.

To receive this signal, the Window associated to the widget needs to enable the GDK_LEAVE_NOTIFY_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetLeaveNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetLeaveNotifyEventCallback -> m SignalHandlerId Source #

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

after widget #leaveNotifyEvent callback

onWidgetLeaveNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetLeaveNotifyEventCallback -> m SignalHandlerId Source #

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

on widget #leaveNotifyEvent callback

map

type C_WidgetMapCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetMapCallback = IO () Source #

The map signal is emitted when widget is going to be mapped, that is when the widget is visible (which is controlled with widgetSetVisible) and all its parents up to the toplevel widget are also visible. Once the map has occurred, mapEvent will be emitted.

The map signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of unmap.

afterWidgetMap :: (IsWidget a, MonadIO m) => a -> WidgetMapCallback -> m SignalHandlerId Source #

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

after widget #map callback

mk_WidgetMapCallback :: C_WidgetMapCallback -> IO (FunPtr C_WidgetMapCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetMapCallback.

onWidgetMap :: (IsWidget a, MonadIO m) => a -> WidgetMapCallback -> m SignalHandlerId Source #

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

on widget #map callback

mapEvent

type C_WidgetMapEventCallback = Ptr () -> Ptr EventAny -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetMapEventCallback Source #

Arguments

 = EventAny

event: the EventAny which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The mapEvent signal will be emitted when the widget's window is mapped. A window is mapped when it becomes visible on the screen.

To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

afterWidgetMapEvent :: (IsWidget a, MonadIO m) => a -> WidgetMapEventCallback -> m SignalHandlerId Source #

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

after widget #mapEvent callback

onWidgetMapEvent :: (IsWidget a, MonadIO m) => a -> WidgetMapEventCallback -> m SignalHandlerId Source #

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

on widget #mapEvent callback

mnemonicActivate

type C_WidgetMnemonicActivateCallback = Ptr () -> CInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetMnemonicActivateCallback Source #

Arguments

 = Bool

groupCycling: True if there are other widgets with the same mnemonic

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The default handler for this signal activates widget if groupCycling is False, or just makes widget grab focus if groupCycling is True.

afterWidgetMnemonicActivate :: (IsWidget a, MonadIO m) => a -> WidgetMnemonicActivateCallback -> m SignalHandlerId Source #

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

after widget #mnemonicActivate callback

onWidgetMnemonicActivate :: (IsWidget a, MonadIO m) => a -> WidgetMnemonicActivateCallback -> m SignalHandlerId Source #

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

on widget #mnemonicActivate callback

motionNotifyEvent

type C_WidgetMotionNotifyEventCallback = Ptr () -> Ptr EventMotion -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetMotionNotifyEventCallback Source #

Arguments

 = EventMotion

event: the EventMotion which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The motionNotifyEvent signal is emitted when the pointer moves over the widget's Window.

To receive this signal, the Window associated to the widget needs to enable the GDK_POINTER_MOTION_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetMotionNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetMotionNotifyEventCallback -> m SignalHandlerId Source #

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

after widget #motionNotifyEvent callback

onWidgetMotionNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetMotionNotifyEventCallback -> m SignalHandlerId Source #

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

on widget #motionNotifyEvent callback

moveFocus

type C_WidgetMoveFocusCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetMoveFocusCallback = DirectionType -> IO () Source #

No description available in the introspection data.

afterWidgetMoveFocus :: (IsWidget a, MonadIO m) => a -> WidgetMoveFocusCallback -> m SignalHandlerId Source #

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

after widget #moveFocus callback

onWidgetMoveFocus :: (IsWidget a, MonadIO m) => a -> WidgetMoveFocusCallback -> m SignalHandlerId Source #

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

on widget #moveFocus callback

parentSet

type C_WidgetParentSetCallback = Ptr () -> Ptr Widget -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetParentSetCallback Source #

Arguments

 = Maybe Widget

oldParent: the previous parent, or Nothing if the widget just got its initial parent.

-> IO () 

The parentSet signal is emitted when a new parent has been set on a widget.

afterWidgetParentSet :: (IsWidget a, MonadIO m) => a -> WidgetParentSetCallback -> m SignalHandlerId Source #

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

after widget #parentSet callback

onWidgetParentSet :: (IsWidget a, MonadIO m) => a -> WidgetParentSetCallback -> m SignalHandlerId Source #

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

on widget #parentSet callback

popupMenu

type C_WidgetPopupMenuCallback = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetPopupMenuCallback Source #

Arguments

 = IO Bool

Returns: True if a menu was activated

This signal gets emitted whenever a widget should pop up a context menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the Entry widget creates a menu with clipboard commands. See the [Popup Menu Migration Checklist][checklist-popup-menu] for an example of how to use this signal.

afterWidgetPopupMenu :: (IsWidget a, MonadIO m) => a -> WidgetPopupMenuCallback -> m SignalHandlerId Source #

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

after widget #popupMenu callback

onWidgetPopupMenu :: (IsWidget a, MonadIO m) => a -> WidgetPopupMenuCallback -> m SignalHandlerId Source #

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

on widget #popupMenu callback

propertyNotifyEvent

type C_WidgetPropertyNotifyEventCallback = Ptr () -> Ptr EventProperty -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetPropertyNotifyEventCallback Source #

Arguments

 = EventProperty

event: the EventProperty which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The propertyNotifyEvent signal will be emitted when a property on the widget's window has been changed or deleted.

To receive this signal, the Window associated to the widget needs to enable the GDK_PROPERTY_CHANGE_MASK mask.

afterWidgetPropertyNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetPropertyNotifyEventCallback -> m SignalHandlerId Source #

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

after widget #propertyNotifyEvent callback

onWidgetPropertyNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetPropertyNotifyEventCallback -> m SignalHandlerId Source #

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

on widget #propertyNotifyEvent callback

proximityInEvent

type C_WidgetProximityInEventCallback = Ptr () -> Ptr EventProximity -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetProximityInEventCallback Source #

Arguments

 = EventProximity

event: the EventProximity which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

To receive this signal the Window associated to the widget needs to enable the GDK_PROXIMITY_IN_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetProximityInEvent :: (IsWidget a, MonadIO m) => a -> WidgetProximityInEventCallback -> m SignalHandlerId Source #

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

after widget #proximityInEvent callback

onWidgetProximityInEvent :: (IsWidget a, MonadIO m) => a -> WidgetProximityInEventCallback -> m SignalHandlerId Source #

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

on widget #proximityInEvent callback

proximityOutEvent

type C_WidgetProximityOutEventCallback = Ptr () -> Ptr EventProximity -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetProximityOutEventCallback Source #

Arguments

 = EventProximity

event: the EventProximity which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

To receive this signal the Window associated to the widget needs to enable the GDK_PROXIMITY_OUT_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetProximityOutEvent :: (IsWidget a, MonadIO m) => a -> WidgetProximityOutEventCallback -> m SignalHandlerId Source #

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

after widget #proximityOutEvent callback

onWidgetProximityOutEvent :: (IsWidget a, MonadIO m) => a -> WidgetProximityOutEventCallback -> m SignalHandlerId Source #

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

on widget #proximityOutEvent callback

queryTooltip

type C_WidgetQueryTooltipCallback = Ptr () -> Int32 -> Int32 -> CInt -> Ptr Tooltip -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetQueryTooltipCallback Source #

Arguments

 = Int32

x: the x coordinate of the cursor position where the request has been emitted, relative to widget's left side

-> Int32

y: the y coordinate of the cursor position where the request has been emitted, relative to widget's top

-> Bool

keyboardMode: True if the tooltip was triggered using the keyboard

-> Tooltip

tooltip: a Tooltip

-> IO Bool

Returns: True if tooltip should be shown right now, False otherwise.

Emitted when Widget:has-tooltip is True and the hover timeout has expired with the cursor hovering "above" widget; or emitted when widget got focus in keyboard mode.

Using the given coordinates, the signal handler should determine whether a tooltip should be shown for widget. If this is the case True should be returned, False otherwise. Note that if keyboardMode is True, the values of x and y are undefined and should not be used.

The signal handler is free to manipulate tooltip with the therefore destined function calls.

Since: 2.12

afterWidgetQueryTooltip :: (IsWidget a, MonadIO m) => a -> WidgetQueryTooltipCallback -> m SignalHandlerId Source #

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

after widget #queryTooltip callback

onWidgetQueryTooltip :: (IsWidget a, MonadIO m) => a -> WidgetQueryTooltipCallback -> m SignalHandlerId Source #

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

on widget #queryTooltip callback

realize

type C_WidgetRealizeCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetRealizeCallback = IO () Source #

The realize signal is emitted when widget is associated with a Window, which means that widgetRealize has been called or the widget has been mapped (that is, it is going to be drawn).

afterWidgetRealize :: (IsWidget a, MonadIO m) => a -> WidgetRealizeCallback -> m SignalHandlerId Source #

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

after widget #realize callback

mk_WidgetRealizeCallback :: C_WidgetRealizeCallback -> IO (FunPtr C_WidgetRealizeCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetRealizeCallback.

onWidgetRealize :: (IsWidget a, MonadIO m) => a -> WidgetRealizeCallback -> m SignalHandlerId Source #

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

on widget #realize callback

screenChanged

type C_WidgetScreenChangedCallback = Ptr () -> Ptr Screen -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetScreenChangedCallback Source #

Arguments

 = Maybe Screen

previousScreen: the previous screen, or Nothing if the widget was not associated with a screen before

-> IO () 

The screenChanged signal gets emitted when the screen of a widget has changed.

afterWidgetScreenChanged :: (IsWidget a, MonadIO m) => a -> WidgetScreenChangedCallback -> m SignalHandlerId Source #

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

after widget #screenChanged callback

onWidgetScreenChanged :: (IsWidget a, MonadIO m) => a -> WidgetScreenChangedCallback -> m SignalHandlerId Source #

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

on widget #screenChanged callback

scrollEvent

type C_WidgetScrollEventCallback = Ptr () -> Ptr EventScroll -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetScrollEventCallback Source #

Arguments

 = EventScroll

event: the EventScroll which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The scrollEvent signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.

To receive this signal, the Window associated to the widget needs to enable the GDK_SCROLL_MASK mask.

This signal will be sent to the grab widget if there is one.

afterWidgetScrollEvent :: (IsWidget a, MonadIO m) => a -> WidgetScrollEventCallback -> m SignalHandlerId Source #

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

after widget #scrollEvent callback

onWidgetScrollEvent :: (IsWidget a, MonadIO m) => a -> WidgetScrollEventCallback -> m SignalHandlerId Source #

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

on widget #scrollEvent callback

selectionClearEvent

type C_WidgetSelectionClearEventCallback = Ptr () -> Ptr EventSelection -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetSelectionClearEventCallback Source #

Arguments

 = EventSelection

event: the EventSelection which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The selectionClearEvent signal will be emitted when the the widget's window has lost ownership of a selection.

afterWidgetSelectionClearEvent :: (IsWidget a, MonadIO m) => a -> WidgetSelectionClearEventCallback -> m SignalHandlerId Source #

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

after widget #selectionClearEvent callback

onWidgetSelectionClearEvent :: (IsWidget a, MonadIO m) => a -> WidgetSelectionClearEventCallback -> m SignalHandlerId Source #

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

on widget #selectionClearEvent callback

selectionGet

type C_WidgetSelectionGetCallback = Ptr () -> Ptr SelectionData -> Word32 -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetSelectionGetCallback = SelectionData -> Word32 -> Word32 -> IO () Source #

No description available in the introspection data.

afterWidgetSelectionGet :: (IsWidget a, MonadIO m) => a -> WidgetSelectionGetCallback -> m SignalHandlerId Source #

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

after widget #selectionGet callback

onWidgetSelectionGet :: (IsWidget a, MonadIO m) => a -> WidgetSelectionGetCallback -> m SignalHandlerId Source #

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

on widget #selectionGet callback

selectionNotifyEvent

type C_WidgetSelectionNotifyEventCallback = Ptr () -> Ptr EventSelection -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetSelectionNotifyEventCallback Source #

Arguments

 = EventSelection 
-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

No description available in the introspection data.

afterWidgetSelectionNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetSelectionNotifyEventCallback -> m SignalHandlerId Source #

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

after widget #selectionNotifyEvent callback

onWidgetSelectionNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetSelectionNotifyEventCallback -> m SignalHandlerId Source #

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

on widget #selectionNotifyEvent callback

selectionReceived

type C_WidgetSelectionReceivedCallback = Ptr () -> Ptr SelectionData -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetSelectionReceivedCallback = SelectionData -> Word32 -> IO () Source #

No description available in the introspection data.

afterWidgetSelectionReceived :: (IsWidget a, MonadIO m) => a -> WidgetSelectionReceivedCallback -> m SignalHandlerId Source #

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

after widget #selectionReceived callback

onWidgetSelectionReceived :: (IsWidget a, MonadIO m) => a -> WidgetSelectionReceivedCallback -> m SignalHandlerId Source #

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

on widget #selectionReceived callback

selectionRequestEvent

type C_WidgetSelectionRequestEventCallback = Ptr () -> Ptr EventSelection -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetSelectionRequestEventCallback Source #

Arguments

 = EventSelection

event: the EventSelection which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The selectionRequestEvent signal will be emitted when another client requests ownership of the selection owned by the widget's window.

afterWidgetSelectionRequestEvent :: (IsWidget a, MonadIO m) => a -> WidgetSelectionRequestEventCallback -> m SignalHandlerId Source #

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

after widget #selectionRequestEvent callback

onWidgetSelectionRequestEvent :: (IsWidget a, MonadIO m) => a -> WidgetSelectionRequestEventCallback -> m SignalHandlerId Source #

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

on widget #selectionRequestEvent callback

show

type C_WidgetShowCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetShowCallback = IO () Source #

The show signal is emitted when widget is shown, for example with widgetShow.

afterWidgetShow :: (IsWidget a, MonadIO m) => a -> WidgetShowCallback -> m SignalHandlerId Source #

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

after widget #show callback

mk_WidgetShowCallback :: C_WidgetShowCallback -> IO (FunPtr C_WidgetShowCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetShowCallback.

onWidgetShow :: (IsWidget a, MonadIO m) => a -> WidgetShowCallback -> m SignalHandlerId Source #

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

on widget #show callback

showHelp

type C_WidgetShowHelpCallback = Ptr () -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetShowHelpCallback Source #

Arguments

 = WidgetHelpType 
-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

No description available in the introspection data.

afterWidgetShowHelp :: (IsWidget a, MonadIO m) => a -> WidgetShowHelpCallback -> m SignalHandlerId Source #

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

after widget #showHelp callback

onWidgetShowHelp :: (IsWidget a, MonadIO m) => a -> WidgetShowHelpCallback -> m SignalHandlerId Source #

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

on widget #showHelp callback

sizeAllocate

type C_WidgetSizeAllocateCallback = Ptr () -> Ptr Rectangle -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetSizeAllocateCallback Source #

Arguments

 = Rectangle

allocation: the region which has been allocated to the widget.

-> IO () 

No description available in the introspection data.

afterWidgetSizeAllocate :: (IsWidget a, MonadIO m) => a -> WidgetSizeAllocateCallback -> m SignalHandlerId Source #

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

after widget #sizeAllocate callback

onWidgetSizeAllocate :: (IsWidget a, MonadIO m) => a -> WidgetSizeAllocateCallback -> m SignalHandlerId Source #

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

on widget #sizeAllocate callback

stateChanged

type C_WidgetStateChangedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetStateChangedCallback Source #

Arguments

 = StateType

state: the previous state

-> IO () 

Deprecated: (Since version 3.0)Use stateFlagsChanged instead.

The stateChanged signal is emitted when the widget state changes. See widgetGetState.

afterWidgetStateChanged :: (IsWidget a, MonadIO m) => a -> WidgetStateChangedCallback -> m SignalHandlerId Source #

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

after widget #stateChanged callback

onWidgetStateChanged :: (IsWidget a, MonadIO m) => a -> WidgetStateChangedCallback -> m SignalHandlerId Source #

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

on widget #stateChanged callback

stateFlagsChanged

type C_WidgetStateFlagsChangedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetStateFlagsChangedCallback Source #

Arguments

 = [StateFlags]

flags: The previous state flags.

-> IO () 

The stateFlagsChanged signal is emitted when the widget state changes, see widgetGetStateFlags.

Since: 3.0

afterWidgetStateFlagsChanged :: (IsWidget a, MonadIO m) => a -> WidgetStateFlagsChangedCallback -> m SignalHandlerId Source #

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

after widget #stateFlagsChanged callback

onWidgetStateFlagsChanged :: (IsWidget a, MonadIO m) => a -> WidgetStateFlagsChangedCallback -> m SignalHandlerId Source #

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

on widget #stateFlagsChanged callback

styleSet

type C_WidgetStyleSetCallback = Ptr () -> Ptr Style -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetStyleSetCallback Source #

Arguments

 = Maybe Style

previousStyle: the previous style, or Nothing if the widget just got its initial style

-> IO () 

Deprecated: (Since version 3.0)Use the styleUpdated signal

The styleSet signal is emitted when a new style has been set on a widget. Note that style-modifying functions like widgetModifyBase also cause this signal to be emitted.

Note that this signal is emitted for changes to the deprecated Style. To track changes to the StyleContext associated with a widget, use the styleUpdated signal.

afterWidgetStyleSet :: (IsWidget a, MonadIO m) => a -> WidgetStyleSetCallback -> m SignalHandlerId Source #

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

after widget #styleSet callback

onWidgetStyleSet :: (IsWidget a, MonadIO m) => a -> WidgetStyleSetCallback -> m SignalHandlerId Source #

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

on widget #styleSet callback

styleUpdated

type C_WidgetStyleUpdatedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetStyleUpdatedCallback = IO () Source #

The styleUpdated signal is a convenience signal that is emitted when the changed signal is emitted on the widget's associated StyleContext as returned by widgetGetStyleContext.

Note that style-modifying functions like widgetOverrideColor also cause this signal to be emitted.

Since: 3.0

afterWidgetStyleUpdated :: (IsWidget a, MonadIO m) => a -> WidgetStyleUpdatedCallback -> m SignalHandlerId Source #

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

after widget #styleUpdated callback

onWidgetStyleUpdated :: (IsWidget a, MonadIO m) => a -> WidgetStyleUpdatedCallback -> m SignalHandlerId Source #

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

on widget #styleUpdated callback

touchEvent

type C_WidgetTouchEventCallback = Ptr () -> Ptr Event -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetTouchEventCallback = Event -> IO Bool Source #

No description available in the introspection data.

afterWidgetTouchEvent :: (IsWidget a, MonadIO m) => a -> WidgetTouchEventCallback -> m SignalHandlerId Source #

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

after widget #touchEvent callback

onWidgetTouchEvent :: (IsWidget a, MonadIO m) => a -> WidgetTouchEventCallback -> m SignalHandlerId Source #

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

on widget #touchEvent callback

unmap

type C_WidgetUnmapCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetUnmapCallback = IO () Source #

The unmap signal is emitted when widget is going to be unmapped, which means that either it or any of its parents up to the toplevel widget have been set as hidden.

As unmap indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

afterWidgetUnmap :: (IsWidget a, MonadIO m) => a -> WidgetUnmapCallback -> m SignalHandlerId Source #

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

after widget #unmap callback

mk_WidgetUnmapCallback :: C_WidgetUnmapCallback -> IO (FunPtr C_WidgetUnmapCallback) Source #

Generate a function pointer callable from C code, from a C_WidgetUnmapCallback.

onWidgetUnmap :: (IsWidget a, MonadIO m) => a -> WidgetUnmapCallback -> m SignalHandlerId Source #

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

on widget #unmap callback

unmapEvent

type C_WidgetUnmapEventCallback = Ptr () -> Ptr EventAny -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetUnmapEventCallback Source #

Arguments

 = EventAny

event: the EventAny which triggered this signal

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The unmapEvent signal will be emitted when the widget's window is unmapped. A window is unmapped when it becomes invisible on the screen.

To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

afterWidgetUnmapEvent :: (IsWidget a, MonadIO m) => a -> WidgetUnmapEventCallback -> m SignalHandlerId Source #

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

after widget #unmapEvent callback

onWidgetUnmapEvent :: (IsWidget a, MonadIO m) => a -> WidgetUnmapEventCallback -> m SignalHandlerId Source #

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

on widget #unmapEvent callback

unrealize

type C_WidgetUnrealizeCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type WidgetUnrealizeCallback = IO () Source #

The unrealize signal is emitted when the Window associated with widget is destroyed, which means that widgetUnrealize has been called or the widget has been unmapped (that is, it is going to be hidden).

afterWidgetUnrealize :: (IsWidget a, MonadIO m) => a -> WidgetUnrealizeCallback -> m SignalHandlerId Source #

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

after widget #unrealize callback

onWidgetUnrealize :: (IsWidget a, MonadIO m) => a -> WidgetUnrealizeCallback -> m SignalHandlerId Source #

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

on widget #unrealize callback

visibilityNotifyEvent

type C_WidgetVisibilityNotifyEventCallback = Ptr () -> Ptr EventVisibility -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetVisibilityNotifyEventCallback Source #

Arguments

 = EventVisibility

event: the EventVisibility which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

Deprecated: (Since version 3.12)Modern composited windowing systems with pervasive transparency make it impossible to track the visibility of a window reliably, so this signal can not be guaranteed to provide useful information.

The visibilityNotifyEvent will be emitted when the widget's window is obscured or unobscured.

To receive this signal the Window associated to the widget needs to enable the GDK_VISIBILITY_NOTIFY_MASK mask.

afterWidgetVisibilityNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetVisibilityNotifyEventCallback -> m SignalHandlerId Source #

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

after widget #visibilityNotifyEvent callback

onWidgetVisibilityNotifyEvent :: (IsWidget a, MonadIO m) => a -> WidgetVisibilityNotifyEventCallback -> m SignalHandlerId Source #

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

on widget #visibilityNotifyEvent callback

windowStateEvent

type C_WidgetWindowStateEventCallback = Ptr () -> Ptr EventWindowState -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type WidgetWindowStateEventCallback Source #

Arguments

 = EventWindowState

event: the EventWindowState which triggered this signal.

-> IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

The windowStateEvent will be emitted when the state of the toplevel window associated to the widget changes.

To receive this signal the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

afterWidgetWindowStateEvent :: (IsWidget a, MonadIO m) => a -> WidgetWindowStateEventCallback -> m SignalHandlerId Source #

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

after widget #windowStateEvent callback

onWidgetWindowStateEvent :: (IsWidget a, MonadIO m) => a -> WidgetWindowStateEventCallback -> m SignalHandlerId Source #

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

on widget #windowStateEvent callback