Package: gtk

CStruct gtk:widget-class

Declaration

(cffi:defcstruct widget-class
  ;; Parent class
  (:parent-class (:struct gobject:object-class))
  ;; Virtual functions
  (show :pointer)
  (hide :pointer)
  (map :pointer)
  (unmap :pointer)
  (realize :pointer)
  (unrealize :pointer)
  (root :pointer)
  (unroot :pointer)
  (size-allocate :pointer)
  (state-flags-changed :pointer)
  (direcion-changed :pointer)
  (get-request-mode :pointer)
  (measure :pointer)
  (mnemonic-activate :pointer)
  (grab-focus :pointer)
  (focus :pointer)
  (set-focus-child :pointer)
  (move-focus :pointer)
  (keynav-failed :pointer)
  (query-tooltip :pointer)
  (compute-expand :pointer)
  (css-changed :pointer)
  (system-setting-changed :pointer)
  (snapshot :pointer)
  (contains :pointer)
  ;; Private
  (priv :pointer)
  (padding :pointer :count 8))  

Values

parent-class
The object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly.
show
Signal emitted when the widget is shown.
hide
Signal emitted when the widget is hidden.
map
Signal emitted when the widget is going to be mapped, that is when the widget is visible, which is controlled with the gtk:widget-visible function and all its parents up to the toplevel widget are also visible.
unmap
Signal emitted when the 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.
realize
Signal emitted when the widget is associated with a gdk:surface object, which means that the gtk:widget-realize function has been called or the widget has been mapped, that is, it is going to be drawn.
unrealize
Signal emitted when the gdk:surface object associated with the widget is destroyed, which means that the gtk:widget-unrealize function has been called or the widget has been unmapped, that is, it is going to be hidden.
root
Called when the widget gets added to a gtk:root widget. Must chain up.
unroot
Called when the widget is about to be removed from its gtk:root widget. Must chain up.
size-allocate
Called to set the allocation, if the widget does not have a layout manager.
state-flags-changed
Signal emitted when the widget state changes, see the gtk:widget-state-flags function.
direction-changed
Signal emitted when the text direction of a widget changes.
get-request-mode
Called to get the request mode, if the widget does not have a layout manager. This allows a widget to tell its parent container whether it prefers to be allocated in :height-for-width or :width-for-height mode. The :height-for-width value means the widget prefers to have GtkWidgetClass.measure() called first to get the default width (passing a for-size of -1), then again to get the height for said default width. The :constant-size value disables any height-for-width or width-for-height geometry management for said widget and is the default return. It is important to note that any widget which trades height-for-width or width-for-height must respond properly to a for-size value >= -1 passed to GtkWidgetClass.measure, for both possible orientations.
measure
Called to obtain the minimum and natural size of the widget, if the widget does not have a layout manager. Depending on the orientation parameter, the passed for-size can be interpreted as width or height. A widget will never be allocated less than its minimum size.
mnemonic-activate
Activates the widget if cycling is false, and just grabs the focus if cycling is true.
grab-focus
Causes the widget to have the keyboard focus for the GtkWindow it is inside.
focus
Virtual function for the gtk:widget-child-focus function.
set-focus-child
Sets the focused child of the widget. Must chain up.
move-focus
Signal emitted when a change of focus is requested.
keynav-failed
Signal emitted if keyboard navigation fails.
query-tooltip
Signal emitted when the 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.
compute-expand
Computes whether a container should give the widget extra space when possible.
css-changed
Called when the CSS used by the widget was changed. Widgets should then discard their caches that depend on CSS and queue resizes or redraws accordingly. The default implementation will take care of this for all the default CSS properties, so implementations must chain up.
system-setting-changed
Emitted when a system setting was changed. Must chain up.
snapshot
Called when a new snapshot of the widget has to be taken.
contains
Virtual function for the gtk:widget-contains function.

Details

The class structure for the gtk:widget class. The main purpose for the Lisp API user is to use the size of the gtk:widget-class structure and the documentation to implement virtual function tables for subclasses of the gtk:widget class.
 

See also

2025-10-22