Package: gtk

Function gtk-widget-preferred-width

Lambda List

gtk-widget-preferred-width (widget)

Arguments

widget -- a gtk-widget object

Return Value

minimum-width -- an integer with the minimum width, or nil
natural-width -- an integer with the natural width, or nil

Details

Retrieves an initial minimum and natural width of the widget.

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

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any gtk-size-group objects 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.

Example

(setq widget (make-instance 'gtk-button :label "Hello"))
=> #<GTK-BUTTON {B1D0079}>
(gtk-widget-preferred-width widget)
=> 49
=> 49

(setq widget (make-instance 'gtk-button :label "Hello, more text")) => #<GTK-BUTTON {B1D60E9}> (gtk-widget-preferred-width widget) => 123 => 123
 

See also

2021-9-20