GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.gtk.org — Gtk.Widget Description [src]
The base class for all widgets. It manages the widget lifecycle, layout, states and style. Minimum and natural sizeIn order to understand geometry management of widgets in GTK, it is helpful to understand the different terminology surrounding sizing of widgets. The two primary terms are: minimum size and natural size. As a general rule: the minimum size is the size required to display the minimum amount of content in a widget. A widget cannot be allocated less than the minimum size it requires. The natural size is the amount of content that a widget prefers to display in normal conditions. A widget may be allocated more than the natural size it prefers, or less, depending on the layout management of its parent container. What to do when the widget is allocated a different size than the one it prefers is entirely left to the widget implementation: some widgets decide to add extra room, other widgets may disclose additional content, other widgets may decide to hide content, or show a different layout entirely. Height-for-width Geometry ManagementGTK 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 two virtual methods: There are some important things to keep in mind when implementing height-for-width and when using it in widget implementations. If you implement a direct 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 For example, when queried in the normal First, the default minimum and natural width for each widget
in the interface will be computed using 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 If a widget does move content around to intelligently use up the
allocated size then it must support the request in both
For instance, a Here are some examples of how a 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 in the code example above. It will not work to use the wrapper function 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 widget, you must use 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 using baselines, and is inside a widget 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 also done by the
If a widget ends up baseline aligned it will be allocated all the space in
the parent as if it was GtkWidget as GtkBuildableThe If the widget uses a
Building composite widgets from template XML
To create composite widgets with The interface description semantics expected in composite template descriptions
is slightly different from regular Unlike regular interface descriptions, The XML which is contained inside the Additionally, Since, unlike the Here is an example of a template definition, which includes an example of
this in the Typically, you’ll place the template fragment into a file that is
bundled with your project, using You will also need to call as well as calling You can access widgets defined in the template using the
You can also use Descendants
Instance methodsgtk_widget_action_set_enabledEnables or disables an action installed with
gtk_widget_add_tick_callbackQueues an animation frame update and adds a callback to be called before each frame. gtk_widget_allocateAssigns size, position, (optionally) a baseline and transform to a child widget. gtk_widget_child_focusCalled by widgets as the user moves around the window using keyboard shortcuts. gtk_widget_compute_expandComputes whether a parent widget should give this widget extra space when possible. gtk_widget_compute_pointTranslates the given gtk_widget_compute_transformComputes a matrix suitable to describe a transformation from
gtk_widget_get_allocated_baselineReturns the baseline that has currently been allocated to the widget. deprecated: 4.12 gtk_widget_get_allocated_heightReturns the height that has currently been allocated to the widget. deprecated: 4.12 gtk_widget_get_allocated_widthReturns the width that has currently been allocated to the widget. deprecated: 4.12 gtk_widget_get_baselineReturns the baseline that has currently been allocated to the widget. since: 4.12 gtk_widget_get_can_focusDetermines whether the input focus can enter the widget or any of its children. gtk_widget_get_focus_on_clickReturns whether the widget should grab focus when it is clicked with the mouse. gtk_widget_get_preferred_sizeRetrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management. gtk_widget_get_receives_defaultDetermines whether the widget is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default. gtk_widget_get_request_modeGets whether the widget prefers a height-for-width layout or a width-for-height layout. gtk_widget_get_scale_factorRetrieves the internal scale factor that maps from window coordinates to the actual device pixels. gtk_widget_get_template_childFetches an object build from the template XML for gtk_widget_has_defaultDetermines whether the widget is the current default widget within its toplevel. gtk_widget_has_visible_focusDetermines if the widget should show a visible indication that it has the global input focus. gtk_widget_list_mnemonic_labelsReturns the widgets for which this widget is the target of a mnemonic. gtk_widget_queue_allocateFlags the widget for a rerun of the gtk_widget_remove_tick_callbackRemoves a tick callback previously registered with
gtk_widget_set_cursor_from_nameSets the cursor to be shown when the pointer hovers over the widget. gtk_widget_set_focus_on_clickSets whether the widget should grab focus when it is clicked with the mouse. gtk_widget_set_font_optionsSets the deprecated: 4.16 gtk_widget_set_layout_managerSets the layout manager to use for measuring and allocating children of the widget. gtk_widget_set_limit_eventsSets whether the widget acts like a modal dialog, with respect to event delivery. since: 4.18 gtk_widget_set_overflowSets how the widget treats content that is drawn outside the it’s content area. gtk_widget_set_receives_defaultSets whether the widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default. gtk_widget_should_layoutReturns whether the widget should contribute to the measuring and allocation of its parent. gtk_widget_size_allocateAllocates widget with a transformation that translates
the origin to the position in gtk_widget_translate_coordinatesTranslates coordinates relative to deprecated: 4.12 Methods inherited from GObject (43)Please see GObject for a full list of methods. Methods inherited from GtkAccessible (21)gtk_accessible_announceRequests the user’s screen reader to announce the given message. since: 4.14 gtk_accessible_get_accessible_idRetrieves the accessible identifier for the accessible object. since: 4.22 gtk_accessible_get_accessible_parentRetrieves the accessible parent for an accessible object. since: 4.10 gtk_accessible_get_accessible_roleRetrieves the accessible role of an accessible object. gtk_accessible_get_at_contextRetrieves the implementation for the given accessible object. since: 4.10 gtk_accessible_get_boundsQueries the coordinates and dimensions of this accessible. since: 4.10 gtk_accessible_get_first_accessible_childRetrieves the first accessible child of an accessible object. since: 4.10 gtk_accessible_get_next_accessible_siblingRetrieves the next accessible sibling of an accessible object. since: 4.10 gtk_accessible_get_platform_stateQueries a platform state, such as focus. since: 4.10 gtk_accessible_reset_propertyResets the accessible property to its default value. gtk_accessible_reset_relationResets the accessible relation to its default value. gtk_accessible_reset_stateResets the accessible state to its default value. gtk_accessible_set_accessible_parentSets the parent and sibling of an accessible object. since: 4.10 gtk_accessible_update_next_accessible_siblingUpdates the next accessible sibling. since: 4.10 gtk_accessible_update_platform_stateInforms ATs that the platform state has changed. since: 4.18 gtk_accessible_update_propertyUpdates a list of accessible properties. gtk_accessible_update_property_valueUpdates an array of accessible properties. gtk_accessible_update_relationUpdates a list of accessible relations. gtk_accessible_update_relation_valueUpdates an array of accessible relations. gtk_accessible_update_stateUpdates a list of accessible states. gtk_accessible_update_state_valueUpdates an array of accessible states. Methods inherited from GtkBuildable (1)PropertiesGtk.Widget:has-tooltipEnables or disables the emission of the Gtk.Widget:layout-managerThe Gtk.Widget:limit-eventsMakes this widget act like a modal dialog, with respect to event delivery. since: 4.18 Gtk.Widget:tooltip-markupSets the text of tooltip to be the given string, which is marked up with Pango markup. Properties inherited from GtkAccessible (1)SignalsGtk.Widget::destroySignals that all holders of a reference to the widget should release the reference that they hold. Signals inherited from GObject (1)GObject::notifyThe notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al. Class structure
No description available. Class members
Virtual methodsGtk.WidgetClass.compute_expandComputes whether a container should give this widget extra space when possible. Gtk.WidgetClass.css_changedVfunc called when the CSS used by 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. Gtk.WidgetClass.get_request_modeGets whether the widget prefers a height-for-width layout or a width-for-height layout. Gtk.WidgetClass.grab_focusCauses Gtk.WidgetClass.query_tooltipSignal emitted when “has-tooltip” is Gtk.WidgetClass.size_allocateCalled to set the allocation, if the widget does not have a layout manager. Gtk.WidgetClass.state_flags_changedSignal emitted when the widget state changes, see gtk_widget_get_state_flags(). Gtk.WidgetClass.unrootCalled when the widget is about to be removed from its
Class methodsgtk_widget_class_add_bindingCreates a new shortcut for gtk_widget_class_add_binding_actionCreates a new shortcut for gtk_widget_class_add_binding_signalCreates a new shortcut for gtk_widget_class_bind_template_callback_fullAssociates a name to be used in GtkBuilder XML with a symbol. gtk_widget_class_bind_template_child_fullAssigns an object declared in the class template XML to be set to
a location on a freshly built instance’s private data, or
alternatively accessible via gtk_widget_class_get_layout_manager_typeRetrieves the type of the gtk_widget_class_install_property_actionInstalls an action called gtk_widget_class_query_actionReturns details about an action that has been
installed for gtk_widget_class_set_layout_manager_typeSets the type to be used for creating layout managers for
widgets of gtk_widget_class_set_templateThis should be called at class initialization time to specify
the gtk_widget_class_set_template_from_resourceA convenience function that calls gtk_widget_class_set_template_scopeOverrides the default scope to be used when parsing the class template. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |