Whether or not the widget is double buffered.
Setting the ::fixed-height-mode property to %TRUE speeds up #GtkTreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
Enables or disables the emission of #GtkWidget::query-tooltip on widget
.
A value of %TRUE indicates that widget
can have a tooltip, in this case
the widget will be queried using #GtkWidget::query-tooltip 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.
Enables of disables the hover expansion mode of tree_view
.
Hover expansion makes rows expand or collapse if the pointer moves
over them.
This mode is primarily intended for treeviews in popups, e.g. in #GtkComboBox or #GtkEntryCompletion.
Enables of disables the hover selection mode of tree_view
.
Hover selection makes the selected row follow the pointer.
Currently, this works only for the selection modes
%GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.
This mode is primarily intended for treeviews in popups, e.g. in #GtkComboBox or #GtkEntryCompletion.
Extra indentation for each level.
%TRUE if the view has expanders.
Sets the text of tooltip to be the given string, which is marked up with the Pango text markup language. Also see gtk_tooltip_set_markup().
This is a convenience property which will take care of getting the tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip will automatically be set to %TRUE and there will be taken care of #GtkWidget::query-tooltip in the default signal handler.
Sets the text of tooltip to be the given string.
Also see gtk_tooltip_set_text().
This is a convenience property which will take care of getting the tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip will automatically be set to %TRUE and there will be taken care of #GtkWidget::query-tooltip in the default signal handler.
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.
Adds widget
to container
. Typically used for simple containers
such as #GtkWindow, #GtkFrame, or #GtkButton; for more complicated
layout containers such as #GtkBox or #GtkTable, this function will
pick default packing parameters that may not be correct. So
consider functions such as gtk_box_pack_start() and
gtk_table_attach() as an alternative to gtk_container_add() in
those cases. A widget may be added to only one container at a time;
you can't place the same widget inside two different containers.
Installs an accelerator for this widget
in accel_group
that causes
accel_signal
to be emitted if the accelerator is activated.
The accel_group
needs to be added to the widget's toplevel via
gtk_window_add_accel_group(), and the signal must be of type %G_RUN_ACTION.
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 gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
gtk_menu_item_set_accel_path() instead.
widget signal to emit on accelerator activation
accel group for this widget, added to its toplevel
GDK keyval of the accelerator
modifier key combination of the accelerator
flag accelerators, e.g. %GTK_ACCEL_VISIBLE
Adds the events in the bitfield events
to the event mask for
widget
. See gtk_widget_set_events() for details.
an event mask, see #GdkEventMask
Adds a widget to the list of mnemonic labels for this widget. (See gtk_widget_list_mnemonic_labels()). 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 #GtkWidget::destroy signal or a weak notifier.
Appends column
to the list of columns. If tree_view
has "fixed_height"
mode enabled, then column
must have its "sizing" property set to be
GTK_TREE_VIEW_COLUMN_FIXED.
The #GtkTreeViewColumn to add.
Creates a binding between source_property
on source
and target_property
on target
.
Whenever the source_property
is changed the target_property
is
updated using the same value. For instance:
g_object_bind_property (action, "active", widget, "sensitive", 0);
Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.
If flags
contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
if target_property
on target
changes then the source_property
on source
will be updated as well.
The binding will automatically be removed when either the source
or the
target
instances are finalized. To remove the binding without affecting the
source
and the target
you can just call g_object_unref() on the returned
#GBinding instance.
Removing the binding by calling g_object_unref() on it must only be done if
the binding, source
and target
are only used from a single thread and it
is clear that both source
and target
outlive the binding. Especially it
is not safe to rely on this if the binding, source
or target
can be
finalized from different threads. Keep another reference to the binding and
use g_binding_unbind() instead to be on the safe side.
A #GObject can have multiple bindings.
the property on source
to bind
the target #GObject
the property on target
to bind
flags to pass to #GBinding
Creates a binding between source_property
on source
and target_property
on target,
allowing you to set the transformation functions to be used by
the binding.
This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.
the property on source
to bind
the target #GObject
the property on target
to bind
flags to pass to #GBinding
a #GClosure wrapping the transformation function from the source
to the target,
or %NULL to use the default
a #GClosure wrapping the transformation function from the target
to the source,
or %NULL to use the default
Determines whether an accelerator that activates the signal
identified by signal_id
can currently be activated.
This is done by emitting the #GtkWidget::can-activate-accel
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.
the ID of a signal installed on widget
This function is used by custom widget implementations; if you're writing an app, you'd use gtk_widget_grab_focus() to move the focus to a particular widget, and gtk_container_set_focus_chain() to change the focus tab order. So you may want to investigate those functions instead.
gtk_widget_child_focus() 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). gtk_widget_child_focus() emits the
#GtkWidget::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 gtk_widget_grab_focus() to place the focus accordingly;
if returning %FALSE, they don't modify the current focus location.
This function replaces gtk_container_focus() from GTK+ 1.2. It was necessary to check that the child was visible, sensitive, and focusable before calling gtk_container_focus(). gtk_widget_child_focus() returns %FALSE if the widget is not currently in a focusable state, so there's no need for those checks.
direction of focus movement
Emits a #GtkWidget::child-notify signal for the
child property `child_property` on `widget`.This is the analogue of g_object_notify() for child properties.
the name of a child property installed on the class of widget<
!-- -->'s parent
Returns the type of the children supported by the container.
Note that this may return %G_TYPE_NONE to indicate that no more children can be added, e.g. for a #GtkPaned which already has two children.
Same as gtk_widget_path(), but always uses the name of a widget's type, never uses a custom name set with gtk_widget_set_name().
Recursively collapses all visible, expanded nodes in tree_view
.
Resizes all columns to their optimal width. Only works after the treeview has been realized.
Converts bin_window coordinates to coordinates for the tree (the full scrollable area of the tree).
X coordinate relative to bin_window
Y coordinate relative to bin_window
Converts bin_window coordinates (see gtk_tree_view_get_bin_window()) to widget relative coordinates.
bin_window X coordinate
bin_window Y coordinate
Converts tree coordinates (coordinates in full scrollable area of the tree) to bin_window coordinates.
tree X coordinate
tree Y coordinate
Converts tree coordinates (coordinates in full scrollable area of the tree) to widget coordinates.
X coordinate relative to the tree
Y coordinate relative to the tree
Converts widget coordinates to coordinates for the bin_window (see gtk_tree_view_get_bin_window()).
X coordinate relative to the widget
Y coordinate relative to the widget
Converts widget coordinates to coordinates for the tree (the full scrollable area of the tree).
X coordinate relative to the widget
Y coordinate relative to the widget
Creates a new #PangoLayout with the appropriate font map, font description, and base direction for drawing text for this widget.
If you keep a #PangoLayout created in this way around, in order to notify the layout of changes to the base direction or font of this widget, you must call pango_layout_context_changed() in response to the #GtkWidget::style-set and #GtkWidget::direction-changed signals for the widget.
text to set on the layout (can be %NULL)
This is similar to gtk_buildable_parser_finished() but is
called once for each custom tag handled by the buildable
.
a #GtkBuilder
child object or %NULL for non-child tags
the name of the tag
user data created in custom_tag_start
This is called at the end of each custom element handled by the buildable.
#GtkBuilder used to construct this object
child object or %NULL for non-child tags
name of tag
user data that will be passed in to parser functions
This is called for each unknown element under <child>.
a #GtkBuilder used to construct this object
child object or %NULL for non-child tags
name of tag
Destroys a widget. Equivalent to gtk_object_destroy(), except that you don't have to cast the widget to #GtkObject. When a widget is destroyed, it will break any references it holds to other objects. If the widget is inside a container, the widget will be removed from the container. If the widget is a toplevel (derived from #GtkWindow), it will be removed from the list of toplevels, and the reference GTK+ holds to it will be removed. Removing a widget from its container or the list of toplevels results in the widget being finalized, unless you've added additional references to the widget with g_object_ref().
In most cases, only toplevel widgets (windows) require explicit destruction, because when you destroy a toplevel its children will be destroyed as well.
This function sets *widget_pointer
to %NULL if widget_pointer
!=
%NULL. It's intended to be used as a callback connected to the
"destroy" signal of a widget. You connect gtk_widget_destroyed()
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 %NULL. Useful for example to avoid multiple copies
of the same dialog.
In GTK+ 1.2, this function would immediately render the
region area
of a widget, by invoking the virtual draw method of a
widget. In GTK+ 2.0, the draw method is gone, and instead
gtk_widget_draw() simply invalidates the specified region of the
widget, then updates the invalid region of the widget immediately.
Usually you don't want to update the region immediately for
performance reasons, so in general gtk_widget_queue_draw_area() is
a better choice if you want to draw a region of a widget.
Turns tree_view
into a drop destination for automatic DND. Calling
this method sets #GtkTreeView:reorderable to %FALSE.
the table of targets that the drag will support
the bitmask of possible actions for a drag from this widget
Turns tree_view
into a drag source for automatic DND. Calling this
method sets #GtkTreeView:reorderable to %FALSE.
Mask of allowed buttons to start drag
the table of targets that the drag will support
the bitmask of possible actions for a drag from this widget
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.
Notifies the user about an input-related error on this widget. If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls gdk_window_beep(), otherwise it does nothing.
Note that the effect of gdk_window_beep() can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.
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 gtk_main_do_event() so the event will behave as if it were in the event queue. Don't synthesize expose events; instead, use gdk_window_invalidate_rect() to invalidate a region of the window.
Recursively expands all nodes in the tree_view
.
This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().
Stops emission of #GtkWidget::child-notify signals on widget
. The
signals are queued until gtk_widget_thaw_child_notify() is called
on widget
.
This is the analogue of g_object_freeze_notify() for child properties.
Increases the freeze count on object
. If the freeze count is
non-zero, the emission of "notify" signals on object
is
stopped. The signals are queued until the freeze count is decreased
to zero. Duplicate notifications are squashed so that at most one
#GObject::notify signal is emitted for each property modified while the
object is frozen.
This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.
Returns the accessible object that describes the widget to an assistive technology.
If no accessibility library is loaded (i.e. no ATK implementation library is
loaded via
The documentation of the
Gets the first ancestor of widget
with type widget_type
. For example,
widget
. No reference will be
added to the returned widget; it should not be unreferenced. See note
about checking for a toplevel #GtkWindow in the docs for
gtk_widget_get_toplevel().
Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor()
considers widget
to be an ancestor of itself.
ancestor type
Determines whether the application intends to draw on the widget in an #GtkWidget::expose-event handler.
See gtk_widget_set_app_paintable()
Fills the bounding rectangle in bin_window coordinates for the cell at the
row specified by path
and the column specified by column
. If path
is
%NULL, or points to a node not found in the tree, the y
and height
fields of
the rectangle will be filled with 0. If column
is %NULL, the x
and width
fields will be filled with 0. The returned rectangle is equivalent to the
background_area
passed to gtk_cell_renderer_render(). These background
areas tile to cover the entire bin window. Contrast with the cell_area,
returned by gtk_tree_view_get_cell_area(), which returns only the cell
itself, excluding surrounding borders and the tree expander area.
a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordiantes
Retrieves the border width of the container. See gtk_container_set_border_width().
Determines whether widget
can be a default widget. See
gtk_widget_set_can_default().
Determines whether widget
can own the input focus. See
gtk_widget_set_can_focus().
Fills the bounding rectangle in bin_window coordinates for the cell at the
row specified by path
and the column specified by column
. If path
is
%NULL, or points to a path not currently displayed, the y
and height
fields
of the rectangle will be filled with 0. If column
is %NULL, the x
and width
fields will be filled with 0. The sum of all cell rects does not cover the
entire tree; there are extra pixels in between rows, for example. The
returned rectangle is equivalent to the cell_area
passed to
gtk_cell_renderer_render(). This function is only valid if tree_view
is
realized.
a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordinates
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 gtk_widget_set_size_request()),
in which case it returns that geometry instead of the widget's
requisition.
This function differs from gtk_widget_size_request() in that
it retrieves the last size request value from widget->
requisition,
while gtk_widget_size_request() 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, gtk_widget_size_request() has been called
since the last time a resize was queued. In general, only container
implementations have this information; applications should use
gtk_widget_size_request().
a #GtkRequisition to be filled in
Gets the value set with gtk_widget_set_child_visible(). 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.
Returns the clipboard object for the given selection to
be used with widget
. widget
must have a #GdkDisplay
associated with it, so must be attached to a toplevel
window.
a #GdkAtom 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.
Gets the #GtkTreeViewColumn at the given position in the #tree_view.
The position of the column, counting from 0.
Returns a #GList of all the #GtkTreeViewColumn s currently in tree_view
.
The returned list must be freed with g_list_free ().
Obtains the composite name of a widget.
Fills in path
and focus_column
with the current path and focus column. If
the cursor isn't currently set, then *path
will be %NULL. If no column
currently has focus, then *focus_column
will be %NULL.
The returned #GtkTreePath must be freed with gtk_tree_path_free() when you are done with it.
Gets a named field from the objects table of associations (see g_object_set_data()).
Gets a named field from the objects table of associations (see g_object_set_data()).
name of the key for that association
Determines the destination row for a given position. drag_x
and
drag_y
are expected to be in widget coordinates. This function is only
meaningful if tree_view
is realized. Therefore this function will always
return %FALSE if tree_view
is not realized or does not have a model.
the position to determine the destination row for
the position to determine the destination row for
Gets the reading direction for a particular widget. See gtk_widget_set_direction().
Get the #GdkDisplay 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 #GtkWindow 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.
Determines whether the widget is double buffered.
See gtk_widget_set_double_buffered()
Gets information about the row that is highlighted for feedback.
Returns whether or not the tree allows to start interactive searching by typing in text.
Returns whether or not tree lines are drawn in tree_view
.
Returns the event mask for the widget (a bitfield containing flags from the #GdkEventMask enumeration). These are the events that the widget will receive.
Returns the column that is the current expander column. This column has the expander arrow drawn next to it.
Retrieves the extension events the widget will receive; see gdk_input_set_extension_events().
Returns whether fixed height mode is turned on for tree_view
.
Retrieves the horizontal focus adjustment for the container. See gtk_container_set_focus_hadjustment ().
Retrieves the vertical focus adjustment for the container. See gtk_container_set_focus_vadjustment().
Returns which grid lines are enabled in tree_view
.
Gets the #GtkAdjustment currently being used for the horizontal aspect.
Returns the current value of the has-tooltip property. See GtkWidget:has-tooltip for more information.
Determines whether widget
has a #GdkWindow of its own. See
gtk_widget_set_has_window().
Returns whether all header columns are clickable.
Returns %TRUE if the headers on the tree_view
are visible.
Returns whether hover expansion mode is turned on for tree_view
.
Returns whether hover selection mode is turned on for tree_view
.
Returns the amount, in pixels, of extra indentation for child levels
in tree_view
.
Whether the widget is mapped.
Returns the current modifier style for the widget. (As set by gtk_widget_modify_style().) If no style has previously set, a new #GtkRcStyle 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 gtk_widget_modify_style(), passing in the returned rc style, to make sure that your changes take effect.
Caution: passing the style back to gtk_widget_modify_style() will normally end up destroying it, because gtk_widget_modify_style() 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.
Retrieves the name of a widget. See gtk_widget_set_name() for the significance of widget names.
Returns the current value of the GtkWidget:no-show-all property, which determines whether calls to gtk_widget_show_all() and gtk_widget_hide_all() will affect this widget.
Gets a #PangoContext with the appropriate font map, font description, and base direction for this widget. Unlike the context returned by gtk_widget_create_pango_context(), 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.
If you create and keep a #PangoLayout using this context, you must deal with changes to the context by calling pango_layout_context_changed() on the layout in response to the #GtkWidget::style-set and #GtkWidget::direction-changed signals for the widget.
Finds the path at the point (x,
y)
, relative to bin_window coordinates
(please see gtk_tree_view_get_bin_window()).
That is, x
and y
are relative to an events coordinates. x
and y
must
come from an event on the tree_view
only where path
is non-%NULL, then it will be filled
with the #GtkTreePath at that point. This path should be freed with
gtk_tree_path_free(). If column
is non-%NULL, then it will be filled
with the column at that point. cell_x
and cell_y
return the coordinates
relative to the cell background (i.e. the background_area
passed to
gtk_cell_renderer_render()). This function is only meaningful if
tree_view
is realized. Therefore this function will always return %FALSE
if tree_view
is not realized or does not have a model.
For converting widget coordinates (eg. the ones you get from GtkWidget::query-tooltip), please see gtk_tree_view_convert_widget_to_bin_window_coords().
The x position to be identified (relative to bin_window).
The y position to be identified (relative to bin_window).
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 are not
#GTK_NO_WINDOW widgets, and are relative to widget->
allocation.x,
widget->
allocation.y for widgets that are #GTK_NO_WINDOW widgets.
Gets a property of an object.
The value
can be:
In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().
Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.
the name of the property to get
return location for the property value
This function gets back user data pointers stored via g_object_set_qdata().
A #GQuark, naming the user data pointer
Determines whether widget
is realized.
Determines whether widget
is alyways treated as default widget
withing its toplevel when it has the focus, even if another widget
is the default.
See gtk_widget_set_receives_default().
Retrieves whether the user can reorder the tree via drag-and-drop. See gtk_tree_view_set_reorderable().
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 gtk_widget_queue_resize() instead of gtk_widget_queue_draw()).
Normally, gtk_widget_size_request() should be used.
Returns the resize mode for the container. See gtk_container_set_resize_mode ().
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 #GtkWindow at the top.
The root window is useful for such purposes as creating a popup #GdkWindow 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.
Returns whether rubber banding is turned on for tree_view
. If the
selection mode is #GTK_SELECTION_MULTIPLE, rubber banding will allow the
user to select multiple rows by dragging the mouse.
Gets the setting set by gtk_tree_view_set_rules_hint().
Get the #GdkScreen 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 #GtkWindow 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.
Gets the column searched on by the interactive search code.
Gets the #GtkTreeSelection associated with tree_view
.
Returns the widget's sensitivity (in the sense of returning the value that has been set using gtk_widget_set_sensitive()).
The effective sensitivity of a widget is however determined by both its own and its parent widget's sensitivity. See gtk_widget_is_sensitive().
Returns whether or not expanders are drawn in tree_view
.
Gets the size request that was explicitly set for the widget using
gtk_widget_set_size_request(). 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 intead. See
gtk_widget_set_size_request(). To get the size a widget will
actually use, call gtk_widget_size_request() instead of
this function.
Returns the column of tree_view'
s model which is being used for
displaying tooltips on tree_view'
s rows.
This function is supposed to be used in a #GtkWidget::query-tooltip
signal handler for #GtkTreeView. The x,
y
and keyboard_tip
values
which are received in the signal handler, should be passed to this
function without modification.
The return value indicates whether there is a tree view row at the given
coordinates (%TRUE) or not (%FALSE) for mouse tooltips. For keyboard
tooltips the row returned will be the cursor row. When %TRUE, then any of
model,
path
and iter
which have been provided will be set to point to
that row and the corresponding model. x
and y
will always be converted
to be relative to tree_view'
s bin_window if keyboard_tooltip
is %FALSE.
the x coordinate (relative to widget coordinates)
the y coordinate (relative to widget coordinates)
whether this is a keyboard tooltip or not
Gets the contents of the tooltip for widget
.
Gets the contents of the tooltip for widget
.
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. gtk_widget_get_ancestor();
widget
wasn't inside a toplevel window, and if the
window was inside a #GtkWindow-derived widget which was in turn
inside the toplevel #GtkWindow. While the second case may
seem unlikely, it actually happens when a #GtkPlug is embedded
inside a #GtkSocket within the same application.
To reliably find the toplevel #GtkWindow, use gtk_widget_get_toplevel() and check if the %TOPLEVEL flags is set on the result. |[ GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (gtk_widget_is_toplevel (toplevel)) { /* Perform action on toplevel. */ }
Gets the #GtkAdjustment currently being used for the vertical aspect.
Determines whether the widget is visible. Note that this doesn't take into account whether the widget's parent is also visible or the widget is obscured in any way.
See gtk_widget_set_visible().
Fills visible_rect
with the currently-visible region of the
buffer, in tree coordinates. Convert to bin_window coordinates with
gtk_tree_view_convert_tree_to_bin_window_coords().
Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire
scrollable area of the tree.
Gets n_properties
properties for an object
.
Obtained properties will be set to values
. All properties must be valid.
Warnings will be emitted and undefined behaviour may result if invalid
properties are passed in.
the names of each property to get
the values of each property to get
Causes widget
to become the default widget. widget
must have the
%GTK_CAN_DEFAULT flag set; typically you have to set this flag
yourself by calling widget,
%TRUE)
Causes widget
to have the keyboard focus for the #GtkWindow it's
inside. widget
must be a focusable widget, such as a #GtkEntry;
something like #GtkFrame won't work.
More precisely, it must have the %GTK_CAN_FOCUS flag set. Use gtk_widget_set_can_focus() 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.
Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).
See also gtk_grab_add().
Determines if the widget style has been looked up through the rc mechanism.
Checks whether there is a #GdkScreen 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.
Reverses the effects of gtk_widget_show(), causing the widget to be hidden (invisible to the user).
Recursively hides a widget and any child widgets.
Utility function; intended to be connected to the #GtkWidget::delete-event signal on a #GtkWindow. The function calls gtk_widget_hide() on its argument, then returns %TRUE. If connected to ::delete-event, 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 ::delete-event is received.
Sets an input shape for this widget's GDK window. This allows for windows which react to mouse click in a nonrectangular region, see gdk_window_input_shape_combine_mask() for more information.
shape to be added, or %NULL to remove an existing shape
X position of shape mask with respect to window
Y position of shape mask with respect to window
This inserts the column
into the tree_view
at position
. If position
is
-1, then the column is inserted at the end. If tree_view
has
"fixed_height" mode enabled, then column
must have its "sizing" property
set to be GTK_TREE_VIEW_COLUMN_FIXED.
The #GtkTreeViewColumn to be inserted.
The position to insert column
in.
Convenience function that inserts a new column into the #GtkTreeView
with the given cell renderer and a #GtkCellDataFunc to set cell renderer
attributes (normally using data from the model). See also
gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start().
If tree_view
has "fixed_height" mode enabled, then the new column will have its
"sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED.
Position to insert, -1 for append
column title
cell renderer for column
function to set attributes of cell renderer
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 %NULL if you're only
interested in whether there was an intersection.
a rectangle
rectangle to store intersection of widget
and area
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 gdk_window_set_composited()).
Determines whether widget
can be drawn to. A widget can be drawn
to if it is mapped and visible.
Checks whether object
has a [floating][floating-ref] reference.
Returns whether a rubber banding operation is currently being done
in tree_view
.
Returns the widget's effective sensitivity, which means it is sensitive itself and also its parent widget is sensntive
Determines whether widget
is a toplevel widget. Currently only
#GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
widgets have no parent widget.
This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the #GtkWidget::keynav-failed signal on the widget and its return value should be interpreted in a way similar to the return value of gtk_widget_child_focus():
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 gtk_widget_child_focus() on the widget's toplevel.
The default ::keynav-failed handler returns %TRUE for %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other values of #GtkDirectionType, it looks at the #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE if the setting is %TRUE. This way the entire user interface becomes cursor-navigatable on input devices such as mobile phones which only have cursor keys but no tab key.
Whenever the default handler returns %TRUE, it also calls gtk_widget_error_bell() to notify the user of the failed keyboard navigation.
A use case for providing an own implementation of ::keynav-failed (either by connecting to it or by overriding it) would be a row of #GtkEntry 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.
direction of focus movement
Lists the closures used by widget
for accelerator group connections
with gtk_accel_group_connect_by_path() or gtk_accel_group_connect().
The closures can be used to monitor accelerator changes on widget,
by connecting to the GtkAccelGroup:
:accel-changed signal of the
#GtkAccelGroup of a closure which can be found out with
gtk_accel_group_from_accel_closure().
Returns a newly allocated list of the widgets, normally labels, for which this widget is a the target of a mnemonic (see for example, gtk_label_set_mnemonic_widget()).
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
This function is only for use in widget implementations. Causes a widget to be mapped if it isn't already.
Calls func
on all expanded rows.
A function to be called
Emits the #GtkWidget::mnemonic-activate signal.
The default handler for this signal activates the widget
if
group_cycling
is %FALSE, and just grabs the focus if group_cycling
is %TRUE.
%TRUE if there are other widgets with the same mnemonic
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 gtk_widget_modify_text()) for widgets such as #GtkEntry and #GtkTextView. See also gtk_widget_modify_style().
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. #GtkLabel. 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 #GtkEventBox widget and setting the base color on that.
the state for which to set the base color
the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base().
Sets the background color for a widget in a particular state. All other style values are left untouched. See also gtk_widget_modify_style().
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. #GtkLabel. 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 #GtkEventBox widget and setting the background color on that.
the state for which to set the background color
the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
Sets the cursor color to use in a widget, overriding the #GtkWidget:cursor-color and #GtkWidget:secondary-cursor-color style properties. All other style values are left untouched. See also gtk_widget_modify_style().
the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor().
Sets the foreground color for a widget in a particular state. All other style values are left untouched. See also gtk_widget_modify_style().
the state for which to set the foreground color
the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
Sets the font to use for a widget. All other style values are left untouched. See also gtk_widget_modify_style().
the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font().
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 overriden if a style is explicitely set on the widget using gtk_widget_set_style(). The #GtkRcStyle structure 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 gtk_widget_modify_style() or with such functions as gtk_widget_modify_fg(). If you wish to retain previous values, you must first call gtk_widget_get_modifier_style(), make your modifications to the returned style, then call gtk_widget_modify_style() with that style. On the other hand, if you first call gtk_widget_modify_style(), subsequent calls to such functions gtk_widget_modify_fg() will have a cumulative effect with the initial modifications.
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 gtk_widget_modify_base()) for widgets such as #GtkEntry and #GtkTextView. See also gtk_widget_modify_style().
the state for which to set the text color
the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text().
Moves column
to be after to base_column
. If base_column
is %NULL, then
column
is placed in the first position.
The #GtkTreeViewColumn to be moved.
The #GtkTreeViewColumn to be moved relative to, or %NULL.
Emits a "notify" signal for the property property_name
on object
.
When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.
Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.
the name of a property installed on the class of object
.
Emits a "notify" signal for the property specified by pspec
on object
.
This function omits the property name lookup, hence it is faster than g_object_notify().
One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:
enum
{
PROP_0,
PROP_FOO,
PROP_LAST
};
static GParamSpec *properties[PROP_LAST];
static void
my_object_class_init (MyObjectClass *klass)
{
properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
0, 100,
50,
G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
PROP_FOO,
properties[PROP_FOO]);
}
and then notify a change on the "foo" property with:
g_object_notify_by_pspec (self, properties[PROP_FOO]);
the #GParamSpec of a property installed on the class of object
.
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
gtk_widget_get_name(). 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 gtk_widget_set_name(). By setting
the name of a widget, you allow users or theme authors to apply
styles to that specific widget in their gtkrc
file. path_reversed_p
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.
When a container receives an expose event, it must send synthetic expose events to all children that don't have their own #GdkWindows. This function provides a convenient way of doing this. A container, when it receives an expose event, calls gtk_container_propagate_expose() once for each child, passing in the event the container received.
gtk_container_propagate_expose() takes care of deciding whether an expose event needs to be sent to the child, intersecting the event's area with the child area, and sending the event.
In most cases, a container can simply either simply inherit the #GtkWidget::expose implementation from #GtkContainer, or, do some drawing and then chain to the ::expose implementation from #GtkContainer.
Note that the ::expose-event signal has been replaced by a ::draw signal in GTK+ 3, and consequently, gtk_container_propagate_expose() has been replaced by gtk_container_propagate_draw(). The GTK+ 3 migration guide for hints on how to port from ::expose-event to ::draw.
a child of container
a expose event sent to container
This function does the same as gtk_widget_queue_draw().
This function is no longer different from gtk_widget_queue_draw_area(), though it once was. Now it just calls gtk_widget_queue_draw_area(). Originally gtk_widget_queue_clear_area() would force a redraw of the background for %GTK_NO_WINDOW widgets, and gtk_widget_queue_draw_area() would not. Now both functions ensure the background will be redrawn.
x coordinate of upper-left corner of rectangle to redraw
y coordinate of upper-left corner of rectangle to redraw
width of region to draw
height of region to draw
Equivalent to calling gtk_widget_queue_draw_area() for the entire area of a widget.
Invalidates the rectangular area of widget
defined by x,
y,
width
and height
by calling gdk_window_invalidate_rect() 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, or gdk_window_invalidate_rect() directly, to schedule a redraw of a #GtkDrawingArea or some portion thereof.
Frequently you can just call gdk_window_invalidate_rect() or gdk_window_invalidate_region() instead of this function. Those functions will invalidate only a single window, instead of the widget and all its children.
The advantage of adding to the invalidated region compared to simply drawing immediately is efficiency; using an invalid region ensures that you only have to redraw one time.
x coordinate of upper-left corner of rectangle to redraw
y coordinate of upper-left corner of rectangle to redraw
width of region to draw
height of region to draw
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 #GtkLabel, #GtkLabel queues a resize to ensure there's enough space for the new text.
This function works like gtk_widget_queue_resize(), except that the widget is not invalidated.
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
gtk_widget_realize() 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 GtkWidget::expose-event. Or simply g_signal_connect () to the GtkWidget::realize signal.
Increase the reference count of object,
and possibly remove the
[floating][floating-ref] reference, if object
has a floating reference.
In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.
Since GLib 2.56, the type of object
will be propagated to the return type
under the same conditions as for g_object_ref().
Removes widget
from container
. widget
must be inside container
.
Note that container
will own a reference to widget,
and that this
may be the last reference held; so removing a widget from its
container can destroy that widget. If you want to use widget
again, you need to add a reference to it while it's not inside
a container, using g_object_ref(). If you don't want to use widget
again it's usually more efficient to simply destroy it directly
using gtk_widget_destroy() since this will remove it from the
container and help break any circular reference count cycles.
Removes an accelerator from widget,
previously installed with
gtk_widget_add_accelerator().
accel group for this widget
GDK keyval of the accelerator
modifier key combination of the accelerator
Removes column
from tree_view
.
The #GtkTreeViewColumn to remove.
Removes a widget from the list of mnemonic labels for this widget. (See gtk_widget_list_mnemonic_labels()). The widget must have previously been added to the list with gtk_widget_add_mnemonic_label().
a #GtkWidget that was previously set as a mnemnic label for widget
with gtk_widget_add_mnemonic_label().
A convenience function that uses the theme engine and RC file
settings for widget
to look up stock_id
and render it to
a pixbuf. stock_id
should be a stock icon ID such as
#GTK_STOCK_OPEN or #GTK_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 #GdkPixbuf are shared with the rest of the application and should not be modified. The pixbuf should be freed after use with g_object_unref().
a stock ID
a stock size. 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).
render detail to pass to theme engine
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.
Recursively resets the shape on this widget and its descendants.
Activates the cell determined by path
and column
.
The #GtkTreePath to be activated.
The #GtkTreeViewColumn to be activated.
Releases all references to other objects. This can be used to break reference cycles.
This function should only be called from object system implementations.
Moves the alignments of tree_view
to the position specified by column
and
path
. If column
is %NULL, then no horizontal scrolling occurs. Likewise,
if path
is %NULL no vertical scrolling occurs. At a minimum, one of column
or path
need to be non-%NULL. row_align
determines where the row is
placed, and col_align
determines where column
is placed. Both are expected
to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means
right/bottom alignment, 0.5 means center.
If use_align
is %FALSE, then the alignment arguments are ignored, and the
tree does the minimum amount of work to scroll the cell onto the screen.
This means that the cell will be scrolled to the edge closest to its current
position. If the cell is currently visible on the screen, nothing is done.
This function only works if the model is set, and path
is a valid row on the
model. If the model changes before the tree_view
is realized, the centered
path will be modified to reflect this change.
The path of the row to move to, or %NULL.
The #GtkTreeViewColumn to move horizontally to, or %NULL.
whether to use alignment arguments, or %FALSE.
The vertical alignment of the row specified by path
.
The horizontal alignment of the column specified by column
.
Scrolls the tree view such that the top-left corner of the visible
area is tree_x,
tree_y,
where tree_x
and tree_y
are specified
in tree coordinates. The tree_view
must be realized before
this function is called. If it isn't, you probably want to be
using gtk_tree_view_scroll_to_cell().
If either tree_x
or tree_y
are -1, then that direction isn't scrolled.
X coordinate of new top-left pixel of visible area, or -1
Y coordinate of new top-left pixel of visible area, or -1
Very rarely-used function. This function is used to emit an expose event signals on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a child %NO_WINDOW widget, and that is normally done using gtk_container_propagate_expose().
If you want to force an area of a window to be redrawn, use gdk_window_invalidate_rect() or gdk_window_invalidate_region(). To cause the redraw to be done immediately, follow that call with a call to gdk_window_process_updates().
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 #GtkWidget 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 #GtkTreeView.
An example of its usage is:
|[ 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);
@param event a #GdkEvent of type GDK_FOCUS_CHANGE
Given an accelerator group, accel_group,
and an accelerator path,
accel_path,
sets up an accelerator in accel_group
so whenever the
key binding that is defined for accel_path
is pressed, widget
will be activated. This removes any accelerators (for any
accelerator group) installed by previous calls to
gtk_widget_set_accel_path(). Associating accelerators with
paths allows them to be modified by the user and the modifications
to be saved for future use. (See gtk_accel_map_save().)
This function is a low level function that would most likely be used by a menu creation system like #GtkUIManager. If you use #GtkUIManager, setting up accelerator paths will be done automatically.
Even when you you aren't using #GtkUIManager, if you only want to set up accelerators on menu items gtk_menu_item_set_accel_path() provides a somewhat more convenient interface.
Note that accel_path
string will be stored in a #GQuark. Therefore, if you
pass a static string, you can save some memory by interning it first with
g_intern_static_string().
path used to look up the accelerator
a #GtkAccelGroup.
Sets whether the application intends to draw on the widget in an #GtkWidget::expose-event 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 #GtkEventBox and #GtkWindow, 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. If this is not suitable (e.g. because you want to make a transparent window using an RGBA visual), you can work around this by doing: |[ gtk_widget_realize (window); gdk_window_set_back_pixmap (window->window, NULL, FALSE); gtk_widget_show (window);
@param app_paintable %TRUE if the application will paint on the widget
Sets the border width of the container.
The border width of a container is the amount of space to leave around the outside of the container. The only exception to this is #GtkWindow; because toplevel windows can't leave space outside, they leave the space inside. The border is added on all sides of the container. To add space to only one side, one approach is to create a #GtkAlignment widget, call gtk_widget_set_size_request() to give it a size, and place it on the side of the container as a spacer.
amount of blank space to leave
Specifies whether widget
can be a default widget. See
gtk_widget_grab_default() for details about the meaning of
"default".
whether or not widget
can be a default widget.
Specifies whether widget
can own the input focus. See
gtk_widget_grab_focus() for actually setting the input focus on a
widget.
whether or not widget
can own the input focus.
Sets whether widget
should be mapped along with its when its parent
is mapped and widget
has been shown with gtk_widget_show().
The child visibility can be set for widget before it is added to a container with gtk_widget_set_parent(), 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.
if %TRUE, widget
should be mapped along with its parent.
Sets a user function for determining where a column may be dropped when
dragged. This function is called on every column pair in turn at the
beginning of a column drag to determine where a drop can take place. The
arguments passed to func
are: the tree_view,
the #GtkTreeViewColumn being
dragged, the two #GtkTreeViewColumn s determining the drop spot, and
user_data
. If either of the #GtkTreeViewColumn arguments for the drop spot
are %NULL, then they indicate an edge. If func
is set to be %NULL, then
tree_view
reverts to the default behavior of allowing all columns to be
dropped everywhere.
A function to determine which columns are reorderable, or %NULL.
Sets a widgets composite name. The widget must be a composite child of its parent; see gtk_widget_push_composite_child().
the name to set
Sets the current keyboard focus to be at path,
and selects it. This is
useful when you want to focus the user's attention on a particular row. If
focus_column
is not %NULL, then focus is given to the column specified by
it. Additionally, if focus_column
is specified, and start_editing
is
%TRUE, then editing should be started in the specified cell.
This function is often followed by gtk_widget_grab_focus
(tree_view)
in order to give keyboard focus to the widget. Please note that editing
can only happen when the widget is realized.
If path
is invalid for model,
the current cursor (if any) will be unset
and the function will return without failing.
A #GtkTreePath
A #GtkTreeViewColumn, or %NULL
%TRUE if the specified cell should start being edited.
Sets the current keyboard focus to be at path,
and selects it. This is
useful when you want to focus the user's attention on a particular row. If
focus_column
is not %NULL, then focus is given to the column specified by
it. If focus_column
and focus_cell
are not %NULL, and focus_column
contains 2 or more editable or activatable cells, then focus is given to
the cell specified by focus_cell
. Additionally, if focus_column
is
specified, and start_editing
is %TRUE, then editing should be started in
the specified cell. This function is often followed by
gtk_widget_grab_focus
(tree_view)
in order to give keyboard focus to the
widget. Please note that editing can only happen when the widget is
realized.
If path
is invalid for model,
the current cursor (if any) will be unset
and the function will return without failing.
A #GtkTreePath
A #GtkTreeViewColumn, or %NULL
A #GtkCellRenderer, or %NULL
%TRUE if the specified cell should start being edited.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
If the object already had an association with that name, the old association will be destroyed.
Internally, the key
is converted to a #GQuark using g_quark_from_string().
This means a copy of key
is kept permanently (even after object
has been
finalized) — so it is recommended to only use a small, bounded set of values
for key
in your program, to avoid the #GQuark storage growing unbounded.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
If the object already had an association with that name, the old association will be destroyed.
Internally, the key
is converted to a #GQuark using g_quark_from_string().
This means a copy of key
is kept permanently (even after object
has been
finalized) — so it is recommended to only use a small, bounded set of values
for key
in your program, to avoid the #GQuark storage growing unbounded.
name of the key
data to associate with that key
This function should almost never be used. It is meant for private use by ATK for determining the number of visible children that are removed when the user collapses a row, or a row is deleted.
Function to be called when a view row is destroyed, or %NULL
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 explicitely visual rather than logical (such as buttons for text justification).
If the direction is set to %GTK_TEXT_DIR_NONE, then the value set by gtk_widget_set_default_direction() will be used.
the new direction
Widgets are double buffered by default; you can use this function to turn off the buffering. "Double buffered" simply means that gdk_window_begin_paint_region() and gdk_window_end_paint() are called automatically around expose events sent to the widget. gdk_window_begin_paint() diverts all drawing to a widget's window to an offscreen buffer, and gdk_window_end_paint() 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 gdk_window_begin_paint()).
%TRUE to double-buffer a widget
Sets the row that is highlighted for feedback.
The path of the row to highlight, or %NULL.
Specifies whether to drop before, after or into the row
If enable_search
is set, then the user can type in text to search through
the tree interactively (this is sometimes called "typeahead find").
Note that even if this is %FALSE, the user can still initiate a search using the "start-interactive-search" key binding.
%TRUE, if the user can search interactively
Sets whether to draw lines interconnecting the expanders in tree_view
.
This does not have any visible effects for lists.
%TRUE to enable tree line drawing, %FALSE otherwise.
Sets the event mask (see #GdkEventMask) 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 gtk_widget_add_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can't be used with #GTK_NO_WINDOW widgets; to get events on those widgets, place them inside a #GtkEventBox and receive events on the event box.
event mask
Sets the column to draw the expander arrow at. It must be in tree_view
.
If column
is %NULL, then the expander arrow is always at the first
visible column.
If you do not want expander arrow to appear in your tree, set the expander column to a hidden column.
%NULL, or the column to draw the expander arrow at.
Sets the extension events mask to mode
. See #GdkExtensionMode
and gdk_input_set_extension_events().
bitfield of extension events to receive
Enables or disables the fixed height mode of tree_view
.
Fixed height mode speeds up #GtkTreeView by assuming that all
rows have the same height.
Only enable this option if all rows are the same height and all
columns are of type %GTK_TREE_VIEW_COLUMN_FIXED.
%TRUE to enable fixed height mode
Sets a focus chain, overriding the one computed automatically by GTK+.
In principle each widget in the chain should be a descendant of the container, but this is not enforced by this method, since it's allowed to set the focus chain before you pack the widgets, or have a widget in the chain that isn't always packed. The necessary checks are done when the focus chain is actually traversed.
Sets, or unsets if child
is %NULL, the focused child of container
.
This function emits the GtkContainer::set_focus_child signal of
container
. Implementations of #GtkContainer can override the
default behaviour by overriding the class closure of this signal.
This is function is mostly meant to be used by widgets. Applications can use gtk_widget_grab_focus() to manualy set the focus to a specific widget.
Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the horizontal alignment. See gtk_scrolled_window_get_hadjustment() for a typical way of obtaining the adjustment and gtk_container_set_focus_vadjustment() for setting the vertical adjustment.
The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the container.
an adjustment which should be adjusted when the focus is moved among the descendents of container
Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the vertical alignment. See gtk_scrolled_window_get_vadjustment() for a typical way of obtaining the adjustment and gtk_container_set_focus_hadjustment() for setting the horizontal adjustment.
The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the container.
an adjustment which should be adjusted when the focus is moved among the descendents of container
Sets which grid lines to draw in tree_view
.
a #GtkTreeViewGridLines value indicating which grid lines to enable.
Sets the #GtkAdjustment for the current horizontal aspect.
The #GtkAdjustment to set, or %NULL
Sets the has-tooltip property on widget
to has_tooltip
. See
GtkWidget:has-tooltip for more information.
whether or not widget
has a tooltip.
Specifies whether widget
has a #GdkWindow of its own. Note that
all realized widgets have a non-%NULL "window" pointer
(gtk_widget_get_window() never returns a %NULL window when a widget
is realized), but for many of them it's actually the #GdkWindow of
one of its parent widgets. Widgets that do not create a %window for
themselves in GtkWidget::realize() must announce this by
calling this function with has_window
= %FALSE.
This function should only be called by widget implementations, and they should call it in their init() function.
whether or not widget
has a window.
Allow the column title buttons to be clicked.
%TRUE if the columns are clickable.
Sets the visibility state of the headers.
%TRUE if the headers are visible
Enables of disables the hover expansion mode of tree_view
.
Hover expansion makes rows expand or collapse if the pointer
moves over them.
%TRUE to enable hover selection mode
Enables of disables the hover selection mode of tree_view
.
Hover selection makes the selected row follow the pointer.
Currently, this works only for the selection modes
%GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.
%TRUE to enable hover selection mode
Sets the amount of extra indentation for child levels to use in tree_view
in addition to the default indentation. The value should be specified in
pixels, a value of 0 disables this feature and in this case only the default
indentation will be used.
This does not have any visible effects for lists.
the amount, in pixels, of extra indentation in tree_view
.
Marks the widget as being realized.
This function should only ever be called in a derived widget's "map" or "unmap" implementation.
%TRUE to mark the widget as mapped
Widgets can be named, which allows you to refer to them from a gtkrc file. You can apply a style to widgets with a particular name in the gtkrc file. See the documentation for gtkrc files (on the same page as the docs for #GtkRcStyle).
Note that widget names are separated by periods in paths (see gtk_widget_path()), so names with embedded periods may cause confusion.
name for the widget
Sets the #GtkWidget:no-show-all property, which determines whether calls to gtk_widget_show_all() and gtk_widget_hide_all() will affect this widget.
This is mostly for use in constructing widget hierarchies with externally controlled visibility, see #GtkUIManager.
the new value for the "no-show-all" property
This function is useful only when implementing subclasses of
#GtkContainer.
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
gtk_widget_unparent().
Sets a property on an object.
the name of the property to set
the value
Marks the widget as being realized.
This function should only ever be called in a derived widget's "realize" or "unrealize" implementation.
%TRUE to mark the widget as realized
Sets the reallocate_redraws
flag of the container to the given value.
Containers requesting reallocation redraws get automatically redrawn if any of their children changed allocation.
the new value for the container's reallocate_redraws
flag
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 gtk_widget_grab_default() for details about the meaning of "default".
whether or not widget
can be a default widget.
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 %NO_WINDOW widgets 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
%NO_WINDOW widget that 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.
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.
This function is a convenience function to allow you to reorder
models that support the #GtkDragSourceIface and the
#GtkDragDestIface. Both #GtkTreeStore and #GtkListStore support
these. If reorderable
is %TRUE, then the user can reorder the
model by dragging and dropping rows. The developer can listen to
these changes by connecting to the model's row_inserted and
row_deleted signals. The reordering is implemented by setting up
the tree view as a drag source and destination. Therefore, drag and
drop can not be used in a reorderable view for any other purpose.
This function does not give you any degree of control over the order -- any reordering is allowed. If more control is needed, you should probably handle drag and drop manually.
%TRUE, if the tree can be reordered.
Sets the resize mode for the container.
The resize mode of a container determines whether a resize request will be passed to the container's parent, queued for later execution or executed immediately.
the new resize mode
Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is %NULL, no separators are drawn. This is the default value.
a #GtkTreeViewRowSeparatorFunc
Enables or disables rubber banding in tree_view
. If the selection mode
is #GTK_SELECTION_MULTIPLE, rubber banding will allow the user to select
multiple rows by dragging the mouse.
%TRUE to enable rubber banding
This function tells GTK+ that the user interface for your
application requires users to read across tree rows and associate
cells with one another. By default, GTK+ will then render the tree
with alternating row colors. Do
%TRUE if the tree requires reading across rows
For widgets that support scrolling, sets the scroll adjustments and returns %TRUE. For widgets that don't support scrolling, does nothing and returns %FALSE. Widgets that don't support scrolling can be scrolled by placing them in a #GtkViewport, which does support scrolling.
an adjustment for horizontal scrolling, or %NULL
an adjustment for vertical scrolling, or %NULL
Sets column
as the column where the interactive search code should
search in for the current model.
If the search column is set, users can use the "start-interactive-search" key binding to bring up search popup. The enable-search property controls whether simply typing text will also start an interactive search.
Note that column
refers to a column of the current model. The search
column is reset to -1 when the model is changed.
the column of the model to search in, or -1 to disable searching
Sets the entry which the interactive search code will use for this
tree_view
. This is useful when you want to provide a search entry
in our interface at all time at a fixed position. Passing %NULL for
entry
will make the interactive search code use the built-in popup
entry again.
Sets the compare function for the interactive search capabilities; note that somewhat like strcmp() returning 0 for equality #GtkTreeViewSearchEqualFunc returns %FALSE on matches.
the compare function to use during the search
Sets the function to use when positioning the search dialog.
the function to use to position the search dialog, or %NULL to use the default search position function
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.
%TRUE to make the widget sensitive
Sets whether to draw and enable expanders and indent child rows in
tree_view
. When disabled there will be no expanders visible in trees
and there will be no way to expand and collapse rows by default. Also
note that hiding the expanders will disable the default indentation. You
can set a custom indentation in this case using
gtk_tree_view_set_level_indentation().
This does not have any visible effects for lists.
%TRUE to enable expander drawing, %FALSE otherwise.
Sets the minimum size of a widget; that is, the widget's size
request will be width
by height
. You can use this function to
force a widget to be either larger or smaller than it normally
would be.
In most cases, gtk_window_set_default_size() 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, gtk_window_set_geometry_hints() 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.
Widgets can't actually be allocated a size less than 1 by 1, but you can pass 0,0 to this function to mean "as small as possible."
width widget
should request, or -1 to unset
height widget
should request, or -1 to unset
Sets the #GtkStyle for a widget (widget->
style). You probably don't
want to use this function; it interacts badly with themes, because
themes work by replacing the #GtkStyle. Instead, use
gtk_widget_modify_style().
a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
Sets the tip area of tooltip
to the area path,
column
and cell
have
in common. For example if path
is %NULL and column
is set, the tip
area will be set to the full area covered by column
. See also
gtk_tooltip_set_tip_area().
Note that if path
is not specified and cell
is set and part of a column
containing the expander, the tooltip might not show and hide at the correct
position. In such cases path
must be set to the current node under the
mouse cursor for this function to operate correctly.
See also gtk_tree_view_set_tooltip_column() for a simpler alternative.
a #GtkTooltip
a #GtkTreePath or %NULL
a #GtkTreeViewColumn or %NULL
a #GtkCellRenderer or %NULL
If you only plan to have simple (text-only) tooltips on full rows, you
can use this function to have #GtkTreeView handle these automatically
for you. column
should be set to the column in tree_view'
s model
containing the tooltip texts, or -1 to disable this feature.
When enabled, #GtkWidget::has-tooltip will be set to %TRUE and
tree_view
will connect a #GtkWidget::query-tooltip signal handler.
Note that the signal handler sets the text with gtk_tooltip_set_markup(), so &, <, etc have to be escaped in the text.
an integer, which is a valid column number for tree_view'
s model
Sets markup
as the contents of the tooltip, which is marked up with
the Pango text markup language.
This function will take care of setting GtkWidget:has-tooltip to %TRUE and of the default handler for the GtkWidget::query-tooltip signal.
See also the GtkWidget:tooltip-markup property and gtk_tooltip_set_markup().
the contents of the tooltip for widget,
or %NULL
Sets text
as the contents of the tooltip. This function will take
care of setting GtkWidget:has-tooltip to %TRUE and of the default
handler for the GtkWidget::query-tooltip signal.
See also the GtkWidget:tooltip-text property and gtk_tooltip_set_text().
the contents of the tooltip for widget
Replaces the default, usually yellow, window used for displaying
tooltips with custom_window
. GTK+ will take care of showing and
hiding custom_window
at the right moment, to behave likewise as
the default tooltip window. If custom_window
is %NULL, the default
tooltip window will be used.
If the custom window should have the default theming it needs to have the name "gtk-tooltip", see gtk_widget_set_name().
Sets the position of a widget. The funny "u" in the name comes from the "user position" hint specified by the X Window System, and exists for legacy reasons. This function doesn't work if a widget is inside a container; it's only really useful on #GtkWindow.
Don't use this function to center dialogs over the main application window; most window managers will do the centering on your behalf if you call gtk_window_set_transient_for(), and it's really not possible to get the centering to work correctly in all cases from application code. But if you insist, use gtk_window_set_position() to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering manually.
Note that although x
and y
can be individually unset, the position
is not honoured unless both x
and y
are set.
x position; -1 to unset x; -2 to leave x unchanged
y position; -1 to unset y; -2 to leave y unchanged
Sets the minimum size of a widget; that is, the widget's size
request will be width
by height
. You can use this function to
force a widget to be either larger or smaller than it is. The
strange "usize" name dates from the early days of GTK+, and derives
from X Window System terminology. In many cases,
gtk_window_set_default_size() is a better choice for toplevel
windows than this function; setting the default size will still
allow users to shrink the window. Setting the usize will force them
to leave the window at least as large as the usize. When dealing
with window sizes, gtk_window_set_geometry_hints() 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.
minimum width, or -1 to unset
minimum height, or -1 to unset
Sets the #GtkAdjustment for the current vertical aspect.
The #GtkAdjustment to set, or %NULL
Sets the visibility state of widget
. Note that setting this to
%TRUE doesn't mean the widget is actually viewable, see
gtk_widget_get_visible().
This function simply calls gtk_widget_show() or gtk_widget_hide() but is nicer to use when the visibility of the widget depends on some condition.
whether the widget should be shown or not
Sets a widget's window. This function should only be used in a widget's GtkWidget::realize() implementation. The %window passed is usually either new window created with gdk_window_new(), or the window of its parent widget as returned by gtk_widget_get_parent_window().
Widgets must indicate whether they will create their own #GdkWindow by calling gtk_widget_set_has_window(). This is usually done in the widget's init() function.
Sets a shape for this widget's GDK window. This allows for transparent windows etc., see gdk_window_shape_combine_mask() for more information.
shape to be added, or %NULL to remove an existing shape
X position of shape mask with respect to window
Y position of shape mask with respect to window
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 gtk_widget_show_all() 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.
Recursively shows a widget, and any child widgets (if the widget is a container).
Shows a widget. If the widget is an unmapped toplevel widget (i.e. a #GtkWindow 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.
This function is typically used when implementing a #GtkContainer 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 gtk_widget_size_allocate().
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.
See also gtk_widget_get_child_requisition().
a #GtkRequisition to be filled in
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
name of the key
This function gets back user data pointers stored via
g_object_set_qdata() and removes the data
from object
without invoking its destroy() function (if any was
set).
Usually, calling this function is only required to update
user data pointers with a destroy notifier, for example:
void
object_add_to_user_list (GObject *object,
const gchar *new_string)
{
// the quark, naming the object data
GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
// retrieve the old string list
GList *list = g_object_steal_qdata (object, quark_string_list);
// prepend new string
list = g_list_prepend (list, g_strdup (new_string));
// this changed 'list', so we need to set it again
g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
}
static void
free_string_list (gpointer data)
{
GList *node, *list = data;
for (node = list; node; node = node->next)
g_free (node->data);
g_list_free (list);
}
Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().
A #GQuark, naming the user data pointer
This function attaches the widget's #GtkStyle to the widget's #GdkWindow. It is a replacement for
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 #GtkWidget) would attach the style itself.
Gets the value of a style property of widget
.
the name of a style property
location to return the property value
Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
This causes all queued #GtkWidget::child-notify signals on widget
to be
emitted.
Reverts the effect of a previous call to
g_object_freeze_notify(). The freeze count is decreased on object
and when it reaches zero, queued "notify" signals are emitted.
Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.
It is an error to call this function when the freeze count is zero.
Translate coordinates relative to src_widget'
s allocation to coordinates
relative to dest_widget'
s allocations. In order to perform this
operation, both widgets must be realized, and must share a common
toplevel.
a #GtkWidget
X position relative to src_widget
Y position relative to src_widget
Converts tree coordinates (coordinates in full scrollable area of the tree) to bin_window coordinates.
tree X coordinate
tree Y coordinate
return location for X coordinate relative to bin_window
return location for Y coordinate relative to bin_window
Triggers a tooltip query on the display where the toplevel of widget
is located. See gtk_tooltip_trigger_tooltip_query() for more
information.
This function is only for use in widget implementations. Causes a widget to be unmapped if it's currently mapped.
This function is only for use in widget implementations. Should be called by implementations of the remove method on #GtkContainer, to dissociate a child from the container.
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).
Inverse of gtk_widget_ref(). Equivalent to g_object_unref().
Removes a focus chain explicitly set with gtk_container_set_focus_chain().
Undoes the effect of gtk_tree_view_enable_model_drag_dest(). Calling this method sets #GtkTreeView:reorderable to %FALSE.
Undoes the effect of gtk_tree_view_enable_model_drag_source(). Calling this method sets #GtkTreeView:reorderable to %FALSE.
Adds widget
to container
. Typically used for simple containers
such as #GtkWindow, #GtkFrame, or #GtkButton; for more complicated
layout containers such as #GtkBox or #GtkTable, this function will
pick default packing parameters that may not be correct. So
consider functions such as gtk_box_pack_start() and
gtk_table_attach() as an alternative to gtk_container_add() in
those cases. A widget may be added to only one container at a time;
you can't place the same widget inside two different containers.
Determines whether an accelerator that activates the signal
identified by signal_id
can currently be activated.
This is done by emitting the #GtkWidget::can-activate-accel
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.
the ID of a signal installed on widget
Emits a #GtkWidget::child-notify signal for the
child property `child_property` on `widget`.This is the analogue of g_object_notify() for child properties.
Returns the type of the children supported by the container.
Note that this may return %G_TYPE_NONE to indicate that no more children can be added, e.g. for a #GtkPaned which already has two children.
This is similar to gtk_buildable_parser_finished() but is
called once for each custom tag handled by the buildable
.
a #GtkBuilder
child object or %NULL for non-child tags
the name of the tag
user data created in custom_tag_start
This is called at the end of each custom element handled by the buildable.
#GtkBuilder used to construct this object
child object or %NULL for non-child tags
name of tag
user data that will be passed in to parser functions
This is called for each unknown element under <child>.
a #GtkBuilder used to construct this object
child object or %NULL for non-child tags
name of tag
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 gtk_main_do_event() so the event will behave as if it were in the event queue. Don't synthesize expose events; instead, use gdk_window_invalidate_rect() to invalidate a region of the window.
Returns the accessible object that describes the widget to an assistive technology.
If no accessibility library is loaded (i.e. no ATK implementation library is
loaded via
The documentation of the
Gets the name of the buildable
object.
#GtkBuilder sets the name based on the the
GtkBuilder UI definition used to construct the `buildable`.Causes widget
to have the keyboard focus for the #GtkWindow it's
inside. widget
must be a focusable widget, such as a #GtkEntry;
something like #GtkFrame won't work.
More precisely, it must have the %GTK_CAN_FOCUS flag set. Use gtk_widget_set_can_focus() 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.
Reverses the effects of gtk_widget_show(), causing the widget to be hidden (invisible to the user).
Recursively hides a widget and any child widgets.
This function is only for use in widget implementations. Causes a widget to be mapped if it isn't already.
Emits the #GtkWidget::mnemonic-activate signal.
The default handler for this signal activates the widget
if
group_cycling
is %FALSE, and just grabs the focus if group_cycling
is %TRUE.
%TRUE if there are other widgets with the same mnemonic
Emits a "notify" signal for the property property_name
on object
.
When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.
Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.
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
gtk_widget_realize() 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 GtkWidget::expose-event. Or simply g_signal_connect () to the GtkWidget::realize signal.
Removes widget
from container
. widget
must be inside container
.
Note that container
will own a reference to widget,
and that this
may be the last reference held; so removing a widget from its
container can destroy that widget. If you want to use widget
again, you need to add a reference to it while it's not inside
a container, using g_object_ref(). If you don't want to use widget
again it's usually more efficient to simply destroy it directly
using gtk_widget_destroy() since this will remove it from the
container and help break any circular reference count cycles.
Activates the cell determined by path
and column
.
The #GtkTreePath to be activated.
The #GtkTreeViewColumn to be activated.
Sets, or unsets if child
is %NULL, the focused child of container
.
This function emits the GtkContainer::set_focus_child signal of
container
. Implementations of #GtkContainer can override the
default behaviour by overriding the class closure of this signal.
This is function is mostly meant to be used by widgets. Applications can use gtk_widget_grab_focus() to manualy set the focus to a specific widget.
Sets the name of the buildable
object.
name to set
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 gtk_widget_show_all() 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.
Recursively shows a widget, and any child widgets (if the widget is a container).
This function is typically used when implementing a #GtkContainer 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 gtk_widget_size_allocate().
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.
See also gtk_widget_get_child_requisition().
a #GtkRequisition to be filled in
This function is only for use in widget implementations. Causes a widget to be unmapped if it's currently mapped.
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).
This function essentially limits the life time of the closure
to
the life time of the object. That is, when the object is finalized,
the closure
is invalidated by calling g_closure_invalidate() on
it, in order to prevent invocations of the closure with a finalized
(nonexisting) object. Also, g_object_ref() and g_object_unref() are
added as marshal guards to the closure,
to ensure that an extra
reference count is held on object
during invocation of the
closure
. Usually, this function will be called on closures that
use this object
as closure data.
#GClosure to watch
Converts bin_window coordinates to coordinates for the tree (the full scrollable area of the tree).
X coordinate relative to bin_window
Y coordinate relative to bin_window
return location for tree X coordinate
return location for tree Y coordinate
Obtains the current default reading direction. See gtk_widget_set_default_direction().
Find the #GParamSpec with the given name for an
interface. Generally, the interface vtable passed in as g_iface
will be the default vtable from g_type_default_interface_ref(), or,
if you know the interface has already been loaded,
g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
name of a property to look up.
Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.
This function is meant to be called from the interface's default
vtable initialization function (the class_init
member of
#GTypeInfo.) It must not be called after after class_init
has
been called for any object types implementing this interface.
If pspec
is a floating reference, it will be consumed.
any interface vtable for the interface, or the default vtable for the interface.
the #GParamSpec for the new property
Lists the properties of an interface.Generally, the interface
vtable passed in as g_iface
will be the default vtable from
g_type_default_interface_ref(), or, if you know the interface has
already been loaded, g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
Creates a new instance of a #GObject subtype and sets its properties.
Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.
the type id of the #GObject subtype to instantiate
an array of #GParameter
Removes a colormap pushed with gtk_widget_push_colormap().
Cancels the effect of a previous call to gtk_widget_push_composite_child().
Makes all newly-created widgets as composite children until the corresponding gtk_widget_pop_composite_child() 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 gtk_container_foreach() vs. gtk_container_forall()), but e.g. GUI builders might want to treat them in a different way.
Here is a simple example: |[ gtk_widget_push_composite_child (); scrolled_window->hscrollbar = gtk_hscrollbar_new (hadjustment); gtk_widget_set_composite_name (scrolled_window->hscrollbar, "hscrollbar"); gtk_widget_pop_composite_child (); gtk_widget_set_parent (scrolled_window->hscrollbar, GTK_WIDGET (scrolled_window)); g_object_ref (scrolled_window->hscrollbar);
Sets the default reading direction for widgets where the direction has not been explicitly set by gtk_widget_set_direction().
the new default direction. This cannot be %GTK_TEXT_DIR_NONE.
Creates a new #GtkTreeView widget.