GtkWidgetClass

struct GtkWidgetClass {}

Members

Variables

GtkReserved6
void function() GtkReserved6;
GtkReserved7
void function() GtkReserved7;
activateSignal
uint activateSignal;

The signal to emit when a widget of this class is activated, gtk.widget.Widget.activate handles the emission. Implementation of this signal is optional.

adjustBaselineAllocation
void function(GtkWidget* widget, int* baseline) adjustBaselineAllocation;
adjustBaselineRequest
void function(GtkWidget* widget, int* minimumBaseline, int* naturalBaseline) adjustBaselineRequest;
adjustSizeAllocation
void function(GtkWidget* widget, GtkOrientation orientation, int* minimumSize, int* naturalSize, int* allocatedPos, int* allocatedSize) adjustSizeAllocation;

Convert an initial size allocation assigned by a #GtkContainer using gtk.widget.Widget.sizeAllocate, into an actual size allocation to be used by the widget. adjust_size_allocation adjusts to a child widget’s actual allocation from what a parent container computed for the child. The adjusted allocation must be entirely within the original allocation. In any custom implementation, chain up to the default #GtkWidget implementation of this method, which applies the margin and alignment properties of #GtkWidget. Chain up before performing your own adjustments so your own adjustments remove more allocation after the #GtkWidget base class has already removed margin and alignment. The natural size passed in should be adjusted in the same way as the allocated size, which allows adjustments to perform alignments or other changes based on natural size.

adjustSizeRequest
void function(GtkWidget* widget, GtkOrientation orientation, int* minimumSize, int* naturalSize) adjustSizeRequest;

Convert an initial size request from a widget's #GtkSizeRequestMode virtual method implementations into a size request to be used by parent containers in laying out the widget. adjust_size_request adjusts from a child widget's original request to what a parent container should use for layout. The @for_size argument will be -1 if the request should not be for a particular size in the opposing orientation, i.e. if the request is not height-for-width or width-for-height. If @for_size is greater than -1, it is the proposed allocation in the opposing orientation that we need the request for. Implementations of adjust_size_request should chain up to the default implementation, which applies #GtkWidget’s margin properties and imposes any values from gtk.widget.Widget.setSizeRequest. Chaining up should be last, after your subclass adjusts the request, so #GtkWidget can apply constraints and add the margin properly.

buttonPressEvent
gboolean function(GtkWidget* widget, GdkEventButton* event) buttonPressEvent;

Signal will be emitted when a button (typically from a mouse) is pressed.

buttonReleaseEvent
gboolean function(GtkWidget* widget, GdkEventButton* event) buttonReleaseEvent;

Signal will be emitted when a button (typically from a mouse) is released.

canActivateAccel
gboolean function(GtkWidget* widget, uint signalId) canActivateAccel;

Signal allows applications and derived widgets to override the default GtkWidget handling for determining whether an accelerator can be activated.

childNotify
void function(GtkWidget* widget, GParamSpec* childProperty) childNotify;

Signal emitted for each child property that has changed on an object.

compositedChanged
void function(GtkWidget* widget) compositedChanged;

Signal emitted when the composited status of widgets screen changes. See gdk.screen.Screen.isComposited.

computeExpand
void function(GtkWidget* widget, gboolean* hexpandP, gboolean* vexpandP) computeExpand;

Computes whether a container should give this widget extra space when possible.

configureEvent
gboolean function(GtkWidget* widget, GdkEventConfigure* event) configureEvent;

Signal will be emitted when the size, position or stacking of the widget’s window has changed.

damageEvent
gboolean function(GtkWidget* widget, GdkEventExpose* event) damageEvent;

Signal emitted when a redirected window belonging to widget gets drawn into.

deleteEvent
gboolean function(GtkWidget* widget, GdkEventAny* event) deleteEvent;

Signal emitted if a user requests that a toplevel window is closed.

destroy
void function(GtkWidget* widget) destroy;

Signals that all holders of a reference to the widget should release the reference that they hold.

destroyEvent
gboolean function(GtkWidget* widget, GdkEventAny* event) destroyEvent;

Signal is emitted when a #GdkWindow is destroyed.

directionChanged
void function(GtkWidget* widget, GtkTextDirection previousDirection) directionChanged;

Signal emitted when the text direction of a widget changes.

dispatchChildPropertiesChanged
void function(GtkWidget* widget, uint nPspecs, GParamSpec** pspecs) dispatchChildPropertiesChanged;

Seldomly overidden.

dragBegin
void function(GtkWidget* widget, GdkDragContext* context) dragBegin;

Signal emitted on the drag source when a drag is started.

dragDataDelete
void function(GtkWidget* widget, GdkDragContext* context) dragDataDelete;

Signal emitted on the drag source when a drag with the action gdk.types.DragAction.Move is successfully completed.

dragDataGet
void function(GtkWidget* widget, GdkDragContext* context, GtkSelectionData* selectionData, uint info, uint time) dragDataGet;

Signal emitted on the drag source when the drop site requests the data which is dragged.

dragDataReceived
void function(GtkWidget* widget, GdkDragContext* context, int x, int y, GtkSelectionData* selectionData, uint info, uint time) dragDataReceived;

Signal emitted on the drop site when the dragged data has been received.

dragDrop
gboolean function(GtkWidget* widget, GdkDragContext* context, int x, int y, uint time) dragDrop;

Signal emitted on the drop site when the user drops the data onto the widget.

dragEnd
void function(GtkWidget* widget, GdkDragContext* context) dragEnd;

Signal emitted on the drag source when a drag is finished.

dragFailed
gboolean function(GtkWidget* widget, GdkDragContext* context, GtkDragResult result) dragFailed;

Signal emitted on the drag source when a drag has failed.

dragLeave
void function(GtkWidget* widget, GdkDragContext* context, uint time) dragLeave;

Signal emitted on the drop site when the cursor leaves the widget.

dragMotion
gboolean function(GtkWidget* widget, GdkDragContext* context, int x, int y, uint time) dragMotion;

signal emitted on the drop site when the user moves the cursor over the widget during a drag.

draw
gboolean function(GtkWidget* widget, cairo_t* cr) draw;

Signal emitted when a widget is supposed to render itself.

enterNotifyEvent
gboolean function(GtkWidget* widget, GdkEventCrossing* event) enterNotifyEvent;

Signal event will be emitted when the pointer enters the widget’s window.

event
gboolean function(GtkWidget* widget, GdkEvent* event) event;

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. "key-press-event") and finally a generic "event-after" signal.

focus
gboolean function(GtkWidget* widget, GtkDirectionType direction) focus;
focusInEvent
gboolean function(GtkWidget* widget, GdkEventFocus* event) focusInEvent;

Signal emitted when the keyboard focus enters the widget’s window.

focusOutEvent
gboolean function(GtkWidget* widget, GdkEventFocus* event) focusOutEvent;

Signal emitted when the keyboard focus leaves the widget’s window.

getAccessible
AtkObject* function(GtkWidget* widget) getAccessible;

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

getPreferredHeight
void function(GtkWidget* widget, int* minimumHeight, int* naturalHeight) getPreferredHeight;

This is called by containers to obtain the minimum and natural height of a widget. A widget that does not actually trade any height for width or width for height only has to implement these two virtual methods (#GtkWidgetClass.get_preferred_width() and #GtkWidgetClass.get_preferred_height()).

getPreferredHeightAndBaselineForWidth
void function(GtkWidget* widget, int width, int* minimumHeight, int* naturalHeight, int* minimumBaseline, int* naturalBaseline) getPreferredHeightAndBaselineForWidth;
getPreferredHeightForWidth
void function(GtkWidget* widget, int width, int* minimumHeight, int* naturalHeight) getPreferredHeightForWidth;

This is similar to #GtkWidgetClass.get_preferred_height() except that it is passed a contextual width to request height for. By implementing this virtual method it is possible for a #GtkLabel to tell its parent how much height would be required if the label were to be allocated a said width.

getPreferredWidth
void function(GtkWidget* widget, int* minimumWidth, int* naturalWidth) getPreferredWidth;

This is called by containers to obtain the minimum and natural width of a widget. A widget will never be allocated a width less than its minimum and will only ever be allocated a width greater than the natural width once all of the said widget’s siblings have received their natural widths. Furthermore, a widget will only ever be allocated a width greater than its natural width if it was configured to receive extra expand space from its parent container.

getPreferredWidthForHeight
void function(GtkWidget* widget, int height, int* minimumWidth, int* naturalWidth) getPreferredWidthForHeight;

This is analogous to #GtkWidgetClass.get_preferred_height_for_width() except that it operates in the oposite orientation. It’s rare that a widget actually does gtk.types.SizeRequestMode.WidthForHeight requests but this can happen when, for example, a widget or container gets additional columns to compensate for a smaller allocated height.

getRequestMode
GtkSizeRequestMode function(GtkWidget* widget) getRequestMode;

This allows a widget to tell its parent container whether it prefers to be allocated in gtk.types.SizeRequestMode.HeightForWidth or gtk.types.SizeRequestMode.WidthForHeight mode. gtk.types.SizeRequestMode.HeightForWidth means the widget prefers to have #GtkWidgetClass.get_preferred_width() called and then #GtkWidgetClass.get_preferred_height_for_width(). gtk.types.SizeRequestMode.ConstantSize disables any height-for-width or width-for-height geometry management for a said widget and is the default return. It’s important to note (as described below) that any widget which trades height-for-width or width-for-height must respond properly to both of the virtual methods #GtkWidgetClass.get_preferred_height_for_width() and #GtkWidgetClass.get_preferred_width_for_height() since it might be queried in either #GtkSizeRequestMode by its parent container.

grabBrokenEvent
gboolean function(GtkWidget* widget, GdkEventGrabBroken* event) grabBrokenEvent;

Signal emitted when a pointer or keyboard grab on a window belonging to widget gets broken.

grabFocus
void function(GtkWidget* widget) grabFocus;

Causes @widget to have the keyboard focus for the #GtkWindow it’s inside.

grabNotify
void function(GtkWidget* widget, gboolean wasGrabbed) grabNotify;

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

hide
void function(GtkWidget* widget) hide;

Signal emitted when widget is hidden.

hierarchyChanged
void function(GtkWidget* widget, GtkWidget* previousToplevel) hierarchyChanged;

Signal emitted when the anchored state of a widget changes.

keyPressEvent
gboolean function(GtkWidget* widget, GdkEventKey* event) keyPressEvent;

Signal emitted when a key is pressed.

keyReleaseEvent
gboolean function(GtkWidget* widget, GdkEventKey* event) keyReleaseEvent;

Signal is emitted when a key is released.

keynavFailed
gboolean function(GtkWidget* widget, GtkDirectionType direction) keynavFailed;

Signal emitted if keyboard navigation fails.

leaveNotifyEvent
gboolean function(GtkWidget* widget, GdkEventCrossing* event) leaveNotifyEvent;

Will be emitted when the pointer leaves the widget’s window.

map
void function(GtkWidget* widget) map;

Signal emitted when widget is going to be mapped, that is when the widget is visible (which is controlled with gtk.widget.Widget.setVisible) and all its parents up to the toplevel widget are also visible.

mapEvent
gboolean function(GtkWidget* widget, GdkEventAny* event) mapEvent;

Signal emitted when the widget’s window is mapped.

mnemonicActivate
gboolean function(GtkWidget* widget, gboolean groupCycling) mnemonicActivate;

Activates the @widget if @group_cycling is false, and just grabs the focus if @group_cycling is true.

motionNotifyEvent
gboolean function(GtkWidget* widget, GdkEventMotion* event) motionNotifyEvent;

Signal emitted when the pointer moves over the widget’s #GdkWindow.

moveFocus
void function(GtkWidget* widget, GtkDirectionType direction) moveFocus;

Signal emitted when a change of focus is requested

parentClass
GInitiallyUnownedClass parentClass;

The object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly. This allows a GtkWidgetClass pointer to be cast to a GObjectClass pointer.

parentSet
void function(GtkWidget* widget, GtkWidget* previousParent) parentSet;

Signal emitted when a new parent has been set on a widget.

popupMenu
gboolean function(GtkWidget* widget) popupMenu;

Signal emitted whenever a widget should pop up a context menu.

priv
GtkWidgetClassPrivate* priv;
propertyNotifyEvent
gboolean function(GtkWidget* widget, GdkEventProperty* event) propertyNotifyEvent;

Signal will be emitted when a property on the widget’s window has been changed or deleted.

proximityInEvent
gboolean function(GtkWidget* widget, GdkEventProximity* event) proximityInEvent;
proximityOutEvent
gboolean function(GtkWidget* widget, GdkEventProximity* event) proximityOutEvent;
queryTooltip
gboolean function(GtkWidget* widget, int x, int y, gboolean keyboardTooltip, GtkTooltip* tooltip) queryTooltip;

Signal emitted when “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.

queueDrawRegion
void function(GtkWidget* widget, const(cairo_region_t)* region) queueDrawRegion;

Invalidates the area of widget defined by region by calling gdk.window.Window.invalidateRegion on the widget's window and all its child windows.

realize
void function(GtkWidget* widget) realize;

Signal emitted when widget is associated with a #GdkWindow, which means that gtk.widget.Widget.realize has been called or the widget has been mapped (that is, it is going to be drawn).

screenChanged
void function(GtkWidget* widget, GdkScreen* previousScreen) screenChanged;

Signal emitted when the screen of a widget has changed.

scrollEvent
gboolean function(GtkWidget* widget, GdkEventScroll* event) scrollEvent;

Signal emitted when a button in the 4 to 7 range is pressed.

selectionClearEvent
gboolean function(GtkWidget* widget, GdkEventSelection* event) selectionClearEvent;

Signal will be emitted when the the widget’s window has lost ownership of a selection.

selectionGet
void function(GtkWidget* widget, GtkSelectionData* selectionData, uint info, uint time) selectionGet;
selectionNotifyEvent
gboolean function(GtkWidget* widget, GdkEventSelection* event) selectionNotifyEvent;
selectionReceived
void function(GtkWidget* widget, GtkSelectionData* selectionData, uint time) selectionReceived;
selectionRequestEvent
gboolean function(GtkWidget* widget, GdkEventSelection* event) selectionRequestEvent;

Signal will be emitted when another client requests ownership of the selection owned by the widget's window.

show
void function(GtkWidget* widget) show;

Signal emitted when widget is shown

showAll
void function(GtkWidget* widget) showAll;

Recursively shows a widget, and any child widgets (if the widget is a container).

showHelp
gboolean function(GtkWidget* widget, GtkWidgetHelpType helpType) showHelp;
sizeAllocate
void function(GtkWidget* widget, GtkAllocation* allocation) sizeAllocate;

Signal emitted to get the widget allocation.

stateChanged
void function(GtkWidget* widget, GtkStateType previousState) stateChanged;

Signal emitted when the widget state changes. Deprecated: 3.0

stateFlagsChanged
void function(GtkWidget* widget, GtkStateFlags previousStateFlags) stateFlagsChanged;

Signal emitted when the widget state changes, see gtk.widget.Widget.getStateFlags.

styleSet
void function(GtkWidget* widget, GtkStyle* previousStyle) styleSet;

Signal emitted when a new style has been set on a widget. Deprecated: 3.0

styleUpdated
void function(GtkWidget* widget) styleUpdated;

Signal emitted when the GtkStyleContext of a widget is changed.

touchEvent
gboolean function(GtkWidget* widget, GdkEventTouch* event) touchEvent;

Signal emitted when a touch event happens

unmap
void function(GtkWidget* widget) unmap;

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

unmapEvent
gboolean function(GtkWidget* widget, GdkEventAny* event) unmapEvent;

Signal will be emitted when the widget’s window is unmapped.

unrealize
void function(GtkWidget* widget) unrealize;

Signal emitted when the GdkWindow associated with widget is destroyed, which means that gtk.widget.Widget.unrealize has been called or the widget has been unmapped (that is, it is going to be hidden).

visibilityNotifyEvent
gboolean function(GtkWidget* widget, GdkEventVisibility* event) visibilityNotifyEvent;

Signal emitted when the widget’s window is obscured or unobscured.

windowStateEvent
gboolean function(GtkWidget* widget, GdkEventWindowState* event) windowStateEvent;

Signal emitted when the state of the toplevel window associated to the widget changes.