c:type="GtkSizeGroup*"/>
Returns the list of widgets associated with @size_group.
a #GSList of
widgets. The list is owned by GTK+ and should not be modified.
a #GtkSizeGrup
Removes a widget from a #GtkSizeGroup.
a #GtkSizeGrup
the #GtkWidget to remove
Sets whether unmapped widgets should be ignored when
calculating the size.
a #GtkSizeGroup
whether unmapped widgets should be ignored
when calculating the size
Sets the #GtkSizeGroupMode of the size group. The mode of the size
group determines whether the widgets in the size group should
all have the same horizontal requisition (%GTK_SIZE_GROUP_MODE_HORIZONTAL)
all have the same vertical requisition (%GTK_SIZE_GROUP_MODE_VERTICAL),
or should all have the same requisition in both directions
(%GTK_SIZE_GROUP_MODE_BOTH).
a #GtkSizeGroup
the mode to set for the size group.
If %TRUE, unmapped widgets are ignored when determining
the size of the group.
The mode of the size group determines the directions in which the size
group affects the requested sizes of its component widgets.
group has no effect
group affects horizontal requisition
group affects vertical requisition
group affects both horizontal and vertical requisition
Together with #GtkPlug, #GtkSocket provides the ability
to embed widgets from one process into another process
in a fashion that is transparent to the user. One
process creates a #GtkSocket widget and passes
that widget's window ID to the other process,
which then creates a #GtkPlug with that window ID.
Any widgets contained in the #GtkPlug then will appear
inside the first application's window.
The socket's window ID is obtained by using
gtk_socket_get_id(). Before using this function,
the socket must have been realized, and for hence,
have been added to its parent.
<example>
<title>Obtaining the window ID of a socket.</title>
<programlisting>
GtkWidget *socket = gtk_socket_new (<!-- -->);
gtk_widget_show (socket);
gtk_container_add (GTK_CONTAINER (parent), socket);
/<!---->* The following call is only necessary if one of
* the ancestors of the socket is not yet visible.
*<!---->/
gtk_widget_realize (socket);
g_print ("The ID of the sockets window is %#x\n",
gtk_socket_get_id (socket));
</programlisting>
</example>
Note that if you pass the window ID of the socket to another
process that will create a plug in the socket, you
must make sure that the socket widget is not destroyed
until that plug is created. Violating this rule will
cause unpredictable consequences, the most likely
consequence being that the plug will appear as a
separate toplevel window. You can check if the plug
has been created by using gtk_socket_get_plug_window(). If
it returns a non-%NULL value, then the plug has been
successfully created inside of the socket.
When GTK+ is notified that the embedded window has been
destroyed, then it will destroy the socket as well. You
should always, therefore, be prepared for your sockets
to be destroyed at any time when the main event loop
is running. To prevent this from happening, you can
connect to the #GtkSocket::plug-removed signal.
The communication between a #GtkSocket and a #GtkPlug follows the
<ulink url="http://www.freedesktop.org/Standards/xembed-spec">XEmbed</ulink>
protocol. This protocol has also been implemented in other toolkits, e.g.
<application>Qt</application>, allowing the same level of integration
when embedding a <application>Qt</application> widget in GTK or vice versa.
A socket can also be used to swallow arbitrary
pre-existing top-level windows using gtk_socket_steal(),
though the integration when this is done will not be as close
as between a #GtkPlug and a #GtkSocket.
<note>
The #GtkPlug and #GtkSocket widgets are currently not available
on all platforms supported by GTK+.
</note>
Create a new empty #GtkSocket.
the new #GtkSocket.
Adds an XEMBED client, such as a #GtkPlug, to the #GtkSocket. The
client may be in the same process or in a different process.
To embed a #GtkPlug in a #GtkSocket, you can either create the
#GtkPlug with <literal>gtk_plug_new (0)</literal>, call
gtk_plug_get_id() to get the window ID of the plug, and then pass that to the
gtk_socket_add_id(), or you can call gtk_socket_get_id() to get the
window ID for the socket, and call gtk_plug_new() passing in that
ID.
The #GtkSocket must have already be added into a toplevel window
before you can make this call.
a #GtkSocket
the window ID of a client participating in the XEMBED protocol.
Gets the window ID of a #GtkSocket widget, which can then
be used to create a client embedded inside the socket, for
instance with gtk_plug_new().
The #GtkSocket must have already be added into a toplevel window
before you can make this call.
the window ID for the socket
a #GtkSocket.
Retrieves the window of the plug. Use this to check if the plug has
been created inside of the socket.
the window of the plug if available, or %NULL
a #GtkSocket.
Reparents a pre-existing toplevel window into a #GtkSocket. This is
meant to embed clients that do not know about embedding into a
#GtkSocket, however doing so is inherently unreliable, and using
this function is not recommended.
The #GtkSocket must have already be added into a toplevel window
before you can make this call.
a #GtkSocket
the window ID of an existing toplevel window.
This signal is emitted when a client is successfully
added to the socket.
This signal is emitted when a client is removed from the socket.
The default action is to destroy the #GtkSocket widget, so if you
want to reuse it you must add a signal handler that returns %TRUE.
%TRUE to stop other handlers from being invoked.
This is a convenience constructor that allows creation of a numeric
#GtkSpinButton without manually creating an adjustment. The value is
initially set to the minimum value and a page increment of 10 * @step
is the default. The precision of the spin button is equivalent to the
precision of @step.
Note that the way in which the precision is derived works best if @step
is a power of ten. If the resulting precision is not suitable for your
needs, use gtk_spin_button_set_digits() to correct it.
The new spin button as a #GtkWidget.
Minimum allowable value
Maximum allowable value
Increment added or subtracted by spinning the widget
Changes the properties of an existing spin button. The adjustment, climb rate,
and number of decimal places are all changed accordingly, after this function call.
a #GtkSpinButton
a #GtkAdjustment.
the new climb rate.
the number of decimal places to display in the spin button.
Get the adjustment associated with a #GtkSpinButton
the #GtkAdjustment of @spin_button
a #GtkSpinButton
Fetches the precision of @spin_button. See gtk_spin_button_set_digits().
the current precision
a #GtkSpinButton
Gets the current step and page the increments used by @spin_button. See
gtk_spin_button_set_increments().
a #GtkSpinButton
location to store step increment, or %NULL
location to store page increment, or %NULL
Returns whether non-numeric text can be typed into the spin button.
See gtk_spin_button_set_numeric().
%TRUE if only numeric text can be entered
a #GtkSpinButton
Gets the range allowed for @spin_button. See
gtk_spin_button_set_range().
a #GtkSpinButton
location to store minimum allowed value, or %NULL
location to store maximum allowed value, or %NULL
Returns whether the values are corrected to the nearest step. See
gtk_spin_button_set_snap_to_ticks().
%TRUE if values are snapped to the nearest step.
a #GtkSpinButton
Gets the update behavior of a spin button. See
gtk_spin_button_set_update_policy().
the current update policy
a #GtkSpinButton
Get the value in the @spin_button.
the value of @spin_button
a #GtkSpinButton
Get the value @spin_button represented as an integer.
the value of @spin_button
a #GtkSpinButton
Returns whether the spin button's value wraps around to the
opposite limit when the upper or lower limit of the range is
exceeded. See gtk_spin_button_set_wrap().
%TRUE if the spin button wraps around
a #GtkSpinButton
Replaces the #GtkAdjustment associated with @spin_button.
a #GtkSpinButton
a #GtkAdjustment to replace the existing adjustment
Set the precision to be displayed by @spin_button. Up to 20 digit precision
is allowed.
a #GtkSpinButton
the number of digits after the decimal point to be displayed for the spin button's value
Sets the step and page increments for spin_button. This affects how
quickly the value changes when the spin button's arrows are activated.
a #GtkSpinButton
increment applied for a button 1 press.
increment applied for a button 2 press.
Sets the flag that determines if non-numeric text can be typed into
the spin button.
a #GtkSpinButton
flag indicating if only numeric entry is allowed.
Sets the minimum and maximum allowable values for @spin_button
a #GtkSpinButton
minimum allowable value
maximum allowable value
Sets the policy as to whether values are corrected to the nearest step
increment when a spin button is activated after providing an invalid value.
a #GtkSpinButton
a flag indicating if invalid values should be corrected.
Sets the update behavior of a spin button. This determines whether the
spin button is always updated or only when a valid value is set.
a #GtkSpinButton
a #GtkSpinButtonUpdatePolicy value
Set the value of @spin_button.
a #GtkSpinButton
the new value
Sets the flag that determines if a spin button value wraps around to the
opposite limit when the upper or lower limit of the range is exceeded.
a #GtkSpinButton
a flag indicating if wrapping behavior is performed.
Increment or decrement a spin button's value in a specified direction
by a specified amount.
a #GtkSpinButton
a #GtkSpinType indicating the direction to spin.
step increment to apply in the specified direction.
Manually force an update of the spin button.
a #GtkSpinButton
The ::output signal can be used to change to formatting
of the value that is displayed in the spin buttons entry.
|[
/* show leading zeros */
static gboolean
on_output (GtkSpinButton *spin,
gpointer data)
{
GtkAdjustment *adj;
gchar *text;
int value;
adj = gtk_spin_button_get_adjustment (spin);
value = (int)gtk_adjustment_get_value (adj);
text = g_strdup_printf ("%02d", value);
gtk_entry_set_text (GTK_ENTRY (spin), text);
g_free (text);
return TRUE;
}
]|
%TRUE if the value has been displayed.
The wrapped signal is emitted right after the spinbutton wraps
from its maximum to minimum value or vice-versa.
A GtkSpinner widget displays an icon-size spinning animation.
It is often used as an alternative to a #GtkProgressBar for
displaying indefinite activity, instead of actual progress.
To start the animation, use gtk_spinner_start(), to stop it
use gtk_spinner_stop().
Returns a new spinner widget. Not yet started.
a new #GtkSpinner
Starts the animation of the spinner.
a #GtkSpinner
Stops the animation of the spinner.
a #GtkSpinner
Creates an empty status icon object.
a new #GtkStatusIcon
Creates a status icon displaying the file @filename.
The image will be scaled down to fit in the available
space in the notification area, if necessary.
a new #GtkStatusIcon
a filename
Creates a status icon displaying a #GIcon. If the icon is a
themed icon, it will be updated when the theme changes.
a new #GtkStatusIcon
a #GIcon
Creates a status icon displaying an icon from the current icon theme.
If the current icon theme is changed, the icon will be updated
appropriately.
a new #GtkStatusIcon
an icon name
Creates a status icon displaying @pixbuf.
The image will be scaled down to fit in the available
space in the notification area, if necessary.
a new #GtkStatusIcon
a #GdkPixbuf
Creates a status icon displaying a stock icon. Sample stock icon
names are #GTK_STOCK_OPEN, #GTK_STOCK_QUIT. You can register your
own stock icon names, see gtk_icon_factory_add_default() and
gtk_icon_factory_add().
a new #GtkStatusIcon
a stock icon id
Menu positioning function to use with gtk_menu_popup()
to position @menu aligned to the status icon @user_data.
the #GtkMenu
return location for the x position
return location for the y position
whether the first menu item should be offset (pushed in) to be
aligned with the menu popup position (only useful for GtkOptionMenu).
the status icon to position the menu on
Returns whether the icon is blinking, see
gtk_status_icon_set_blinking().
This function will be removed in GTK+ 3
%TRUE if the icon is blinking
a #GtkStatusIcon
Obtains information about the location of the status icon
on screen. This information can be used to e.g. position
popups like notification bubbles.
See gtk_status_icon_position_menu() for a more convenient
alternative for positioning menus.
Note that some platforms do not allow GTK+ to provide
this information, and even on platforms that do allow it,
the information is not reliable unless the status icon
is embedded in a notification area, see
gtk_status_icon_is_embedded().
%TRUE if the location information has
been filled in
a #GtkStatusIcon
return location for the screen, or %NULL if the
information is not needed
return location for the area occupied by the status
icon, or %NULL
return location for the orientation of the panel
in which the status icon is embedded, or %NULL. A panel
at the top or bottom of the screen is horizontal, a panel
at the left or right is vertical.
Retrieves the #GIcon being displayed by the #GtkStatusIcon.
The storage type of the status icon must be %GTK_IMAGE_EMPTY or
%GTK_IMAGE_GICON (see gtk_status_icon_get_storage_type()).
The caller of this function does not own a reference to the
returned #GIcon.
If this function fails, @icon is left unchanged;
the displayed icon, or %NULL if the image is empty
a #GtkStatusIcon
Returns the current value of the has-tooltip property.
See #GtkStatusIcon:has-tooltip for more information.
current value of has-tooltip on @status_icon.
a #GtkStatusIcon
Gets the name of the icon being displayed by the #GtkStatusIcon.
The storage type of the status icon must be %GTK_IMAGE_EMPTY or
%GTK_IMAGE_ICON_NAME (see gtk_status_icon_get_storage_type()).
The returned string is owned by the #GtkStatusIcon and should not
be freed or modified.
name of the displayed icon, or %NULL if the image is empty.
a #GtkStatusIcon
Gets the #GdkPixbuf being displayed by the #GtkStatusIcon.
The storage type of the status icon must be %GTK_IMAGE_EMPTY or
%GTK_IMAGE_PIXBUF (see gtk_status_icon_get_storage_type()).
The caller of this function does not own a reference to the
returned pixbuf.
the displayed pixbuf,
or %NULL if the image is empty.
a #GtkStatusIcon
Returns the #GdkScreen associated with @status_icon.
a #GdkScreen.
a #GtkStatusIcon
Gets the size in pixels that is available for the image.
Stock icons and named icons adapt their size automatically
if the size of the notification area changes. For other
storage types, the size-changed signal can be used to
react to size changes.
Note that the returned size is only meaningful while the
status icon is embedded (see gtk_status_icon_is_embedded()).
the size that is available for the image
a #GtkStatusIcon
Gets the id of the stock icon being displayed by the #GtkStatusIcon.
The storage type of the status icon must be %GTK_IMAGE_EMPTY or
%GTK_IMAGE_STOCK (see gtk_status_icon_get_storage_type()).
The returned string is owned by the #GtkStatusIcon and should not
be freed or modified.
stock id of the displayed stock icon,
or %NULL if the image is empty.
a #GtkStatusIcon
Gets the type of representation being used by the #GtkStatusIcon
to store image data. If the #GtkStatusIcon has no image data,
the return value will be %GTK_IMAGE_EMPTY.
the image representation being used
a #GtkStatusIcon
Gets the title of this tray icon. See gtk_status_icon_set_title().
the title of the status icon
a #GtkStatusIcon
Gets the contents of the tooltip for @status_icon.
the tooltip text, or %NULL. You should free the
returned string with g_free() when done.
a #GtkStatusIcon
Gets the contents of the tooltip for @status_icon.
the tooltip text, or %NULL. You should free the
returned string with g_free() when done.
a #GtkStatusIcon
Returns whether the status icon is visible or not.
Note that being visible does not guarantee that
the user can actually see the icon, see also
gtk_status_icon_is_embedded().
%TRUE if the status icon is visible
a #GtkStatusIcon
This function is only useful on the X11/freedesktop.org platform.
It returns a window ID for the widget in the underlying
status icon implementation. This is useful for the Galago
notification service, which can send a window ID in the protocol
in order for the server to position notification windows
pointing to a status icon reliably.
This function is not intended for other use cases which are
more likely to be met by one of the non-X11 specific methods, such
as gtk_status_icon_position_menu().
An 32 bit unsigned integer identifier for the
underlying X11 Window
a #GtkStatusIcon
Returns whether the status icon is embedded in a notification
area.
%TRUE if the status icon is embedded in
a notification area.
a #GtkStatusIcon
Makes the status icon start or stop blinking.
Note that blinking user interface elements may be problematic
for some users, and thus may be turned off, in which case
this setting has no effect.
This function will be removed in GTK+ 3
a #GtkStatusIcon
%TRUE to turn blinking on, %FALSE to turn it off
Makes @status_icon display the file @filename.
See gtk_status_icon_new_from_file() for details.
a #GtkStatusIcon
a filename
Makes @status_icon display the #GIcon.
See gtk_status_icon_new_from_gicon() for details.
a #GtkStatusIcon
a GIcon
Makes @status_icon display the icon named @icon_name from the
current icon theme.
See gtk_status_icon_new_from_icon_name() for details.
a #GtkStatusIcon
an icon name
Makes @status_icon display @pixbuf.
See gtk_status_icon_new_from_pixbuf() for details.
a #GtkStatusIcon
a #GdkPixbuf or %NULL
Makes @status_icon display the stock icon with the id @stock_id.
See gtk_status_icon_new_from_stock() for details.
a #GtkStatusIcon
a stock icon id
Sets the has-tooltip property on @status_icon to @has_tooltip.
See #GtkStatusIcon:has-tooltip for more information.
a #GtkStatusIcon
whether or not @status_icon has a tooltip
Sets the name of this tray icon.
This should be a string identifying this icon. It is may be
used for sorting the icons in the tray and will not be shown to
the user.
a #GtkStatusIcon
the name
Sets the #GdkScreen where @status_icon is displayed; if
the icon is already mapped, it will be unmapped, and
then remapped on the new screen.
a #GtkStatusIcon
a #GdkScreen
Sets the title of this tray icon.
This should be a short, human-readable, localized string
describing the tray icon. It may be used by tools like screen
readers to render the tray icon.
a #GtkStatusIcon
the title
Sets the tooltip of the status icon.
Use gtk_status_icon_set_tooltip_text() instead.
a #GtkStatusIcon
the tooltip text, or %NULL
Sets @markup as the contents of the tooltip, which is marked up with
the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
This function will take care of setting #GtkStatusIcon:has-tooltip to %TRUE
and of the default handler for the #GtkStatusIcon::query-tooltip signal.
See also the #GtkStatusIcon:tooltip-markup property and
gtk_tooltip_set_markup().
a #GtkStatusIcon
the contents of the tooltip for @status_icon, or %NULL
Sets @text as the contents of the tooltip.
This function will take care of setting #GtkStatusIcon:has-tooltip to
%TRUE and of the default handler for the #GtkStatusIcon::query-tooltip
signal.
See also the #GtkStatusIcon:tooltip-text property and
gtk_tooltip_set_text().
a #GtkStatusIcon
the contents of the tooltip for @status_icon
Shows or hides a status icon.
a #GtkStatusIcon
%TRUE to show the status icon, %FALSE to hide it
Whether or not the status icon is blinking.
This property will be removed in GTK+ 3
%TRUE if the statusicon is embedded in a notification area.
The #GIcon displayed in the #GtkStatusIcon. For themed icons,
the image will be updated automatically if the theme changes.
Enables or disables the emission of #GtkStatusIcon::query-tooltip on
@status_icon. A value of %TRUE indicates that @status_icon can have a
tooltip, in this case the status icon will be queried using
#GtkStatusIcon::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 windows of this status icon to include leave-notify
and motion-notify events. This will not be undone when the property is set
to %FALSE again.
Whether this property is respected is platform dependent.
For plain text tooltips, use #GtkStatusIcon:tooltip-text in preference.
The orientation of the tray in which the statusicon
is embedded.
The title of this tray icon. This should be a short, human-readable,
localized string describing the tray icon. It may be used by tools
like screen readers to render the tray icon.
Sets the text of tooltip to be the given string, which is marked up
with the <link linkend="PangoMarkupFormat">Pango text markup
language</link>. 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.
#GtkStatusIcon:has-tooltip will automatically be set to %TRUE and
the default handler for the #GtkStatusIcon::query-tooltip signal
will take care of displaying the tooltip.
On some platforms, embedded markup will be ignored.
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.
#GtkStatusIcon:has-tooltip will automatically be set to %TRUE and
the default handler for the #GtkStatusIcon::query-tooltip signal
will take care of displaying the tooltip.
Note that some platforms have limitations on the length of tooltips
that they allow on status icons, e.g. Windows only shows the first
64 characters.
Gets emitted when the user activates the status icon.
If and how status icons can activated is platform-dependent.
Unlike most G_SIGNAL_ACTION signals, this signal is meant to
be used by applications and should be wrapped by language bindings.
The ::button-press-event signal will be emitted when a button
(typically from a mouse) is pressed.
Whether this event is emitted is platform-dependent. Use the ::activate
and ::popup-menu signals in preference.
%TRUE to stop other handlers from being invoked
for the event. %FALSE to propagate the event further.
the #GdkEventButton which triggered this signal
The ::button-release-event signal will be emitted when a button
(typically from a mouse) is released.
Whether this event is emitted is platform-dependent. Use the ::activate
and ::popup-menu signals in preference.
%TRUE to stop other handlers from being invoked
for the event. %FALSE to propagate the event further.
the #GdkEventButton which triggered this signal
Gets emitted when the user brings up the context menu
of the status icon. Whether status icons can have context
menus and how these are activated is platform-dependent.
The @button and @activate_time parameters should be
passed as the last to arguments to gtk_menu_popup().
Unlike most G_SIGNAL_ACTION signals, this signal is meant to
be used by applications and should be wrapped by language bindings.
the button that was pressed, or 0 if the
signal is not emitted in response to a button press event
the timestamp of the event that
triggered the signal emission
Emitted when the #GtkSettings:gtk-tooltip-timeout has expired with the
cursor hovering above @status_icon; or emitted when @status_icon got
focus in keyboard mode.
Using the given coordinates, the signal handler should determine
whether a tooltip should be shown for @status_icon. If this is
the case %TRUE should be returned, %FALSE otherwise. Note that if
@keyboard_mode is %TRUE, the values of @x and @y are undefined and
should not be used.
The signal handler is free to manipulate @tooltip with the therefore
destined function calls.
Whether this signal is emitted is platform-dependent.
For plain text tooltips, use #GtkStatusIcon:tooltip-text in preference.
%TRUE if @tooltip should be shown right now, %FALSE otherwise.
the x coordinate of the cursor position where the request has been
emitted, relative to @status_icon
the y coordinate of the cursor position where the request has been
emitted, relative to @status_icon
%TRUE if the tooltip was trigged using the keyboard
a #GtkTooltip
The ::scroll-event signal is emitted when a button in the 4 to 7
range is pressed. Wheel mice are usually configured to generate
button press events for buttons 4 and 5 when the wheel is turned.
Whether this event is emitted is platform-dependent.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventScroll which triggered this signal
Gets emitted when the size available for the image
changes, e.g. because the notification area got resized.
%TRUE if the icon was updated for the new
size. Otherwise, GTK+ will scale the icon as necessary.
the new size
Creates a new #GtkStatusbar ready for messages.
the new #GtkStatusbar
Returns a new context identifier, given a description
of the actual context. Note that the description is
<emphasis>not</emphasis> shown in the UI.
an integer id
a #GtkStatusbar
textual description of what context
the new message is being used in
Returns whether the statusbar has a resize grip.
%TRUE if the statusbar has a resize grip.
a #GtkStatusBar
Retrieves the box containing the label widget.
a #GtkBox
a #GtkStatusBar
Removes the first message in the #GtkStatusBar's stack
with the given context id.
Note that this may not change the displayed message, if
the message at the top of the stack has a different
context id.
a #GtkStatusBar
a context identifier
Pushes a new message onto a statusbar's stack.
a message id that can be used with
gtk_statusbar_remove().
a #GtkStatusbar
the message's context id, as returned by
gtk_statusbar_get_context_id()
the message to add to the statusbar
Forces the removal of a message from a statusbar's stack.
The exact @context_id and @message_id must be specified.
a #GtkStatusBar
a context identifier
a message identifier, as returned by gtk_statusbar_push()
Forces the removal of all messages from a statusbar's
stack with the exact @context_id.
a #GtkStatusBar
a context identifier
Sets whether the statusbar has a resize grip.
%TRUE by default.
a #GtkStatusBar
%TRUE to have a resize grip
Whether the statusbar has a grip for resizing the toplevel window.
Is emitted whenever a new message is popped off a statusbar's stack.
the context id of the relevant message/statusbar.
the message that was just popped.
Is emitted whenever a new message gets pushed onto a statusbar's stack.
the context id of the relevant message/statusbar.
the message that was pushed.
Copies a stock item, mostly useful for language bindings and not in applications.
a new #GtkStockItem
a #GtkStockItem
Frees a stock item allocated on the heap, such as one returned by
gtk_stock_item_copy(). Also frees the fields inside the stock item,
if they are not %NULL.
a #GtkStockItem
Creates a new #GtkStyle.
a new #GtkStyle.
Renders the icon specified by @source at the given @size
according to the given parameters and returns the result in a
pixbuf.
a newly-created #GdkPixbuf
containing the rendered icon
a #GtkStyle
the #GtkIconSource specifying the icon to render
a text direction
a state
the size to render the icon at. A size of
(GtkIconSize)-1 means render at the size of the source and
don't scale.
the widget
a style detail
Sets the background of @window to the background color or pixmap
specified by @style for the given state.
a #GtkStyle
a #GdkWindow
a state
Attaches a style to a window; this process allocates the
colors and creates the GC's for the style - it specializes
it to a particular visual and colormap. The process may
involve the creation of a new style if the style has already
been attached to a window with a different style and colormap.
Since this function may return a new object, you have to use it
in the following way:
<literal>style = gtk_style_attach (style, window)</literal>
Either @style, or a newly-created #GtkStyle.
If the style is newly created, the style parameter
will be unref'ed, and the new style will have
a reference count belonging to the caller.
a #GtkStyle.
a #GdkWindow.
Creates a copy of the passed in #GtkStyle object.
a copy of @style
a #GtkStyle
Detaches a style from a window. If the style is not attached
to any windows anymore, it is unrealized. See gtk_style_attach().
a #GtkStyle
Gets the values of a multiple style properties for @widget_type
from @style.
a #GtkStyle
the #GType of a descendant of #GtkWidget
the name of the first style property to get
pairs of property names and locations to
return the property values, starting with the location for
@first_property_name, terminated by %NULL.
Gets the #GdkFont to use for the given style. This is
meant only as a replacement for direct access to @style->font
and should not be used in new code. New code should
use @style->font_desc instead.
the #GdkFont for the style. This font is owned
by the style; if you want to keep around a copy, you must
call gdk_font_ref().
a #GtkStyle
Queries the value of a style property corresponding to a
widget class is in the given style.
a #GtkStyle
the #GType of a descendant of #GtkWidget
the name of the style property to get
a #GValue where the value of the property being
queried will be stored
Non-vararg variant of gtk_style_get().
Used primarily by language bindings.
a #GtkStyle
the #GType of a descendant of #GtkWidget
the name of the first style property to get
a <type>va_list</type> of pairs of property names and
locations to return the property values, starting with the
location for @first_property_name.
Looks up @color_name in the style's logical color mappings,
filling in @color and returning %TRUE if found, otherwise
returning %FALSE. Do not cache the found mapping, because
it depends on the #GtkStyle and might change when a theme
switch occurs.
%TRUE if the mapping was found.
a #GtkStyle
the name of the logical color to look up
the #GdkColor to fill in
Looks up @stock_id in the icon factories associated with @style
and the default icon factory, returning an icon set if found,
otherwise %NULL.
icon set of @stock_id
a #GtkStyle
an icon name
Increase the reference count of @style.
use g_object_ref() instead.
@style.
a #GtkStyle.
Renders the icon specified by @source at the given @size
according to the given parameters and returns the result in a
pixbuf.
a newly-created #GdkPixbuf
containing the rendered icon
a #GtkStyle
the #GtkIconSource specifying the icon to render
a text direction
a state
the size to render the icon at. A size of
(GtkIconSize)-1 means render at the size of the source and
don't scale.
the widget
a style detail
Sets the background of @window to the background color or pixmap
specified by @style for the given state.
a #GtkStyle
a #GdkWindow
a state
Sets the #GdkFont to use for a given style. This is
meant only as a replacement for direct access to style->font
and should not be used in new code. New code should
use style->font_desc instead.
a #GtkStyle.
a #GdkFont, or %NULL to use the #GdkFont corresponding
to style->font_desc.
Decrease the reference count of @style.
use g_object_unref() instead.
a #GtkStyle.
Emitted when the style has been initialized for a particular
colormap and depth. Connecting to this signal is probably seldom
useful since most of the time applications and widgets only
deal with styles that have been already realized.
Emitted when the aspects of the style specific to a particular colormap
and depth are being cleaned up. A connection to this signal can be useful
if a widget wants to cache objects like a #GdkGC as object data on #GtkStyle.
This signal provides a convenient place to free such cached objects.
a #GtkStyle
a #GdkWindow
a state
a newly-created #GdkPixbuf
containing the rendered icon
a #GtkStyle
the #GtkIconSource specifying the icon to render
a text direction
a state
the size to render the icon at. A size of
(GtkIconSize)-1 means render at the size of the source and
don't scale.
the widget
a style detail
Gets the amount of space between column @col, and
column @col + 1. See gtk_table_set_col_spacing().
the column spacing
a #GtkTable
a column in the table, 0 indicates the first column
Gets the default column spacing for the table. This is
the spacing that will be used for newly added columns.
(See gtk_table_set_col_spacings())
the default column spacing
a #GtkTable
Gets the default row spacing for the table. This is
the spacing that will be used for newly added rows.
(See gtk_table_set_row_spacings())
the default row spacing
a #GtkTable
Returns whether the table cells are all constrained to the same
width and height. (See gtk_table_set_homogenous ())
%TRUE if the cells are all constrained to the same size
a #GtkTable
Gets the amount of space between row @row, and
row @row + 1. See gtk_table_set_row_spacing().
the row spacing
a #GtkTable
a row in the table, 0 indicates the first row
Returns the number of rows and columns in the table.
a #GtkTable
return location for the number of
rows, or %NULL
return location for the number
of columns, or %NULL
Creates a new #GtkTargetList from an array of #GtkTargetEntry.
the new #GtkTargetList.
Pointer to an array of #GtkTargetEntry
number of entries in @targets.
Appends another target to a #GtkTargetList.
a #GtkTargetList
the interned atom representing the target
the flags for this target
an ID that will be passed back to the application
Appends the image targets supported by #GtkSelection to
the target list. All targets are added with the same @info.
a #GtkTargetList
an ID that will be passed back to the application
whether to add only targets for which GTK+ knows
how to convert a pixbuf into the format
Appends the rich text targets registered with
gtk_text_buffer_register_serialize_format() or
gtk_text_buffer_register_deserialize_format() to the target list. All
targets are added with the same @info.
a #GtkTargetList
an ID that will be passed back to the application
if %TRUE, then deserializable rich text formats
will be added, serializable formats otherwise.
a #GtkTextBuffer.
Prepends a table of #GtkTargetEntry to a target list.
a #GtkTargetList
the table of #GtkTargetEntry
number of targets in the table
Appends the text targets supported by #GtkSelection to
the target list. All targets are added with the same @info.
a #GtkTargetList
an ID that will be passed back to the application
Appends the URI targets supported by #GtkSelection to
the target list. All targets are added with the same @info.
a #GtkTargetList
an ID that will be passed back to the application
Looks up a given target in a #GtkTargetList.
%TRUE if the target was found, otherwise %FALSE
a #GtkTargetList
an interned atom representing the target to search for
a pointer to the location to store application info for target,
or %NULL
Increases the reference count of a #GtkTargetList by one.
the passed in #GtkTargetList.
a #GtkTargetList
Removes a target from a target list.
a #GtkTargetList
the interned atom representing the target
Decreases the reference count of a #GtkTargetList by one.
If the resulting reference count is zero, frees the list.
a #GtkTargetList
Creates a #GtkTextAttributes, which describes
a set of properties on some text.
a new #GtkTextAttributes
Copies @src and returns a new #GtkTextAttributes.
a copy of @src
a #GtkTextAttributes to be copied
Copies the values from @src to @dest so that @dest has the same values
as @src. Frees existing values in @dest.
a #GtkTextAttributes
another #GtkTextAttributes
Increments the reference count on @values.
the #GtkTextAttributes that were passed in
a #GtkTextAttributes
Decrements the reference count on @values, freeing the structure
if the reference count reaches 0.
a #GtkTextAttributes
Creates a new text buffer.
a new text buffer
a tag table, or %NULL to create a new one
Emits the "apply-tag" signal on @buffer. The default
handler for the signal applies @tag to the given range.
@start and @end do not have to be in order.
a #GtkTextBuffer
a #GtkTextTag
Called to indicate that the buffer operations between here and a
call to gtk_text_buffer_end_user_action() are part of a single
user-visible operation. The operations between
gtk_text_buffer_begin_user_action() and
gtk_text_buffer_end_user_action() can then be grouped when creating
an undo stack. #GtkTextBuffer maintains a count of calls to
gtk_text_buffer_begin_user_action() that have not been closed with
a call to gtk_text_buffer_end_user_action(), and emits the
"begin-user-action" and "end-user-action" signals only for the
outermost pair of calls. This allows you to build user actions
from other user actions.
The "interactive" buffer mutation functions, such as
gtk_text_buffer_insert_interactive(), automatically call begin/end
user action around the buffer operations they perform, so there's
no need to add extra calls if you user action consists solely of a
single call to one of those functions.
a #GtkTextBuffer
Should be paired with a call to gtk_text_buffer_begin_user_action().
See that function for a full explanation.
a #GtkTextBuffer
Inserts a child widget anchor into the text buffer at @iter. The
anchor will be counted as one character in character counts, and
when obtaining the buffer contents as a string, will be represented
by the Unicode "object replacement character" 0xFFFC. Note that the
"slice" variants for obtaining portions of the buffer as a string
include this character for child anchors, but the "text" variants do
not. E.g. see gtk_text_buffer_get_slice() and
gtk_text_buffer_get_text(). Consider
gtk_text_buffer_create_child_anchor() as a more convenient
alternative to this function. The buffer will add a reference to
the anchor, so you can unref it after insertion.
a #GtkTextBuffer
a #GtkTextChildAnchor
Inserts an image into the text buffer at @iter. The image will be
counted as one character in character counts, and when obtaining
the buffer contents as a string, will be represented by the Unicode
"object replacement character" 0xFFFC. Note that the "slice"
variants for obtaining portions of the buffer as a string include
this character for pixbufs, but the "text" variants do
not. e.g. see gtk_text_buffer_get_slice() and
gtk_text_buffer_get_text().
a #GtkTextBuffer
a #GdkPixbuf
Emits the "remove-tag" signal. The default handler for the signal
removes all occurrences of @tag from the given range. @start and
@end don't have to be in order.
a #GtkTextBuffer
a #GtkTextTag
Adds the mark at position @where. The mark must not be added to
another buffer, and if its name is not %NULL then there must not
be another mark in the buffer with the same name.
Emits the "mark-set" signal as notification of the mark's initial
placement.
a #GtkTextBuffer
the mark to add
location to place mark
Adds @clipboard to the list of clipboards in which the selection
contents of @buffer are available. In most cases, @clipboard will be
the #GtkClipboard of type %GDK_SELECTION_PRIMARY for a view of @buffer.
a #GtkTextBuffer
a #GtkClipboard
Emits the "apply-tag" signal on @buffer. The default
handler for the signal applies @tag to the given range.
@start and @end do not have to be in order.
a #GtkTextBuffer
a #GtkTextTag
one bound of range to be tagged
other bound of range to be tagged
Calls gtk_text_tag_table_lookup() on the buffer's tag table to
get a #GtkTextTag, then calls gtk_text_buffer_apply_tag().
a #GtkTextBuffer
name of a named #GtkTextTag
one bound of range to be tagged
other bound of range to be tagged
Performs the appropriate action as if the user hit the delete
key with the cursor at the position specified by @iter. In the
normal case a single character will be deleted, but when
combining accents are involved, more than one character can
be deleted, and when precomposed character and accent combinations
are involved, less than one character will be deleted.
Because the buffer is modified, all outstanding iterators become
invalid after calling this function; however, the @iter will be
re-initialized to point to the location where text was deleted.
%TRUE if the buffer was modified
a #GtkTextBuffer
a position in @buffer
whether the deletion is caused by user interaction
whether the buffer is editable by default
Called to indicate that the buffer operations between here and a
call to gtk_text_buffer_end_user_action() are part of a single
user-visible operation. The operations between
gtk_text_buffer_begin_user_action() and
gtk_text_buffer_end_user_action() can then be grouped when creating
an undo stack. #GtkTextBuffer maintains a count of calls to
gtk_text_buffer_begin_user_action() that have not been closed with
a call to gtk_text_buffer_end_user_action(), and emits the
"begin-user-action" and "end-user-action" signals only for the
outermost pair of calls. This allows you to build user actions
from other user actions.
The "interactive" buffer mutation functions, such as
gtk_text_buffer_insert_interactive(), automatically call begin/end
user action around the buffer operations they perform, so there's
no need to add extra calls if you user action consists solely of a
single call to one of those functions.
a #GtkTextBuffer
Copies the currently-selected text to a clipboard.
a #GtkTextBuffer
the #GtkClipboard object to copy to
This is a convenience function which simply creates a child anchor
with gtk_text_child_anchor_new() and inserts it into the buffer
with gtk_text_buffer_insert_child_anchor(). The new anchor is
owned by the buffer; no reference count is returned to
the caller of gtk_text_buffer_create_child_anchor().
the created child anchor
a #GtkTextBuffer
location in the buffer
Creates a mark at position @where. If @mark_name is %NULL, the mark
is anonymous; otherwise, the mark can be retrieved by name using
gtk_text_buffer_get_mark(). If a mark has left gravity, and text is
inserted at the mark's current location, the mark will be moved to
the left of the newly-inserted text. If the mark has right gravity
(@left_gravity = %FALSE), the mark will end up on the right of
newly-inserted text. The standard left-to-right cursor is a mark
with right gravity (when you type, the cursor stays on the right
side of the text you're typing).
The caller of this function does <emphasis>not</emphasis> own a
reference to the returned #GtkTextMark, so you can ignore the
return value if you like. Marks are owned by the buffer and go
away when the buffer does.
Emits the "mark-set" signal as notification of the mark's initial
placement.
the new #GtkTextMark object
a #GtkTextBuffer
name for mark, or %NULL
location to place mark
whether the mark has left gravity
Creates a tag and adds it to the tag table for @buffer.
Equivalent to calling gtk_text_tag_new() and then adding the
tag to the buffer's tag table. The returned tag is owned by
the buffer's tag table, so the ref count will be equal to one.
If @tag_name is %NULL, the tag is anonymous.
If @tag_name is non-%NULL, a tag called @tag_name must not already
exist in the tag table for this buffer.
The @first_property_name argument and subsequent arguments are a list
of properties to set on the tag, as with g_object_set().
a new tag
a #GtkTextBuffer
name of the new tag, or %NULL
name of first property to set, or %NULL
%NULL-terminated list of property names and values
Copies the currently-selected text to a clipboard, then deletes
said text if it's editable.
a #GtkTextBuffer
the #GtkClipboard object to cut to
default editability of the buffer
Deletes text between @start and @end. The order of @start and @end
is not actually relevant; gtk_text_buffer_delete() will reorder
them. This function actually emits the "delete-range" signal, and
the default handler of that signal deletes the text. Because the
buffer is modified, all outstanding iterators become invalid after
calling this function; however, the @start and @end will be
re-initialized to point to the location where text was deleted.
a #GtkTextBuffer
a position in @buffer
another position in @buffer
Deletes all <emphasis>editable</emphasis> text in the given range.
Calls gtk_text_buffer_delete() for each editable sub-range of
[@start,@end). @start and @end are revalidated to point to
the location of the last deleted range, or left untouched if
no text was deleted.
whether some text was actually deleted
a #GtkTextBuffer
start of range to delete
end of range
whether the buffer is editable by default
Deletes @mark, so that it's no longer located anywhere in the
buffer. Removes the reference the buffer holds to the mark, so if
you haven't called g_object_ref() on the mark, it will be freed. Even
if the mark isn't freed, most operations on @mark become
invalid, until it gets added to a buffer again with
gtk_text_buffer_add_mark(). Use gtk_text_mark_get_deleted() to
find out if a mark has been removed from its buffer.
The "mark-deleted" signal will be emitted as notification after
the mark is deleted.
a #GtkTextBuffer
a #GtkTextMark in @buffer
Deletes the mark named @name; the mark must exist. See
gtk_text_buffer_delete_mark() for details.
a #GtkTextBuffer
name of a mark in @buffer
Deletes the range between the "insert" and "selection_bound" marks,
that is, the currently-selected text. If @interactive is %TRUE,
the editability of the selection will be considered (users can't delete
uneditable text).
whether there was a non-empty selection to delete
a #GtkTextBuffer
whether the deletion is caused by user interaction
whether the buffer is editable by default
This function deserializes rich text in format @format and inserts
it at @iter.
@format<!-- -->s to be used must be registered using
gtk_text_buffer_register_deserialize_format() or
gtk_text_buffer_register_deserialize_tagset() beforehand.
%TRUE on success, %FALSE otherwise.
the #GtkTextBuffer @format is registered with
the #GtkTextBuffer to deserialize into
the rich text format to use for deserializing
insertion point for the deserialized text
data to deserialize
length of @data
This functions returns the value set with
gtk_text_buffer_deserialize_set_can_create_tags()
whether deserializing this format may create tags
a #GtkTextBuffer
a #GdkAtom representing a registered rich text format
Use this function to allow a rich text deserialization function to
create new tags in the receiving buffer. Note that using this
function is almost always a bad idea, because the rich text
functions you register should know how to map the rich text format
they handler to your text buffers set of tags.
The ability of creating new (arbitrary!) tags in the receiving buffer
is meant for special rich text formats like the internal one that
is registered using gtk_text_buffer_register_deserialize_tagset(),
because that format is essentially a dump of the internal structure
of the source buffer, including its tag names.
You should allow creation of tags only if you know what you are
doing, e.g. if you defined a tagset name for your application
suite's text buffers and you know that it's fine to receive new
tags from these buffers, because you know that your application can
handle the newly created tags.
a #GtkTextBuffer
a #GdkAtom representing a registered rich text format
whether deserializing this format may create tags
Should be paired with a call to gtk_text_buffer_begin_user_action().
See that function for a full explanation.
a #GtkTextBuffer
Retrieves the first and last iterators in the buffer, i.e. the
entire buffer lies within the range [@start,@end).
a #GtkTextBuffer
iterator to initialize with first position in the buffer
iterator to initialize with the end iterator
Gets the number of characters in the buffer; note that characters
and bytes are not the same, you can't e.g. expect the contents of
the buffer in string form to be this many bytes long. The character
count is cached, so this function is very fast.
number of characters in the buffer
a #GtkTextBuffer
This function returns the list of targets this text buffer can
provide for copying and as DND source. The targets in the list are
added with %info values from the #GtkTextBufferTargetInfo enum,
using gtk_target_list_add_rich_text_targets() and
gtk_target_list_add_text_targets().
the #GtkTargetList
a #GtkTextBuffer
This function returns the rich text deserialize formats registered
with @buffer using gtk_text_buffer_register_deserialize_format() or
gtk_text_buffer_register_deserialize_tagset()
an array of
#GdkAtom<!-- -->s representing the registered formats.
a #GtkTextBuffer
return location for the number of formats
Initializes @iter with the "end iterator," one past the last valid
character in the text buffer. If dereferenced with
gtk_text_iter_get_char(), the end iterator has a character value of
0. The entire buffer lies in the range from the first position in
the buffer (call gtk_text_buffer_get_start_iter() to get
character position 0) to the end iterator.
a #GtkTextBuffer
iterator to initialize
Indicates whether the buffer has some text currently selected.
%TRUE if the there is text selected
a #GtkTextBuffer
Returns the mark that represents the cursor (insertion point).
Equivalent to calling gtk_text_buffer_get_mark() to get the mark
named "insert", but very slightly more efficient, and involves less
typing.
insertion point mark
a #GtkTextBuffer
Obtains the location of @anchor within @buffer.
a #GtkTextBuffer
an iterator to be initialized
a child anchor that appears in @buffer
Initializes @iter to the start of the given line.
a #GtkTextBuffer
iterator to initialize
line number counting from 0
Obtains an iterator pointing to @byte_index within the given line.
@byte_index must be the start of a UTF-8 character, and must not be
beyond the end of the line. Note <emphasis>bytes</emphasis>, not
characters; UTF-8 may encode one character as multiple bytes.
a #GtkTextBuffer
iterator to initialize
line number counting from 0
byte index from start of line
Obtains an iterator pointing to @char_offset within the given
line. The @char_offset must exist, offsets off the end of the line
are not allowed. Note <emphasis>characters</emphasis>, not bytes;
UTF-8 may encode one character as multiple bytes.
a #GtkTextBuffer
iterator to initialize
line number counting from 0
char offset from start of line
Initializes @iter with the current position of @mark.
a #GtkTextBuffer
iterator to initialize
a #GtkTextMark in @buffer
Initializes @iter to a position @char_offset chars from the start
of the entire buffer. If @char_offset is -1 or greater than the number
of characters in the buffer, @iter is initialized to the end iterator,
the iterator one past the last valid character in the buffer.
a #GtkTextBuffer
iterator to initialize
char offset from start of buffer, counting from 0, or -1
Obtains the number of lines in the buffer. This value is cached, so
the function is very fast.
number of lines in the buffer
a #GtkTextBuffer
Returns the mark named @name in buffer @buffer, or %NULL if no such
mark exists in the buffer.
a #GtkTextMark, or %NULL
a #GtkTextBuffer
a mark name
Indicates whether the buffer has been modified since the last call
to gtk_text_buffer_set_modified() set the modification flag to
%FALSE. Used for example to enable a "save" function in a text
editor.
%TRUE if the buffer has been modified
a #GtkTextBuffer
This function returns the list of targets this text buffer supports
for pasting and as DND destination. The targets in the list are
added with %info values from the #GtkTextBufferTargetInfo enum,
using gtk_target_list_add_rich_text_targets() and
gtk_target_list_add_text_targets().
the #GtkTargetList
a #GtkTextBuffer
Returns the mark that represents the selection bound. Equivalent
to calling gtk_text_buffer_get_mark() to get the mark named
"selection_bound", but very slightly more efficient, and involves
less typing.
The currently-selected text in @buffer is the region between the
"selection_bound" and "insert" marks. If "selection_bound" and
"insert" are in the same place, then there is no current selection.
gtk_text_buffer_get_selection_bounds() is another convenient function
for handling the selection, if you just want to know whether there's a
selection and what its bounds are.
selection bound mark
a #GtkTextBuffer
Returns %TRUE if some text is selected; places the bounds
of the selection in @start and @end (if the selection has length 0,
then @start and @end are filled in with the same value).
@start and @end will be in ascending order. If @start and @end are
NULL, then they are not filled in, but the return value still indicates
whether text is selected.
whether the selection has nonzero length
a #GtkTextBuffer a #GtkTextBuffer
iterator to initialize with selection start
iterator to initialize with selection end
This function returns the rich text serialize formats registered
with @buffer using gtk_text_buffer_register_serialize_format() or
gtk_text_buffer_register_serialize_tagset()
an array of
#GdkAtom<!-- -->s representing the registered formats.
a #GtkTextBuffer
return location for the number of formats
Returns the text in the range [@start,@end). Excludes undisplayed
text (text marked with tags that set the invisibility attribute) if
@include_hidden_chars is %FALSE. The returned string includes a
0xFFFC character whenever the buffer contains
embedded images, so byte and character indexes into
the returned string <emphasis>do</emphasis> correspond to byte
and character indexes into the buffer. Contrast with
gtk_text_buffer_get_text(). Note that 0xFFFC can occur in normal
text as well, so it is not a reliable indicator that a pixbuf or
widget is in the buffer.
an allocated UTF-8 string
a #GtkTextBuffer
start of a range
end of a range
whether to include invisible text
Initialized @iter with the first position in the text buffer. This
is the same as using gtk_text_buffer_get_iter_at_offset() to get
the iter at character offset 0.
a #GtkTextBuffer
iterator to initialize
Get the #GtkTextTagTable associated with this buffer.
the buffer's tag table
a #GtkTextBuffer
Returns the text in the range [@start,@end). Excludes undisplayed
text (text marked with tags that set the invisibility attribute) if
@include_hidden_chars is %FALSE. Does not include characters
representing embedded images, so byte and character indexes into
the returned string do <emphasis>not</emphasis> correspond to byte
and character indexes into the buffer. Contrast with
gtk_text_buffer_get_slice().
an allocated UTF-8 string
a #GtkTextBuffer
start of a range
end of a range
whether to include invisible text
Inserts @len bytes of @text at position @iter. If @len is -1,
@text must be nul-terminated and will be inserted in its
entirety. Emits the "insert-text" signal; insertion actually occurs
in the default handler for the signal. @iter is invalidated when
insertion occurs (because the buffer contents change), but the
default signal handler revalidates it to point to the end of the
inserted text.
a #GtkTextBuffer
a position in the buffer
text in UTF-8 format
length of text in bytes, or -1
Simply calls gtk_text_buffer_insert(), using the current
cursor position as the insertion point.
a #GtkTextBuffer
text in UTF-8 format
length of text, in bytes
Inserts a child widget anchor into the text buffer at @iter. The
anchor will be counted as one character in character counts, and
when obtaining the buffer contents as a string, will be represented
by the Unicode "object replacement character" 0xFFFC. Note that the
"slice" variants for obtaining portions of the buffer as a string
include this character for child anchors, but the "text" variants do
not. E.g. see gtk_text_buffer_get_slice() and
gtk_text_buffer_get_text(). Consider
gtk_text_buffer_create_child_anchor() as a more convenient
alternative to this function. The buffer will add a reference to
the anchor, so you can unref it after insertion.
a #GtkTextBuffer
location to insert the anchor
a #GtkTextChildAnchor
Like gtk_text_buffer_insert(), but the insertion will not occur if
@iter is at a non-editable location in the buffer. Usually you
want to prevent insertions at ineditable locations if the insertion
results from a user action (is interactive).
@default_editable indicates the editability of text that doesn't
have a tag affecting editability applied to it. Typically the
result of gtk_text_view_get_editable() is appropriate here.
whether text was actually inserted
a #GtkTextBuffer
a position in @buffer
some UTF-8 text
length of text in bytes, or -1
default editability of buffer
Calls gtk_text_buffer_insert_interactive() at the cursor
position.
@default_editable indicates the editability of text that doesn't
have a tag affecting editability applied to it. Typically the
result of gtk_text_view_get_editable() is appropriate here.
whether text was actually inserted
a #GtkTextBuffer
text in UTF-8 format
length of text in bytes, or -1
default editability of buffer
Inserts an image into the text buffer at @iter. The image will be
counted as one character in character counts, and when obtaining
the buffer contents as a string, will be represented by the Unicode
"object replacement character" 0xFFFC. Note that the "slice"
variants for obtaining portions of the buffer as a string include
this character for pixbufs, but the "text" variants do
not. e.g. see gtk_text_buffer_get_slice() and
gtk_text_buffer_get_text().
a #GtkTextBuffer
location to insert the pixbuf
a #GdkPixbuf
Copies text, tags, and pixbufs between @start and @end (the order
of @start and @end doesn't matter) and inserts the copy at @iter.
Used instead of simply getting/inserting text because it preserves
images and tags. If @start and @end are in a different buffer from
@buffer, the two buffers must share the same tag table.
Implemented via emissions of the insert_text and apply_tag signals,
so expect those.
a #GtkTextBuffer
a position in @buffer
a position in a #GtkTextBuffer
another position in the same buffer as @start
Same as gtk_text_buffer_insert_range(), but does nothing if the
insertion point isn't editable. The @default_editable parameter
indicates whether the text is editable at @iter if no tags
enclosing @iter affect editability. Typically the result of
gtk_text_view_get_editable() is appropriate here.
whether an insertion was possible at @iter
a #GtkTextBuffer
a position in @buffer
a position in a #GtkTextBuffer
another position in the same buffer as @start
default editability of the buffer
Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text. The last tag specified must be NULL to
terminate the list. Equivalent to calling gtk_text_buffer_insert(),
then gtk_text_buffer_apply_tag() on the inserted text;
gtk_text_buffer_insert_with_tags() is just a convenience function.
a #GtkTextBuffer
an iterator in @buffer
UTF-8 text
length of @text, or -1
first tag to apply to @text
NULL-terminated list of tags to apply
Same as gtk_text_buffer_insert_with_tags(), but allows you
to pass in tag names instead of tag objects.
a #GtkTextBuffer
position in @buffer
UTF-8 text
length of @text, or -1
name of a tag to apply to @text
more tag names
Moves @mark to the new location @where. Emits the "mark-set" signal
as notification of the move.
a #GtkTextBuffer
a #GtkTextMark
new location for @mark in @buffer
Moves the mark named @name (which must exist) to location @where.
See gtk_text_buffer_move_mark() for details.
a #GtkTextBuffer
name of a mark
new location for mark
Pastes the contents of a clipboard at the insertion point, or
at @override_location. (Note: pasting is asynchronous, that is,
we'll ask for the paste data and return, and at some point later
after the main loop runs, the paste data will be inserted.)
a #GtkTextBuffer
the #GtkClipboard to paste from
location to insert pasted text, or %NULL for
at the cursor
whether the buffer is editable by default
This function moves the "insert" and "selection_bound" marks
simultaneously. If you move them to the same place in two steps
with gtk_text_buffer_move_mark(), you will temporarily select a
region in between their old and new locations, which can be pretty
inefficient since the temporarily-selected region will force stuff
to be recalculated. This function moves them as a unit, which can
be optimized.
a #GtkTextBuffer
where to put the cursor
This function registers a rich text deserialization @function along with
its @mime_type with the passed @buffer.
the #GdkAtom that corresponds to the
newly registered format's mime-type.
a #GtkTextBuffer
the format's mime-type
the deserialize function to register
@function's user_data
a function to call when @user_data is no longer needed
This function registers GTK+'s internal rich text serialization
format with the passed @buffer. See
gtk_text_buffer_register_serialize_tagset() for details.
the #GdkAtom that corresponds to the
newly registered format's mime-type.
a #GtkTextBuffer
an optional tagset name, on %NULL
This function registers a rich text serialization @function along with
its @mime_type with the passed @buffer.
the #GdkAtom that corresponds to the
newly registered format's mime-type.
a #GtkTextBuffer
the format's mime-type
the serialize function to register
%function's user_data
a function to call when @user_data is no longer needed
This function registers GTK+'s internal rich text serialization
format with the passed @buffer. The internal format does not comply
to any standard rich text format and only works between #GtkTextBuffer
instances. It is capable of serializing all of a text buffer's tags
and embedded pixbufs.
This function is just a wrapper around
gtk_text_buffer_register_serialize_format(). The mime type used
for registering is "application/x-gtk-text-buffer-rich-text", or
"application/x-gtk-text-buffer-rich-text;format=@tagset_name" if a
@tagset_name was passed.
The @tagset_name can be used to restrict the transfer of rich text
to buffers with compatible sets of tags, in order to avoid unknown
tags from being pasted. It is probably the common case to pass an
identifier != %NULL here, since the %NULL tagset requires the
receiving buffer to deal with with pasting of arbitrary tags.
the #GdkAtom that corresponds to the
newly registered format's mime-type.
a #GtkTextBuffer
an optional tagset name, on %NULL
Removes all tags in the range between @start and @end. Be careful
with this function; it could remove tags added in code unrelated to
the code you're currently writing. That is, using this function is
probably a bad idea if you have two or more unrelated code sections
that add tags.
a #GtkTextBuffer
one bound of range to be untagged
other bound of range to be untagged
Removes a #GtkClipboard added with
gtk_text_buffer_add_selection_clipboard().
a #GtkTextBuffer
a #GtkClipboard added to @buffer by
gtk_text_buffer_add_selection_clipboard()
Emits the "remove-tag" signal. The default handler for the signal
removes all occurrences of @tag from the given range. @start and
@end don't have to be in order.
a #GtkTextBuffer
a #GtkTextTag
one bound of range to be untagged
other bound of range to be untagged
Calls gtk_text_tag_table_lookup() on the buffer's tag table to
get a #GtkTextTag, then calls gtk_text_buffer_remove_tag().
a #GtkTextBuffer
name of a #GtkTextTag
one bound of range to be untagged
other bound of range to be untagged
This function moves the "insert" and "selection_bound" marks
simultaneously. If you move them in two steps
with gtk_text_buffer_move_mark(), you will temporarily select a
region in between their old and new locations, which can be pretty
inefficient since the temporarily-selected region will force stuff
to be recalculated. This function moves them as a unit, which can
be optimized.
a #GtkTextBuffer
where to put the "insert" mark
where to put the "selection_bound" mark
This function serializes the portion of text between @start
and @end in the rich text format represented by @format.
@format<!-- -->s to be used must be registered using
gtk_text_buffer_register_serialize_format() or
gtk_text_buffer_register_serialize_tagset() beforehand.
the serialized
data, encoded as @format
the #GtkTextBuffer @format is registered with
the #GtkTextBuffer to serialize
the rich text format to use for serializing
start of block of text to serialize
end of block of test to serialize
return location for the length of the serialized data
Used to keep track of whether the buffer has been modified since the
last time it was saved. Whenever the buffer is saved to disk, call
gtk_text_buffer_set_modified (@buffer, FALSE). When the buffer is modified,
it will automatically toggled on the modified bit again. When the modified
bit flips, the buffer emits a "modified-changed" signal.
a #GtkTextBuffer
modification flag setting
Deletes current contents of @buffer, and inserts @text instead. If
@len is -1, @text must be nul-terminated. @text must be valid UTF-8.
a #GtkTextBuffer
UTF-8 text to insert
length of @text in bytes
This function unregisters a rich text format that was previously
registered using gtk_text_buffer_register_deserialize_format() or
gtk_text_buffer_register_deserialize_tagset().
a #GtkTextBuffer
a #GdkAtom representing a registered rich text format.
This function unregisters a rich text format that was previously
registered using gtk_text_buffer_register_serialize_format() or
gtk_text_buffer_register_serialize_tagset()
a #GtkTextBuffer
a #GdkAtom representing a registered rich text format.
The list of targets this buffer supports for clipboard copying
and as DND source.
The position of the insert mark (as offset from the beginning
of the buffer). It is useful for getting notified when the
cursor moves.
Whether the buffer has some text currently selected.
The list of targets this buffer supports for clipboard pasting
and as DND destination.
The text content of the buffer. Without child widgets and images,
see gtk_text_buffer_get_text() for more information.
The ::apply-tag signal is emitted to apply a tag to a
range of text in a #GtkTextBuffer.
Applying actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the @start and @end iters (or has to revalidate them).
See also:
gtk_text_buffer_apply_tag(),
gtk_text_buffer_insert_with_tags(),
gtk_text_buffer_insert_range().
the applied tag
the start of the range the tag is applied to
the end of the range the tag is applied to
The ::begin-user-action signal is emitted at the beginning of a single
user-visible operation on a #GtkTextBuffer.
See also:
gtk_text_buffer_begin_user_action(),
gtk_text_buffer_insert_interactive(),
gtk_text_buffer_insert_range_interactive(),
gtk_text_buffer_delete_interactive(),
gtk_text_buffer_backspace(),
gtk_text_buffer_delete_selection().
The ::changed signal is emitted when the content of a #GtkTextBuffer
has changed.
The ::delete-range signal is emitted to delete a range
from a #GtkTextBuffer.
Note that if your handler runs before the default handler it must not
invalidate the @start and @end iters (or has to revalidate them).
The default signal handler revalidates the @start and @end iters to
both point point to the location where text was deleted. Handlers
which run after the default handler (see g_signal_connect_after())
do not have access to the deleted text.
See also: gtk_text_buffer_delete().
the start of the range to be deleted
the end of the range to be deleted
The ::end-user-action signal is emitted at the end of a single
user-visible operation on the #GtkTextBuffer.
See also:
gtk_text_buffer_end_user_action(),
gtk_text_buffer_insert_interactive(),
gtk_text_buffer_insert_range_interactive(),
gtk_text_buffer_delete_interactive(),
gtk_text_buffer_backspace(),
gtk_text_buffer_delete_selection(),
gtk_text_buffer_backspace().
The ::insert-child-anchor signal is emitted to insert a
#GtkTextChildAnchor in a #GtkTextBuffer.
Insertion actually occurs in the default handler.
Note that if your handler runs before the default handler it must
not invalidate the @location iter (or has to revalidate it).
The default signal handler revalidates it to be placed after the
inserted @anchor.
See also: gtk_text_buffer_insert_child_anchor().
position to insert @anchor in @textbuffer
the #GtkTextChildAnchor to be inserted
The ::insert-pixbuf signal is emitted to insert a #GdkPixbuf
in a #GtkTextBuffer. Insertion actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the @location iter (or has to revalidate it).
The default signal handler revalidates it to be placed after the
inserted @pixbuf.
See also: gtk_text_buffer_insert_pixbuf().
position to insert @pixbuf in @textbuffer
the #GdkPixbuf to be inserted
The ::insert-text signal is emitted to insert text in a #GtkTextBuffer.
Insertion actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the @location iter (or has to revalidate it).
The default signal handler revalidates it to point to the end of the
inserted text.
See also:
gtk_text_buffer_insert(),
gtk_text_buffer_insert_range().
position to insert @text in @textbuffer
the UTF-8 text to be inserted
length of the inserted text in bytes
The ::mark-deleted signal is emitted as notification
after a #GtkTextMark is deleted.
See also:
gtk_text_buffer_delete_mark().
The mark that was deleted
The ::mark-set signal is emitted as notification
after a #GtkTextMark is set.
See also:
gtk_text_buffer_create_mark(),
gtk_text_buffer_move_mark().
The location of @mark in @textbuffer
The mark that is set
The ::modified-changed signal is emitted when the modified bit of a
#GtkTextBuffer flips.
See also:
gtk_text_buffer_set_modified().
The paste-done signal is emitted after paste operation has been completed.
This is useful to properly scroll the view to the end of the pasted text.
See gtk_text_buffer_paste_clipboard() for more details.
The ::remove-tag signal is emitted to remove all occurrences of @tag from
a range of text in a #GtkTextBuffer.
Removal actually occurs in the default handler.
Note that if your handler runs before the default handler it must not
invalidate the @start and @end iters (or has to revalidate them).
See also:
gtk_text_buffer_remove_tag().
the tag to be removed
the start of the range the tag is removed from
the end of the range the tag is removed from
a #GtkTextBuffer
a #GdkPixbuf
a #GtkTextBuffer
a #GtkTextChildAnchor
a #GtkTextBuffer
a #GtkTextTag
a #GtkTextBuffer
a #GtkTextTag
a #GtkTextBuffer
a #GtkTextBuffer
Creates a new #GtkTextChildAnchor. Usually you would then insert
it into a #GtkTextBuffer with gtk_text_buffer_insert_child_anchor().
To perform the creation and insertion in one step, use the
convenience function gtk_text_buffer_create_child_anchor().
a new #GtkTextChildAnchor
Determines whether a child anchor has been deleted from
the buffer. Keep in mind that the child anchor will be
unreferenced when removed from the buffer, so you need to
hold your own reference (with g_object_ref()) if you plan
to use this function — otherwise all deleted child anchors
will also be finalized.
%TRUE if the child anchor has been deleted from its buffer
a #GtkTextChildAnchor
Gets a list of all widgets anchored at this child anchor.
The returned list should be freed with g_list_free().
list of widgets anchored at @anchor
a #GtkTextChildAnchor
Moves backward by one character offset. Returns %TRUE if movement
was possible; if @iter was the first in the buffer (character
offset 0), gtk_text_iter_backward_char () returns %FALSE for convenience when
writing loops.
whether movement was possible
an iterator
Moves @count characters backward, if possible (if @count would move
past the start or end of the buffer, moves to the start or end of
the buffer). The return value indicates whether the iterator moved
onto a dereferenceable position; if the iterator didn't move, or
moved onto the end iterator, then %FALSE is returned. If @count is 0,
the function does nothing and returns %FALSE.
whether @iter moved and is dereferenceable
an iterator
number of characters to move
Like gtk_text_iter_forward_cursor_position(), but moves backward.
%TRUE if we moved
a #GtkTextIter
Moves up to @count cursor positions. See
gtk_text_iter_forward_cursor_position() for details.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
number of positions to move
Same as gtk_text_iter_forward_find_char(), but goes backward from @iter.
whether a match was found
a #GtkTextIter
function to be called on each character
user data for @pred
search limit, or %NULL for none
Moves @iter to the start of the previous line. Returns %TRUE if
@iter could be moved; i.e. if @iter was at character offset 0, this
function returns %FALSE. Therefore if @iter was already on line 0,
but not at the start of the line, @iter is snapped to the start of
the line and the function returns %TRUE. (Note that this implies that
in a loop calling this function, the line number may not change on
every iteration, if your first iteration is on line 0.)
whether @iter moved
an iterator
Moves @count lines backward, if possible (if @count would move
past the start or end of the buffer, moves to the start or end of
the buffer). The return value indicates whether the iterator moved
onto a dereferenceable position; if the iterator didn't move, or
moved onto the end iterator, then %FALSE is returned. If @count is 0,
the function does nothing and returns %FALSE. If @count is negative,
moves forward by 0 - @count lines.
whether @iter moved and is dereferenceable
a #GtkTextIter
number of lines to move backward
Same as gtk_text_iter_forward_search(), but moves backward.
whether a match was found
a #GtkTextIter where the search begins
search string
bitmask of flags affecting the search
return location for start of match, or %NULL
return location for end of match, or %NULL
location of last possible @match_start, or %NULL for start of buffer
Moves backward to the previous sentence start; if @iter is already at
the start of a sentence, moves backward to the next one. Sentence
boundaries are determined by Pango and should be correct for nearly
any language (if not, the correct fix would be to the Pango text
boundary algorithms).
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
Calls gtk_text_iter_backward_sentence_start() up to @count times,
or until it returns %FALSE. If @count is negative, moves forward
instead of backward.
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
number of sentences to move
Moves backward to the next toggle (on or off) of the
#GtkTextTag @tag, or to the next toggle of any tag if
@tag is %NULL. If no matching tag toggles are found,
returns %FALSE, otherwise %TRUE. Does not return toggles
located at @iter, only toggles before @iter. Sets @iter
to the location of the toggle, or the start of the buffer
if no toggle is found.
whether we found a tag toggle before @iter
a #GtkTextIter
a #GtkTextTag, or %NULL
Moves @iter forward to the previous visible cursor position. See
gtk_text_iter_backward_cursor_position() for details.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
Moves up to @count visible cursor positions. See
gtk_text_iter_backward_cursor_position() for details.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
number of positions to move
Moves @iter to the start of the previous visible line. Returns %TRUE if
@iter could be moved; i.e. if @iter was at character offset 0, this
function returns %FALSE. Therefore if @iter was already on line 0,
but not at the start of the line, @iter is snapped to the start of
the line and the function returns %TRUE. (Note that this implies that
in a loop calling this function, the line number may not change on
every iteration, if your first iteration is on line 0.)
whether @iter moved
an iterator
Moves @count visible lines backward, if possible (if @count would move
past the start or end of the buffer, moves to the start or end of
the buffer). The return value indicates whether the iterator moved
onto a dereferenceable position; if the iterator didn't move, or
moved onto the end iterator, then %FALSE is returned. If @count is 0,
the function does nothing and returns %FALSE. If @count is negative,
moves forward by 0 - @count lines.
whether @iter moved and is dereferenceable
a #GtkTextIter
number of lines to move backward
Moves backward to the previous visible word start. (If @iter is currently
on a word start, moves backward to the next one after that.) Word breaks
are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
Calls gtk_text_iter_backward_visible_word_start() up to @count times.
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
number of times to move
Moves backward to the previous word start. (If @iter is currently on a
word start, moves backward to the next one after that.) Word breaks
are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
Calls gtk_text_iter_backward_word_start() up to @count times.
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
number of times to move
Returns %TRUE if @tag is toggled on at exactly this point. If @tag
is %NULL, returns %TRUE if any tag is toggled on at this point. Note
that the gtk_text_iter_begins_tag () returns %TRUE if @iter is the
<emphasis>start</emphasis> of the tagged range;
gtk_text_iter_has_tag () tells you whether an iterator is
<emphasis>within</emphasis> a tagged range.
whether @iter is the start of a range tagged with @tag
an iterator
a #GtkTextTag, or %NULL
Considering the default editability of the buffer, and tags that
affect editability, determines whether text inserted at @iter would
be editable. If text inserted at @iter would be editable then the
user should be allowed to insert text at @iter.
gtk_text_buffer_insert_interactive() uses this function to decide
whether insertions are allowed at a given position.
whether text inserted at @iter would be editable
an iterator
%TRUE if text is editable by default
A qsort()-style function that returns negative if @lhs is less than
@rhs, positive if @lhs is greater than @rhs, and 0 if they're equal.
Ordering is in character offset order, i.e. the first character in the buffer
is less than the second character in the buffer.
-1 if @lhs is less than @rhs, 1 if @lhs is greater, 0 if they are equal
a #GtkTextIter
another #GtkTextIter
Creates a dynamically-allocated copy of an iterator. This function
is not useful in applications, because iterators can be copied with a
simple assignment (<literal>GtkTextIter i = j;</literal>). The
function is used by language bindings.
a copy of the @iter, free with gtk_text_iter_free ()
an iterator
Returns whether the character at @iter is within an editable region
of text. Non-editable text is "locked" and can't be changed by the
user via #GtkTextView. This function is simply a convenience
wrapper around gtk_text_iter_get_attributes (). If no tags applied
to this text affect editability, @default_setting will be returned.
You don't want to use this function to decide whether text can be
inserted at @iter, because for insertion you don't want to know
whether the char at @iter is inside an editable range, you want to
know whether a new character inserted at @iter would be inside an
editable range. Use gtk_text_iter_can_insert() to handle this
case.
whether @iter is inside an editable range
an iterator
%TRUE if text is editable by default
Returns %TRUE if @iter points to the start of the paragraph
delimiter characters for a line (delimiters will be either a
newline, a carriage return, a carriage return followed by a
newline, or a Unicode paragraph separator character). Note that an
iterator pointing to the \n of a \r\n pair will not be counted as
the end of a line, the line ends before the \r. The end iterator is
considered to be at the end of a line, even though there are no
paragraph delimiter chars there.
whether @iter is at the end of a line
an iterator
Determines whether @iter ends a sentence. Sentence boundaries are
determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango text boundary
algorithms).
%TRUE if @iter is at the end of a sentence.
a #GtkTextIter
Returns %TRUE if @tag is toggled off at exactly this point. If @tag
is %NULL, returns %TRUE if any tag is toggled off at this point. Note
that the gtk_text_iter_ends_tag () returns %TRUE if @iter is the
<emphasis>end</emphasis> of the tagged range;
gtk_text_iter_has_tag () tells you whether an iterator is
<emphasis>within</emphasis> a tagged range.
whether @iter is the end of a range tagged with @tag
an iterator
a #GtkTextTag, or %NULL
Determines whether @iter ends a natural-language word. Word breaks
are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).
%TRUE if @iter is at the end of a word
a #GtkTextIter
Tests whether two iterators are equal, using the fastest possible
mechanism. This function is very fast; you can expect it to perform
better than e.g. getting the character offset for each iterator and
comparing the offsets yourself. Also, it's a bit faster than
gtk_text_iter_compare().
%TRUE if the iterators point to the same place in the buffer
a #GtkTextIter
another #GtkTextIter
Moves @iter forward by one character offset. Note that images
embedded in the buffer occupy 1 character slot, so
gtk_text_iter_forward_char () may actually move onto an image instead
of a character, if you have images in your buffer. If @iter is the
end iterator or one character before it, @iter will now point at
the end iterator, and gtk_text_iter_forward_char () returns %FALSE for
convenience when writing loops.
whether @iter moved and is dereferenceable
an iterator
Moves @count characters if possible (if @count would move past the
start or end of the buffer, moves to the start or end of the
buffer). The return value indicates whether the new position of
@iter is different from its original position, and dereferenceable
(the last iterator in the buffer is not dereferenceable). If @count
is 0, the function does nothing and returns %FALSE.
whether @iter moved and is dereferenceable
an iterator
number of characters to move, may be negative
Moves @iter forward by a single cursor position. Cursor positions
are (unsurprisingly) positions where the cursor can appear. Perhaps
surprisingly, there may not be a cursor position between all
characters. The most common example for European languages would be
a carriage return/newline sequence. For some Unicode characters,
the equivalent of say the letter "a" with an accent mark will be
represented as two characters, first the letter then a "combining
mark" that causes the accent to be rendered; so the cursor can't go
between those two characters. See also the #PangoLogAttr structure and
pango_break() function.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
Moves up to @count cursor positions. See
gtk_text_iter_forward_cursor_position() for details.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
number of positions to move
Advances @iter, calling @pred on each character. If
@pred returns %TRUE, returns %TRUE and stops scanning.
If @pred never returns %TRUE, @iter is set to @limit if
@limit is non-%NULL, otherwise to the end iterator.
whether a match was found
a #GtkTextIter
a function to be called on each character
user data for @pred
search limit, or %NULL for none
Moves @iter to the start of the next line. If the iter is already on the
last line of the buffer, moves the iter to the end of the current line.
If after the operation, the iter is at the end of the buffer and not
dereferencable, returns %FALSE. Otherwise, returns %TRUE.
whether @iter can be dereferenced
an iterator
Moves @count lines forward, if possible (if @count would move
past the start or end of the buffer, moves to the start or end of
the buffer). The return value indicates whether the iterator moved
onto a dereferenceable position; if the iterator didn't move, or
moved onto the end iterator, then %FALSE is returned. If @count is 0,
the function does nothing and returns %FALSE. If @count is negative,
moves backward by 0 - @count lines.
whether @iter moved and is dereferenceable
a #GtkTextIter
number of lines to move forward
Searches forward for @str. Any match is returned by setting
@match_start to the first character of the match and @match_end to the
first character after the match. The search will not continue past
@limit. Note that a search is a linear or O(n) operation, so you
may wish to use @limit to avoid locking up your UI on large
buffers.
If the #GTK_TEXT_SEARCH_VISIBLE_ONLY flag is present, the match may
have invisible text interspersed in @str. i.e. @str will be a
possibly-noncontiguous subsequence of the matched range. similarly,
if you specify #GTK_TEXT_SEARCH_TEXT_ONLY, the match may have
pixbufs or child widgets mixed inside the matched range. If these
flags are not given, the match must be exact; the special 0xFFFC
character in @str will match embedded pixbufs or child widgets.
whether a match was found
start of search
a search string
flags affecting how the search is done
return location for start of match, or %NULL
return location for end of match, or %NULL
bound for the search, or %NULL for the end of the buffer
Moves forward to the next sentence end. (If @iter is at the end of
a sentence, moves to the next end of sentence.) Sentence
boundaries are determined by Pango and should be correct for nearly
any language (if not, the correct fix would be to the Pango text
boundary algorithms).
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
Calls gtk_text_iter_forward_sentence_end() @count times (or until
gtk_text_iter_forward_sentence_end() returns %FALSE). If @count is
negative, moves backward instead of forward.
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
number of sentences to move
Moves @iter forward to the "end iterator," which points one past the last
valid character in the buffer. gtk_text_iter_get_char() called on the
end iterator returns 0, which is convenient for writing loops.
a #GtkTextIter
Moves the iterator to point to the paragraph delimiter characters,
which will be either a newline, a carriage return, a carriage
return/newline in sequence, or the Unicode paragraph separator
character. If the iterator is already at the paragraph delimiter
characters, moves to the paragraph delimiter characters for the
next line. If @iter is on the last line in the buffer, which does
not end in paragraph delimiters, moves to the end iterator (end of
the last line), and returns %FALSE.
%TRUE if we moved and the new location is not the end iterator
a #GtkTextIter
Moves forward to the next toggle (on or off) of the
#GtkTextTag @tag, or to the next toggle of any tag if
@tag is %NULL. If no matching tag toggles are found,
returns %FALSE, otherwise %TRUE. Does not return toggles
located at @iter, only toggles after @iter. Sets @iter to
the location of the toggle, or to the end of the buffer
if no toggle is found.
whether we found a tag toggle after @iter
a #GtkTextIter
a #GtkTextTag, or %NULL
Moves @iter forward to the next visible cursor position. See
gtk_text_iter_forward_cursor_position() for details.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
Moves up to @count visible cursor positions. See
gtk_text_iter_forward_cursor_position() for details.
%TRUE if we moved and the new position is dereferenceable
a #GtkTextIter
number of positions to move
Moves @iter to the start of the next visible line. Returns %TRUE if there
was a next line to move to, and %FALSE if @iter was simply moved to
the end of the buffer and is now not dereferenceable, or if @iter was
already at the end of the buffer.
whether @iter can be dereferenced
an iterator
Moves @count visible lines forward, if possible (if @count would move
past the start or end of the buffer, moves to the start or end of
the buffer). The return value indicates whether the iterator moved
onto a dereferenceable position; if the iterator didn't move, or
moved onto the end iterator, then %FALSE is returned. If @count is 0,
the function does nothing and returns %FALSE. If @count is negative,
moves backward by 0 - @count lines.
whether @iter moved and is dereferenceable
a #GtkTextIter
number of lines to move forward
Moves forward to the next visible word end. (If @iter is currently on a
word end, moves forward to the next one after that.) Word breaks
are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
Calls gtk_text_iter_forward_visible_word_end() up to @count times.
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
number of times to move
Moves forward to the next word end. (If @iter is currently on a
word end, moves forward to the next one after that.) Word breaks
are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
Calls gtk_text_iter_forward_word_end() up to @count times.
%TRUE if @iter moved and is not the end iterator
a #GtkTextIter
number of times to move
Free an iterator allocated on the heap. This function
is intended for use in language bindings, and is not
especially useful for applications, because iterators can
simply be allocated on the stack.
a dynamically-allocated iterator
Computes the effect of any tags applied to this spot in the
text. The @values parameter should be initialized to the default
settings you wish to use if no tags are in effect. You'd typically
obtain the defaults from gtk_text_view_get_default_attributes().
gtk_text_iter_get_attributes () will modify @values, applying the
effects of any tags present at @iter. If any tags affected @values,
the function returns %TRUE.
%TRUE if @values was modified
an iterator
a #GtkTextAttributes to be filled in
Returns the #GtkTextBuffer this iterator is associated with.
the buffer
an iterator
Returns the number of bytes in the line containing @iter,
including the paragraph delimiters.
number of bytes in the line
an iterator
Returns the Unicode character at this iterator. (Equivalent to
operator* on a C++ iterator.) If the element at this iterator is a
non-character element, such as an image embedded in the buffer, the
Unicode "unknown" character 0xFFFC is returned. If invoked on
the end iterator, zero is returned; zero is not a valid Unicode character.
So you can write a loop which ends when gtk_text_iter_get_char ()
returns 0.
a Unicode character, or 0 if @iter is not dereferenceable
an iterator
Returns the number of characters in the line containing @iter,
including the paragraph delimiters.
number of characters in the line
an iterator
If the location at @iter contains a child anchor, the
anchor is returned (with no new reference count added). Otherwise,
%NULL is returned.
the anchor at @iter
an iterator
A convenience wrapper around gtk_text_iter_get_attributes (),
which returns the language in effect at @iter. If no tags affecting
language apply to @iter, the return value is identical to that of
gtk_get_default_language ().
language in effect at @iter
an iterator
Returns the line number containing the iterator. Lines in
a #GtkTextBuffer are numbered beginning with 0 for the first
line in the buffer.
a line number
an iterator
Returns the byte index of the iterator, counting
from the start of a newline-terminated line.
Remember that #GtkTextBuffer encodes text in
UTF-8, and that characters can require a variable
number of bytes to represent.
distance from start of line, in bytes
an iterator
Returns the character offset of the iterator,
counting from the start of a newline-terminated line.
The first character on the line has offset 0.
offset from start of line
an iterator
Returns a list of all #GtkTextMark at this location. Because marks
are not iterable (they don't take up any "space" in the buffer,
they are just marks in between iterable locations), multiple marks
can exist in the same place. The returned list is not in any
meaningful order.
list of #GtkTextMark
an iterator
Returns the character offset of an iterator.
Each character in a #GtkTextBuffer has an offset,
starting with 0 for the first character in the buffer.
Use gtk_text_buffer_get_iter_at_offset () to convert an
offset back into an iterator.
a character offset
an iterator
If the element at @iter is a pixbuf, the pixbuf is returned
(with no new reference count added). Otherwise,
%NULL is returned.
the pixbuf at @iter
an iterator
Returns the text in the given range. A "slice" is an array of
characters encoded in UTF-8 format, including the Unicode "unknown"
character 0xFFFC for iterable non-character elements in the buffer,
such as images. Because images are encoded in the slice, byte and
character offsets in the returned array will correspond to byte
offsets in the text buffer. Note that 0xFFFC can occur in normal
text as well, so it is not a reliable indicator that a pixbuf or
widget is in the buffer.
slice of text from the buffer
iterator at start of a range
iterator at end of a range
Returns a list of tags that apply to @iter, in ascending order of
priority (highest-priority tags are last). The #GtkTextTag in the
list don't have a reference added, but you have to free the list
itself.
list of #GtkTextTag
a #GtkTextIter
Returns <emphasis>text</emphasis> in the given range. If the range
contains non-text elements such as images, the character and byte
offsets in the returned string will not correspond to character and
byte offsets in the buffer. If you want offsets to correspond, see
gtk_text_iter_get_slice ().
array of characters from the buffer
iterator at start of a range
iterator at end of a range
Returns a list of #GtkTextTag that are toggled on or off at this
point. (If @toggled_on is %TRUE, the list contains tags that are
toggled on.) If a tag is toggled on at @iter, then some non-empty
range of characters following @iter has that tag applied to it. If
a tag is toggled off, then some non-empty range following @iter
does <emphasis>not</emphasis> have the tag applied to it.
tags toggled at this point
an iterator
%TRUE to get toggled-on tags
Returns the number of bytes from the start of the
line to the given @iter, not counting bytes that
are invisible due to tags with the "invisible" flag
toggled on.
byte index of @iter with respect to the start of the line
a #GtkTextIter
Returns the offset in characters from the start of the
line to the given @iter, not counting characters that
are invisible due to tags with the "invisible" flag
toggled on.
offset in visible characters from the start of the line
a #GtkTextIter
Like gtk_text_iter_get_slice (), but invisible text is not included.
Invisible text is usually invisible because a #GtkTextTag with the
"invisible" attribute turned on has been applied to it.
slice of text from the buffer
iterator at start of range
iterator at end of range
Like gtk_text_iter_get_text (), but invisible text is not included.
Invisible text is usually invisible because a #GtkTextTag with the
"invisible" attribute turned on has been applied to it.
string containing visible text in the range
iterator at start of range
iterator at end of range
Returns %TRUE if @iter is within a range tagged with @tag.
whether @iter is tagged with @tag
an iterator
a #GtkTextTag
Checks whether @iter falls in the range [@start, @end).
@start and @end must be in ascending order.
%TRUE if @iter is in the range
a #GtkTextIter
start of range
end of range
Determines whether @iter is inside a sentence (as opposed to in
between two sentences, e.g. after a period and before the first
letter of the next sentence). Sentence boundaries are determined
by Pango and should be correct for nearly any language (if not, the
correct fix would be to the Pango text boundary algorithms).
%TRUE if @iter is inside a sentence.
a #GtkTextIter
Determines whether @iter is inside a natural-language word (as
opposed to say inside some whitespace). Word breaks are determined
by Pango and should be correct for nearly any language (if not, the
correct fix would be to the Pango word break algorithms).
%TRUE if @iter is inside a word
a #GtkTextIter
See gtk_text_iter_forward_cursor_position() or #PangoLogAttr or
pango_break() for details on what a cursor position is.
%TRUE if the cursor can be placed at @iter
a #GtkTextIter
Returns %TRUE if @iter is the end iterator, i.e. one past the last
dereferenceable iterator in the buffer. gtk_text_iter_is_end () is
the most efficient way to check whether an iterator is the end
iterator.
whether @iter is the end iterator
an iterator
Returns %TRUE if @iter is the first iterator in the buffer, that is
if @iter has a character offset of 0.
whether @iter is the first in the buffer
an iterator
Swaps the value of @first and @second if @second comes before
@first in the buffer. That is, ensures that @first and @second are
in sequence. Most text buffer functions that take a range call this
automatically on your behalf, so there's no real reason to call it yourself
in those cases. There are some exceptions, such as gtk_text_iter_in_range(),
that expect a pre-sorted range.
a #GtkTextIter
another #GtkTextIter
Moves iterator @iter to the start of the line @line_number. If
@line_number is negative or larger than the number of lines in the
buffer, moves @iter to the start of the last line in the buffer.
a #GtkTextIter
line number (counted from 0)
Same as gtk_text_iter_set_line_offset(), but works with a
<emphasis>byte</emphasis> index. The given byte index must be at
the start of a character, it can't be in the middle of a UTF-8
encoded character.
a #GtkTextIter
a byte index relative to the start of @iter's current line
Moves @iter within a line, to a new <emphasis>character</emphasis>
(not byte) offset. The given character offset must be less than or
equal to the number of characters in the line; if equal, @iter
moves to the start of the next line. See
gtk_text_iter_set_line_index() if you have a byte index rather than
a character offset.
a #GtkTextIter
a character offset relative to the start of @iter's current line
Sets @iter to point to @char_offset. @char_offset counts from the start
of the entire text buffer, starting with 0.
a #GtkTextIter
a character number
Like gtk_text_iter_set_line_index(), but the index is in visible
bytes, i.e. text with a tag making it invisible is not counted
in the index.
a #GtkTextIter
a byte index
Like gtk_text_iter_set_line_offset(), but the offset is in visible
characters, i.e. text with a tag making it invisible is not
counted in the offset.
a #GtkTextIter
a character offset
Returns %TRUE if @iter begins a paragraph,
i.e. if gtk_text_iter_get_line_offset () would return 0.
However this function is potentially more efficient than
gtk_text_iter_get_line_offset () because it doesn't have to compute
the offset, it just has to see whether it's 0.
whether @iter begins a line
an iterator
Determines whether @iter begins a sentence. Sentence boundaries are
determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango text boundary
algorithms).
%TRUE if @iter is at the start of a sentence.
a #GtkTextIter
Determines whether @iter begins a natural-language word. Word
breaks are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango word break
algorithms).
%TRUE if @iter is at the start of a word
a #GtkTextIter
This is equivalent to (gtk_text_iter_begins_tag () ||
gtk_text_iter_ends_tag ()), i.e. it tells you whether a range with
@tag applied to it begins <emphasis>or</emphasis> ends at @iter.
whether @tag is toggled on or off at @iter
an iterator
a #GtkTextTag, or %NULL
If the iterator is not fully in the range @top <= y < @bottom,
then, if possible, move it the minimum distance so that the
iterator in this range.
%TRUE if the iterator was moved, otherwise %FALSE.
a #GtkTextLayout
a #GtkTextIter
the top of the range
the bottom the range
Gets the text buffer used by the layout. See
gtk_text_layout_set_buffer().
the text buffer used by the layout.
a #GtkTextLayout
Given an iterator within a text layout, determine the positions of the
strong and weak cursors if the insertion point is at that
iterator. The position of each cursor is stored as a zero-width
rectangle. The strong cursor location is the location where
characters of the directionality equal to the base direction of the
paragraph are inserted. The weak cursor location is the location
where characters of the directionality opposite to the base
direction of the paragraph are inserted.
a #GtkTextLayout
a #GtkTextIter
location to store the strong cursor position (may be %NULL)
location to store the weak cursor position (may be %NULL)
Returns whether the insertion cursor will be shown.
if %FALSE, the insertion cursor will not be
shown, even if the text is editable.
a #GtkTextLayout
Get the iter at the beginning of the line which is displayed
at the given y.
a #GtkLayout
the iterator in which the result is stored
the y positition
location to store the y coordinate of the
top of the line. (Can by %NULL)
Find the range of y coordinates for the paragraph containing
the given iter.
a #GtkTextLayout
a #GtkTextIter
location to store the top of the paragraph in pixels,
or %NULL.
@height location to store the height of the paragraph in pixels,
or %NULL.
Check if there are any invalid regions in a #GtkTextLayout's buffer
%TRUE if any invalid regions were found
a #GtkTextLayout
Tests whether an iterator is at the start of a display line.
a #GtkTextLayout
iterator to test
Move to the beginning or end of a display line.
a #GtkTextLayout
if negative, move to beginning of line, otherwise
move to end of line.
Move the iterator to the beginning of the next line. The
lines of a wrapped paragraph are treated as distinct for
this operation.
a #GtkLayout
a #GtkTextIter
Move the iterator to the beginning of the previous line. The lines
of a wrapped paragraph are treated as distinct for this operation.
a #GtkLayout
a #GtkTextIter
Keeping the iterator on the same line of the layout, move it to the
specified X coordinate. The lines of a wrapped paragraph are
treated as distinct for this operation.
a #GtkTextLayout
a #GtkTextIter
X coordinate
Move the iterator a given number of characters visually, treating
it as the strong cursor position. If @count is positive, then the
new strong cursor position will be @count positions to the right of
the old cursor position. If @count is negative then the new strong
cursor position will be @count positions to the left of the old
cursor position.
In the presence of bidirection text, the correspondence
between logical and visual order will depend on the direction
of the current run, and there may be jumps when the cursor
is moved off of the end of a run.
a #GtkTextLayout
a #GtkTextIter
number of characters to move (negative moves left, positive moves right)
Sets which text directions (left-to-right and/or right-to-left) for
which cursors will be drawn for the insertion point. The visual
point at which new text is inserted depends on whether the new
text is right-to-left or left-to-right, so it may be desired to
make the drawn position of the cursor depend on the keyboard state.
the new direction(s) for which to draw cursors.
%GTK_TEXT_DIR_NONE means draw cursors for both
left-to-right insertion and right-to-left insertion.
(The two cursors will be visually distinguished.)
Sets whether the insertion cursor should be shown. Generally,
widgets using #GtkTextLayout will hide the cursor when the
widget does not have the input focus.
a #GtkTextLayout
If %FALSE, then the insertion cursor will not
be shown, even if the text is editable.
Sets the keyboard direction; this is used as for the bidirectional
base direction for the line with the cursor if the line contains
only neutral characters.
the current direction of the keyboard.
Sets overwrite mode
a #GtkTextLayout
overwrite mode
Set the preedit string and attributes. The preedit string is a
string showing text that is currently being edited and not
yet committed into the buffer.
a #PangoLayout
a string to display at the insertion point
a #PangoAttrList of attributes that apply to @preedit_string
position of cursor within preedit string in chars
Validate regions of a #GtkTextLayout. The ::changed signal will
be emitted for each region validated.
the maximum number of pixels to validate. (No more
than one paragraph beyond this limit will be validated)
Ensure that a region of a #GtkTextLayout is valid. The ::changed
signal will be emitted if any lines are validated.
a #GtkTextLayout
offset from the top of the line pointed to by @anchor at
which to begin validation. (The offset here is in pixels
after validation.)
offset from the top of the line pointed to by @anchor at
which to end validation. (The offset here is in pixels
after validation.)
Creates a text mark. Add it to a buffer using gtk_text_buffer_add_mark().
If @name is %NULL, the mark is anonymous; otherwise, the mark can be
retrieved by name using gtk_text_buffer_get_mark(). If a mark has left
gravity, and text is inserted at the mark's current location, the mark
will be moved to the left of the newly-inserted text. If the mark has
right gravity (@left_gravity = %FALSE), the mark will end up on the
right of newly-inserted text. The standard left-to-right cursor is a
mark with right gravity (when you type, the cursor stays on the right
side of the text you're typing).
new #GtkTextMark
mark name or %NULL
whether the mark should have left gravity
Gets the buffer this mark is located inside,
or %NULL if the mark is deleted.
the mark's #GtkTextBuffer
a #GtkTextMark
Returns %TRUE if the mark has been removed from its buffer
with gtk_text_buffer_delete_mark(). See gtk_text_buffer_add_mark()
for a way to add it to a buffer again.
whether the mark is deleted
a #GtkTextMark
Determines whether the mark has left gravity.
%TRUE if the mark has left gravity, %FALSE otherwise
a #GtkTextMark
Returns the mark name; returns NULL for anonymous marks.
mark name
a #GtkTextMark
Returns %TRUE if the mark is visible (i.e. a cursor is displayed
for it).
%TRUE if visible
a #GtkTextMark
Sets the visibility of @mark; the insertion point is normally
visible, i.e. you can see it as a vertical bar. Also, the text
widget uses a visible mark to indicate where a drop will occur when
dragging-and-dropping text. Most other marks are not visible.
Marks are not visible by default.
a #GtkTextMark
visibility of mark
Creates a #GtkTextTag. Configure the tag using object arguments,
i.e. using g_object_set().
a new #GtkTextTag
tag name, or %NULL
Emits the "event" signal on the #GtkTextTag.
result of signal emission (whether the event was handled)
a #GtkTextTag
object that received the event, such as a widget
the event
location where the event was received
Emits the "event" signal on the #GtkTextTag.
result of signal emission (whether the event was handled)
a #GtkTextTag
object that received the event, such as a widget
the event
location where the event was received
Get the tag priority.
The tag's priority.
a #GtkTextTag
Sets the priority of a #GtkTextTag. Valid priorities are
start at 0 and go to one less than gtk_text_tag_table_get_size().
Each tag in a table has a unique priority; setting the priority
of one tag shifts the priorities of all the other tags in the
table to maintain a unique priority for each tag. Higher priority
tags "win" if two tags both set the same text attribute. When adding
a tag to a tag table, it will be assigned the highest priority in
the table by default; so normally the precedence of a set of tags
is the order in which they were added to the table, or created with
gtk_text_buffer_create_tag(), which adds the tag to the buffer's table
automatically.
a #GtkTextTag
the new priority
Whether the margins accumulate or override each other.
When set to %TRUE the margins of this tag are added to the margins
of any other non-accumulative margins present. When set to %FALSE
the margins override one another (the default).
Font description as string, e.g. \"Sans Italic 12\".
Note that the initial value of this property depends on
the internals of #PangoFontDescription.
Whether this text is hidden.
Note that there may still be problems with the support for invisible
text, in particular when navigating programmatically inside a buffer
containing invisible segments.
The language this text is in, as an ISO code. Pango can use this as a
hint when rendering the text. If not set, an appropriate default will be
used.
Note that the initial value of this property depends on the current
locale, see also gtk_get_default_language().
The paragraph background color as a string.
The paragraph background color as a as a (possibly unallocated)
#GdkColor.
The ::event signal is emitted when an event occurs on a region of the
buffer marked with this tag.
%TRUE to stop other handlers from being invoked for the
event. %FALSE to propagate the event further.
the object the event was fired from (typically a #GtkTextView)
the event which triggered the signal
a #GtkTextIter pointing at the location the event occured
result of signal emission (whether the event was handled)
a #GtkTextTag
object that received the event, such as a widget
the event
location where the event was received
You may wish to begin by reading the <link linkend="TextWidget">text widget
conceptual overview</link> which gives an overview of all the objects and data
types related to the text widget and how they work together.
<refsect2 id="GtkTextTagTable-BUILDER-UI">
<title>GtkTextTagTables as GtkBuildable</title>
<para>
The GtkTextTagTable implementation of the GtkBuildable interface
supports adding tags by specifying "tag" as the "type"
attribute of a <child> element.
</para>
<example>
<title>A UI definition fragment specifying tags</title>
<programlisting><![CDATA[
<object class="GtkTextTagTable">
<child type="tag">
<object class="GtkTextTag"/>
</child>
</object>
]]></programlisting>
</example>
</refsect2>
Creates a new #GtkTextTagTable. The table contains no tags by
default.
a new #GtkTextTagTable
Add a tag to the table. The tag is assigned the highest priority
in the table.
@tag must not be in a tag table already, and may not have
the same name as an already-added tag.
a #GtkTextTagTable
a #GtkTextTag
Calls @func on each tag in @table, with user data @data.
Note that the table may not be modified while iterating
over it (you can't add/remove tags).
a #GtkTextTagTable
a function to call on each tag
user data
Returns the size of the table (number of tags)
number of tags in @table
a #GtkTextTagTable
Look up a named tag.
The tag, or %NULL if none by that name is in the table.
a #GtkTextTagTable
name of a tag
Remove a tag from the table. This will remove the table's
reference to the tag, so be careful - the tag will end
up destroyed if you don't have a reference to it.
a #GtkTextTagTable
a #GtkTextTag
Creates a new #GtkTextView. If you don't call gtk_text_view_set_buffer()
before using the text view, an empty default buffer will be created
for you. Get the buffer with gtk_text_view_get_buffer(). If you want
to specify your own buffer, consider gtk_text_view_new_with_buffer().
a new #GtkTextView
Creates a new #GtkTextView widget displaying the buffer
@buffer. One buffer can be shared among many widgets.
@buffer may be %NULL to create a default buffer, in which case
this function is equivalent to gtk_text_view_new(). The
text view adds its own reference count to the buffer; it does not
take over an existing reference.
a new #GtkTextView.
a #GtkTextBuffer
Adds a child widget in the text buffer, at the given @anchor.
a #GtkTextView
a #GtkWidget
a #GtkTextChildAnchor in the #GtkTextBuffer for @text_view
Adds a child at fixed coordinates in one of the text widget's
windows. The window must have nonzero size (see
gtk_text_view_set_border_window_size()). Note that the child
coordinates are given relative to the #GdkWindow in question, and
that these coordinates have no sane relationship to scrolling. When
placing a child in #GTK_TEXT_WINDOW_WIDGET, scrolling is
irrelevant, the child floats above all scrollable areas. But when
placing a child in one of the scrollable windows (border windows or
text window), you'll need to compute the child's correct position
in buffer coordinates any time scrolling occurs or buffer changes
occur, and then call gtk_text_view_move_child() to update the
child's position. Unfortunately there's no good way to detect that
scrolling has occurred, using the current API; a possible hack
would be to update all child positions when the scroll adjustments
change or the text buffer changes. See bug 64518 on
bugzilla.gnome.org for status of fixing this issue.
a #GtkTextView
a #GtkWidget
which window the child should appear in
X position of child in window coordinates
Y position of child in window coordinates
Moves the given @iter backward by one display (wrapped) line.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view's width; paragraphs are the same in all
views, since they depend on the contents of the #GtkTextBuffer.
%TRUE if @iter was moved and is not on the end iterator
a #GtkTextView
a #GtkTextIter
Moves the given @iter backward to the next display line start.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view's width; paragraphs are the same in all
views, since they depend on the contents of the #GtkTextBuffer.
%TRUE if @iter was moved and is not on the end iterator
a #GtkTextView
a #GtkTextIter
Converts coordinate (@buffer_x, @buffer_y) to coordinates for the window
@win, and stores the result in (@window_x, @window_y).
Note that you can't convert coordinates for a nonexisting window (see
gtk_text_view_set_border_window_size()).
a #GtkTextView
a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE
buffer x coordinate
buffer y coordinate
window x coordinate return location or %NULL
window y coordinate return location or %NULL
Moves the given @iter forward by one display (wrapped) line.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view's width; paragraphs are the same in all
views, since they depend on the contents of the #GtkTextBuffer.
%TRUE if @iter was moved and is not on the end iterator
a #GtkTextView
a #GtkTextIter
Moves the given @iter forward to the next display line end.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view's width; paragraphs are the same in all
views, since they depend on the contents of the #GtkTextBuffer.
%TRUE if @iter was moved and is not on the end iterator
a #GtkTextView
a #GtkTextIter
Returns whether pressing the Tab key inserts a tab characters.
gtk_text_view_set_accepts_tab().
%TRUE if pressing the Tab key inserts a tab character,
%FALSE if pressing the Tab key moves the keyboard focus.
A #GtkTextView
Gets the width of the specified border window. See
gtk_text_view_set_border_window_size().
width of window
a #GtkTextView
window to return size from
Returns the #GtkTextBuffer being displayed by this text view.
The reference count on the buffer is not incremented; the caller
of this function won't own a new reference.
a #GtkTextBuffer
a #GtkTextView
Find out whether the cursor is being displayed.
whether the insertion mark is visible
a #GtkTextView
Obtains a copy of the default text attributes. These are the
attributes used for text unless a tag overrides them.
You'd typically pass the default attributes in to
gtk_text_iter_get_attributes() in order to get the
attributes in effect at a given text position.
The return value is a copy owned by the caller of this function,
and should be freed.
a new #GtkTextAttributes
a #GtkTextView
Returns the default editability of the #GtkTextView. Tags in the
buffer may override this setting for some ranges of text.
whether text is editable by default
a #GtkTextView
Gets the horizontal-scrolling #GtkAdjustment.
pointer to the horizontal #GtkAdjustment
a #GtkTextView
Gets the default indentation of paragraphs in @text_view.
Tags in the view's buffer may override the default.
The indentation may be negative.
number of pixels of indentation
a #GtkTextView
Retrieves the iterator at buffer coordinates @x and @y. Buffer
coordinates are coordinates for the entire buffer, not just the
currently-displayed portion. If you have coordinates from an
event, you have to convert those to buffer coordinates with
gtk_text_view_window_to_buffer_coords().
a #GtkTextView
a #GtkTextIter
x position, in buffer coordinates
y position, in buffer coordinates
Retrieves the iterator pointing to the character at buffer
coordinates @x and @y. Buffer coordinates are coordinates for
the entire buffer, not just the currently-displayed portion.
If you have coordinates from an event, you have to convert
those to buffer coordinates with
gtk_text_view_window_to_buffer_coords().
Note that this is different from gtk_text_view_get_iter_at_location(),
which returns cursor locations, i.e. positions <emphasis>between</emphasis>
characters.
a #GtkTextView
a #GtkTextIter
if non-%NULL, location to store an integer indicating where
in the grapheme the user clicked. It will either be
zero, or the number of characters in the grapheme.
0 represents the trailing edge of the grapheme.
x position, in buffer coordinates
y position, in buffer coordinates
Gets a rectangle which roughly contains the character at @iter.
The rectangle position is in buffer coordinates; use
gtk_text_view_buffer_to_window_coords() to convert these
coordinates to coordinates for one of the windows in the text view.
a #GtkTextView
a #GtkTextIter
bounds of the character at @iter
Gets the default justification of paragraphs in @text_view.
Tags in the buffer may override the default.
default justification
a #GtkTextView
Gets the default left margin size of paragraphs in the @text_view.
Tags in the buffer may override the default.
left margin in pixels
a #GtkTextView
Gets the #GtkTextIter at the start of the line containing
the coordinate @y. @y is in buffer coordinates, convert from
window coordinates with gtk_text_view_window_to_buffer_coords().
If non-%NULL, @line_top will be filled with the coordinate of the top
edge of the line.
a #GtkTextView
a #GtkTextIter
a y coordinate
return location for top coordinate of the line
Gets the y coordinate of the top of the line containing @iter,
and the height of the line. The coordinate is a buffer coordinate;
convert to window coordinates with gtk_text_view_buffer_to_window_coords().
a #GtkTextView
a #GtkTextIter
return location for a y coordinate
return location for a height
Returns whether the #GtkTextView is in overwrite mode or not.
whether @text_view is in overwrite mode or not.
a #GtkTextView
Gets the default number of pixels to put above paragraphs.
default number of pixels above paragraphs
a #GtkTextView
Gets the value set by gtk_text_view_set_pixels_below_lines().
default number of blank pixels below paragraphs
a #GtkTextView
Gets the value set by gtk_text_view_set_pixels_inside_wrap().
default number of pixels of blank space between wrapped lines
a #GtkTextView
Gets the default right margin for text in @text_view. Tags
in the buffer may override the default.
right margin in pixels
a #GtkTextView
Gets the default tabs for @text_view. Tags in the buffer may
override the defaults. The returned array will be %NULL if
"standard" (8-space) tabs are used. Free the return value
with pango_tab_array_free().
copy of default tab array, or %NULL if "standard"
tabs are used; must be freed with pango_tab_array_free().
a #GtkTextView
Gets the vertical-scrolling #GtkAdjustment.
pointer to the vertical #GtkAdjustment
a #GtkTextView
Fills @visible_rect with the currently-visible
region of the buffer, in buffer coordinates. Convert to window coordinates
with gtk_text_view_buffer_to_window_coords().
a #GtkTextView
rectangle to fill
Retrieves the #GdkWindow corresponding to an area of the text view;
possible windows include the overall widget window, child windows
on the left, right, top, bottom, and the window that displays the
text buffer. Windows are %NULL and nonexistent if their width or
height is 0, and are nonexistent before the widget has been
realized.
a #GdkWindow, or %NULL
a #GtkTextView
window to get
Usually used to find out which window an event corresponds to.
If you connect to an event signal on @text_view, this function
should be called on <literal>event->window</literal> to
see which window it was.
the window type.
a #GtkTextView
a window type
Gets the line wrapping for the view.
the line wrap setting
a #GtkTextView
Allow the #GtkTextView input method to internally handle key press
and release events. If this function returns %TRUE, then no further
processing should be done for this key event. See
gtk_im_context_filter_keypress().
Note that you are expected to call this function from your handler
when overriding key event handling. This is needed in the case when
you need to insert your own key handling between the input method
and the default key event handling of the #GtkTextView.
|[
static gboolean
gtk_foo_bar_key_press_event (GtkWidget *widget,
GdkEventKey *event)
{
if ((key->keyval == GDK_Return || key->keyval == GDK_KP_Enter))
{
if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
return TRUE;
}
/* Do some stuff */
return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
}
]|
%TRUE if the input method handled the key event.
a #GtkTextView
the key event
Updates the position of a child, as for gtk_text_view_add_child_in_window().
a #GtkTextView
child widget already added to the text view
new X position in window coordinates
new Y position in window coordinates
Moves a mark within the buffer so that it's
located within the currently-visible text area.
%TRUE if the mark moved (wasn't already onscreen)
a #GtkTextView
a #GtkTextMark
Move the iterator a given number of characters visually, treating
it as the strong cursor position. If @count is positive, then the
new strong cursor position will be @count positions to the right of
the old cursor position. If @count is negative then the new strong
cursor position will be @count positions to the left of the old
cursor position.
In the presence of bi-directional text, the correspondence
between logical and visual order will depend on the direction
of the current run, and there may be jumps when the cursor
is moved off of the end of a run.
%TRUE if @iter moved and is not on the end iterator
a #GtkTextView
a #GtkTextIter
number of characters to move (negative moves left,
positive moves right)
Moves the cursor to the currently visible region of the
buffer, it it isn't there already.
%TRUE if the cursor had to be moved.
a #GtkTextView
Reset the input method context of the text view if needed.
This can be necessary in the case where modifying the buffer
would confuse on-going input method behavior.
a #GtkTextView
Scrolls @text_view the minimum distance such that @mark is contained
within the visible area of the widget.
a #GtkTextView
a mark in the buffer for @text_view
Scrolls @text_view so that @iter is on the screen in the position
indicated by @xalign and @yalign. An alignment of 0.0 indicates
left or top, 1.0 indicates right or bottom, 0.5 means center.
If @use_align is %FALSE, the text scrolls the minimal distance to
get the mark onscreen, possibly not scrolling at all. The effective
screen for purposes of this function is reduced by a margin of size
@within_margin.
Note that this function uses the currently-computed height of the
lines in the text buffer. Line heights are computed in an idle
handler; so this function may not have the desired effect if it's
called before the height computations. To avoid oddness, consider
using gtk_text_view_scroll_to_mark() which saves a point to be
scrolled to after line validation.
%TRUE if scrolling occurred
a #GtkTextView
a #GtkTextIter
margin as a [0.0,0.5) fraction of screen size
whether to use alignment arguments (if %FALSE,
just get the mark onscreen)
horizontal alignment of mark within visible area
vertical alignment of mark within visible area
Scrolls @text_view so that @mark is on the screen in the position
indicated by @xalign and @yalign. An alignment of 0.0 indicates
left or top, 1.0 indicates right or bottom, 0.5 means center.
If @use_align is %FALSE, the text scrolls the minimal distance to
get the mark onscreen, possibly not scrolling at all. The effective
screen for purposes of this function is reduced by a margin of size
@within_margin.
a #GtkTextView
a #GtkTextMark
margin as a [0.0,0.5) fraction of screen size
whether to use alignment arguments (if %FALSE, just
get the mark onscreen)
horizontal alignment of mark within visible area
vertical alignment of mark within visible area
Sets the behavior of the text widget when the Tab key is pressed.
If @accepts_tab is %TRUE, a tab character is inserted. If @accepts_tab
is %FALSE the keyboard focus is moved to the next widget in the focus
chain.
A #GtkTextView
%TRUE if pressing the Tab key should insert a tab
character, %FALSE, if pressing the Tab key should move the
keyboard focus.
Sets the width of %GTK_TEXT_WINDOW_LEFT or %GTK_TEXT_WINDOW_RIGHT,
or the height of %GTK_TEXT_WINDOW_TOP or %GTK_TEXT_WINDOW_BOTTOM.
Automatically destroys the corresponding window if the size is set
to 0, and creates the window if the size is set to non-zero. This
function can only be used for the "border windows," it doesn't work
with #GTK_TEXT_WINDOW_WIDGET, #GTK_TEXT_WINDOW_TEXT, or
#GTK_TEXT_WINDOW_PRIVATE.
a #GtkTextView
window to affect
width or height of the window
Sets @buffer as the buffer being displayed by @text_view. The previous
buffer displayed by the text view is unreferenced, and a reference is
added to @buffer. If you owned a reference to @buffer before passing it
to this function, you must remove that reference yourself; #GtkTextView
will not "adopt" it.
a #GtkTextView
a #GtkTextBuffer
Toggles whether the insertion point is displayed. A buffer with no editable
text probably shouldn't have a visible cursor, so you may want to turn
the cursor off.
a #GtkTextView
whether to show the insertion cursor
Sets the default editability of the #GtkTextView. You can override
this default setting with tags in the buffer, using the "editable"
attribute of tags.
a #GtkTextView
whether it's editable
Sets the default indentation for paragraphs in @text_view.
Tags in the buffer may override the default.
a #GtkTextView
indentation in pixels
Sets the default justification of text in @text_view.
Tags in the view's buffer may override the default.
a #GtkTextView
justification
Sets the default left margin for text in @text_view.
Tags in the buffer may override the default.
a #GtkTextView
left margin in pixels
Changes the #GtkTextView overwrite mode.
a #GtkTextView
%TRUE to turn on overwrite mode, %FALSE to turn it off
Sets the default number of blank pixels above paragraphs in @text_view.
Tags in the buffer for @text_view may override the defaults.
a #GtkTextView
pixels above paragraphs
Sets the default number of pixels of blank space
to put below paragraphs in @text_view. May be overridden
by tags applied to @text_view's buffer.
a #GtkTextView
pixels below paragraphs
Sets the default number of pixels of blank space to leave between
display/wrapped lines within a paragraph. May be overridden by
tags in @text_view's buffer.
a #GtkTextView
default number of pixels between wrapped lines
Sets the default right margin for text in the text view.
Tags in the buffer may override the default.
a #GtkTextView
right margin in pixels
Sets the default tab stops for paragraphs in @text_view.
Tags in the buffer may override the default.
a #GtkTextView
tabs as a #PangoTabArray
Sets the line wrapping for the view.
a #GtkTextView
a #GtkWrapMode
Determines whether @iter is at the start of a display line.
See gtk_text_view_forward_display_line() for an explanation of
display lines vs. paragraphs.
%TRUE if @iter begins a wrapped line
a #GtkTextView
a #GtkTextIter
Converts coordinates on the window identified by @win to buffer
coordinates, storing the result in (@buffer_x,@buffer_y).
Note that you can't convert coordinates for a nonexisting window (see
gtk_text_view_set_border_window_size()).
a #GtkTextView
a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE
window x coordinate
window y coordinate
buffer x coordinate return location or %NULL
buffer y coordinate return location or %NULL
Which IM (input method) module should be used for this entry.
See #GtkIMContext.
Setting this to a non-%NULL value overrides the
system-wide IM module setting. See the GtkSettings
#GtkSettings:gtk-im-module property.
The ::backspace signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user asks for it.
The default bindings for this signal are
Backspace and Shift-Backspace.
The ::copy-clipboard signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted to copy the selection to the clipboard.
The default bindings for this signal are
Ctrl-c and Ctrl-Insert.
The ::cut-clipboard signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted to cut the selection to the clipboard.
The default bindings for this signal are
Ctrl-x and Shift-Delete.
The ::delete-from-cursor signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user initiates a text deletion.
If the @type is %GTK_DELETE_CHARS, GTK+ deletes the selection
if there is one, otherwise it deletes the requested number
of characters.
The default bindings for this signal are
Delete for deleting a character, Ctrl-Delete for
deleting a word and Ctrl-Backspace for deleting a word
backwords.
the granularity of the deletion, as a #GtkDeleteType
the number of @type units to delete
The ::insert-at-cursor signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user initiates the insertion of a
fixed string at the cursor.
This signal has no default bindings.
the string to insert
The ::move-cursor signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user initiates a cursor movement.
If the cursor is not visible in @text_view, this signal causes
the viewport to be moved instead.
Applications should not connect to it, but may emit it with
g_signal_emit_by_name() if they need to control the cursor
programmatically.
The default bindings for this signal come in two variants,
the variant with the Shift modifier extends the selection,
the variant without the Shift modifer does not.
There are too many key combinations to list them all here.
<itemizedlist>
<listitem>Arrow keys move by individual characters/lines</listitem>
<listitem>Ctrl-arrow key combinations move by words/paragraphs</listitem>
<listitem>Home/End keys move to the ends of the buffer</listitem>
<listitem>PageUp/PageDown keys move vertically by pages</listitem>
<listitem>Ctrl-PageUp/PageDown keys move horizontally by pages</listitem>
</itemizedlist>
the granularity of the move, as a #GtkMovementStep
the number of @step units to move
%TRUE if the move should extend the selection
The ::move-viewport signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which can be bound to key combinations to allow the user
to move the viewport, i.e. change what part of the text view
is visible in a containing scrolled window.
There are no default bindings for this signal.
the granularity of the move, as a #GtkMovementStep
the number of @step units to move
The ::page-horizontally signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which can be bound to key combinations to allow the user
to initiate horizontal cursor movement by pages.
This signal should not be used anymore, instead use the
#GtkTextview::move-cursor signal with the #GTK_MOVEMENT_HORIZONTAL_PAGES
granularity.
the number of @step units to move
%TRUE if the move should extend the selection
The ::paste-clipboard signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted to paste the contents of the clipboard
into the text view.
The default bindings for this signal are
Ctrl-v and Shift-Insert.
The ::populate-popup signal gets emitted before showing the
context menu of the text view.
If you need to add items to the context menu, connect
to this signal and append your menuitems to the @menu.
the menu that is being populated
If an input method is used, the typed text will not immediately
be committed to the buffer. So if you are interested in the text,
connect to this signal.
This signal is only emitted if the text at the given position
is actually editable.
the current preedit string
The ::select-all signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted to select or unselect the complete
contents of the text view.
The default bindings for this signal are Ctrl-a and Ctrl-/
for selecting and Shift-Ctrl-a and Ctrl-\ for unselecting.
%TRUE to select, %FALSE to unselect
The ::set-anchor signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user initiates setting the "anchor"
mark. The "anchor" mark gets placed at the same position as the
"insert" mark.
This signal has no default bindings.
Set the scroll adjustments for the text view. Usually scrolled containers
like #GtkScrolledWindow will emit this signal to connect two instances
of #GtkScrollbar to the scroll directions of the #GtkTextView.
The ::toggle-cursor-visible signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted to toggle the visibility of the cursor.
The default binding for this signal is F7.
The ::toggle-overwrite signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted to toggle the overwrite mode of the text view.
The default bindings for this signal is Insert.
Creates a new #GtkToggleAction object. To add the action to
a #GtkActionGroup and set the accelerator for the action,
call gtk_action_group_add_action_with_accel().
a new #GtkToggleAction
A unique name for the action
The label displayed in menu items and on buttons, or %NULL
A tooltip for the action, or %NULL
The stock icon to display in widgets representing the
action, or %NULL
Emits the "toggled" signal on the toggle action.
the action object
Returns the checked state of the toggle action.
the checked state of the toggle action
the action object
Returns whether the action should have proxies like a radio action.
whether the action should have proxies like a radio action.
the action object
Sets the checked state on the toggle action.
the action object
whether the action should be checked or not
Sets whether the action should have proxies like a radio action.
the action object
whether the action should have proxies like a radio
action
Emits the "toggled" signal on the toggle action.
the action object
If the toggle action should be active in or not.
Whether the proxies for this action look like radio action proxies.
This is an appearance property and thus only applies if
#GtkActivatable:use-action-appearance is %TRUE.
the action object
Creates a new #GtkToggleButton containing a label. The label
will be created using gtk_label_new_with_mnemonic(), so underscores
in @label indicate the mnemonic for the button.
a new #GtkToggleButton
the text of the button, with an underscore in front of the
mnemonic character
Gets the value set by gtk_toggle_button_set_inconsistent().
%TRUE if the button is displayed as inconsistent, %FALSE otherwise
a #GtkToggleButton
Retrieves whether the button is displayed as a separate indicator
and label. See gtk_toggle_button_set_mode().
%TRUE if the togglebutton is drawn as a separate indicator
and label.
a #GtkToggleButton
If the user has selected a range of elements (such as some text or
spreadsheet cells) that are affected by a toggle button, and the
current values in that range are inconsistent, you may want to
display the toggle in an "in between" state. This function turns on
"in between" display. Normally you would turn off the inconsistent
state again if the user toggles the toggle button. This has to be
done manually, gtk_toggle_button_set_inconsistent() only affects
visual appearance, it doesn't affect the semantics of the button.
a #GtkToggleButton
%TRUE if state is inconsistent
Sets whether the button is displayed as a separate indicator and label.
You can call this function on a checkbutton or a radiobutton with
@draw_indicator = %FALSE to make the button look like a normal button
This function only affects instances of classes like #GtkCheckButton
and #GtkRadioButton that derive from #GtkToggleButton,
not instances of #GtkToggleButton itself.
a #GtkToggleButton
if %TRUE, draw the button as a separate indicator
and label; if %FALSE, draw the button like a normal button
Returns a new #GtkToggleToolButton
a newly created #GtkToggleToolButton
Creates a new #GtkToggleToolButton containing the image and text from a
stock item. Some stock ids have preprocessor macros like #GTK_STOCK_OK
and #GTK_STOCK_APPLY.
It is an error if @stock_id is not a name of a stock item.
A new #GtkToggleToolButton
the name of the stock item
Queries a #GtkToggleToolButton and returns its current state.
Returns %TRUE if the toggle button is pressed in and %FALSE if it is raised.
%TRUE if the toggle tool button is pressed in, %FALSE if not
a #GtkToggleToolButton
Sets the status of the toggle tool button. Set to %TRUE if you
want the GtkToggleButton to be 'pressed in', and %FALSE to raise it.
This action causes the toggled signal to be emitted.
a #GtkToggleToolButton
whether @button should be active
If the toggle tool button should be pressed in or not.
Emitted whenever the toggle tool button changes state.
Creates a new %GtkToolButton using @icon_widget as icon and @label as
label.
A new #GtkToolButton
a #GtkMisc widget that will be used as icon widget, or %NULL
a string that will be used as label, or %NULL
Creates a new #GtkToolButton containing the image and text from a
stock item. Some stock ids have preprocessor macros like #GTK_STOCK_OK
and #GTK_STOCK_APPLY.
It is an error if @stock_id is not a name of a stock item.
A new #GtkToolButton
the name of the stock item
Returns the name of the themed icon for the tool button,
see gtk_tool_button_set_icon_name().
the icon name or %NULL if the tool button has
no themed icon
a #GtkToolButton
Return the widget used as icon widget on @button.
See gtk_tool_button_set_icon_widget().
The widget used as icon
on @button, or %NULL.
a #GtkToolButton
Returns the label used by the tool button, or %NULL if the tool button
doesn't have a label. or uses a the label from a stock item. The returned
string is owned by GTK+, and must not be modified or freed.
The label, or %NULL
a #GtkToolButton
Returns the widget used as label on @button.
See gtk_tool_button_set_label_widget().
The widget used as label
on @button, or %NULL.
a #GtkToolButton
Returns the name of the stock item. See gtk_tool_button_set_stock_id().
The returned string is owned by GTK+ and must not be freed or modifed.
the name of the stock item for @button.
a #GtkToolButton
Returns whether underscores in the label property are used as mnemonics
on menu items on the overflow menu. See gtk_tool_button_set_use_underline().
%TRUE if underscores in the label property are used as
mnemonics on menu items on the overflow menu.
a #GtkToolButton
Sets the icon for the tool button from a named themed icon.
See the docs for #GtkIconTheme for more details.
The "icon_name" property only has an effect if not
overridden by non-%NULL "label", "icon_widget" and "stock_id"
properties.
a #GtkToolButton
the name of the themed icon
Sets @icon as the widget used as icon on @button. If @icon_widget is
%NULL the icon is determined by the "stock_id" property. If the
"stock_id" property is also %NULL, @button will not have an icon.
a #GtkToolButton
the widget used as icon, or %NULL
Sets @label as the label used for the tool button. The "label" property
only has an effect if not overridden by a non-%NULL "label_widget" property.
If both the "label_widget" and "label" properties are %NULL, the label
is determined by the "stock_id" property. If the "stock_id" property is also
%NULL, @button will not have a label.
a #GtkToolButton
a string that will be used as label, or %NULL.
Sets @label_widget as the widget that will be used as the label
for @button. If @label_widget is %NULL the "label" property is used
as label. If "label" is also %NULL, the label in the stock item
determined by the "stock_id" property is used as label. If
"stock_id" is also %NULL, @button does not have a label.
a #GtkToolButton
the widget used as label, or %NULL
Sets the name of the stock item. See gtk_tool_button_new_from_stock().
The stock_id property only has an effect if not
overridden by non-%NULL "label" and "icon_widget" properties.
a #GtkToolButton
a name of a stock item, or %NULL
If set, an underline in the label property indicates that the next character
should be used for the mnemonic accelerator key in the overflow menu. For
example, if the label property is "_Open" and @use_underline is %TRUE,
the label on the tool button will be "Open" and the item on the overflow
menu will have an underlined 'O'.
Labels shown on tool buttons never have mnemonics on them; this property
only affects the menu item on the overflow menu.
a #GtkToolButton
whether the button label has the form "_Open"
The name of the themed icon displayed on the item.
This property only has an effect if not overridden by "label",
"icon_widget" or "stock_id" properties.
This signal is emitted when the tool button is clicked with the mouse
or activated with the keyboard.
#GtkToolItem<!-- -->s are widgets that can appear on a toolbar. To
create a toolbar item that contain something else than a button, use
gtk_tool_item_new(). Use gtk_container_add() to add a child
widget to the tool item.
For toolbar items that contain buttons, see the #GtkToolButton,
#GtkToggleToolButton and #GtkRadioToolButton classes.
See the #GtkToolbar class for a description of the toolbar widget, and
#GtkToolShell for a description of the tool shell interface.
Creates a new #GtkToolItem
the new #GtkToolItem
Emits the signal #GtkToolItem::toolbar_reconfigured on @tool_item.
#GtkToolbar and other #GtkToolShell implementations use this function
to notify children, when some aspect of their configuration changes.
a #GtkToolItem
Returns the ellipsize mode used for @tool_item. Custom subclasses of
#GtkToolItem should call this function to find out how text should
be ellipsized.
a #PangoEllipsizeMode indicating how text in @tool_item
should be ellipsized.
a #GtkToolItem
Returns whether @tool_item is allocated extra space.
See gtk_tool_item_set_expand().
%TRUE if @tool_item is allocated extra space.
a #GtkToolItem
Returns whether @tool_item is the same size as other homogeneous
items. See gtk_tool_item_set_homogeneous().
%TRUE if the item is the same size as other homogeneous
items.
a #GtkToolItem
Returns the icon size used for @tool_item. Custom subclasses of
#GtkToolItem should call this function to find out what size icons
they should use.
a #GtkIconSize indicating the icon size
used for @tool_item
a #GtkToolItem
Returns whether @tool_item is considered important. See
gtk_tool_item_set_is_important()
%TRUE if @tool_item is considered important.
a #GtkToolItem
Returns the orientation used for @tool_item. Custom subclasses of
#GtkToolItem should call this function to find out what size icons
they should use.
a #GtkOrientation indicating the orientation
used for @tool_item
a #GtkToolItem
If @menu_item_id matches the string passed to
gtk_tool_item_set_proxy_menu_item() return the corresponding #GtkMenuItem.
Custom subclasses of #GtkToolItem should use this function to
update their menu item when the #GtkToolItem changes. That the
@menu_item_id<!-- -->s must match ensures that a #GtkToolItem
will not inadvertently change a menu item that they did not create.
The #GtkMenuItem passed to
gtk_tool_item_set_proxy_menu_item(), if the @menu_item_id<!-- -->s
match.
a #GtkToolItem
a string used to identify the menu item
Returns the relief style of @tool_item. See gtk_button_set_relief_style().
Custom subclasses of #GtkToolItem should call this function in the handler
of the #GtkToolItem::toolbar_reconfigured signal to find out the
relief style of buttons.
a #GtkReliefStyle indicating the relief style used
for @tool_item.
a #GtkToolItem
Returns the text alignment used for @tool_item. Custom subclasses of
#GtkToolItem should call this function to find out how text should
be aligned.
a #gfloat indicating the horizontal text alignment
used for @tool_item
a #GtkToolItem:
Returns the text orientation used for @tool_item. Custom subclasses of
#GtkToolItem should call this function to find out how text should
be orientated.
a #GtkOrientation indicating the text orientation
used for @tool_item
a #GtkToolItem
Returns the size group used for labels in @tool_item.
Custom subclasses of #GtkToolItem should call this function
and use the size group for labels.
a #GtkSizeGroup
a #GtkToolItem
Returns the toolbar style used for @tool_item. Custom subclasses of
#GtkToolItem should call this function in the handler of the
GtkToolItem::toolbar_reconfigured signal to find out in what style
the toolbar is displayed and change themselves accordingly
Possibilities are:
<itemizedlist>
<listitem> GTK_TOOLBAR_BOTH, meaning the tool item should show
both an icon and a label, stacked vertically </listitem>
<listitem> GTK_TOOLBAR_ICONS, meaning the toolbar shows
only icons </listitem>
<listitem> GTK_TOOLBAR_TEXT, meaning the tool item should only
show text</listitem>
<listitem> GTK_TOOLBAR_BOTH_HORIZ, meaning the tool item should show
both an icon and a label, arranged horizontally (however, note the
#GtkToolButton::has_text_horizontally that makes tool buttons not
show labels when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ.
</listitem>
</itemizedlist>
A #GtkToolbarStyle indicating the toolbar style used
for @tool_item.
a #GtkToolItem
Returns whether @tool_item has a drag window. See
gtk_tool_item_set_use_drag_window().
%TRUE if @tool_item uses a drag window.
a #GtkToolItem
Returns whether the @tool_item is visible on toolbars that are
docked horizontally.
%TRUE if @tool_item is visible on toolbars that are
docked horizontally.
a #GtkToolItem
Returns whether @tool_item is visible when the toolbar is docked vertically.
See gtk_tool_item_set_visible_vertical().
Whether @tool_item is visible when the toolbar is docked vertically
a #GtkToolItem
Calling this function signals to the toolbar that the
overflow menu item for @tool_item has changed. If the
overflow menu is visible when this function it called,
the menu will be rebuilt.
The function must be called when the tool item changes what it
will do in response to the #GtkToolItem::create-menu-proxy signal.
a #GtkToolItem
Returns the #GtkMenuItem that was last set by
gtk_tool_item_set_proxy_menu_item(), ie. the #GtkMenuItem
that is going to appear in the overflow menu.
The #GtkMenuItem that is going to appear in the
overflow menu for @tool_item.
a #GtkToolItem
Sets whether @tool_item is allocated extra space when there
is more room on the toolbar then needed for the items. The
effect is that the item gets bigger when the toolbar gets bigger
and smaller when the toolbar gets smaller.
a #GtkToolItem
Whether @tool_item is allocated extra space
Sets whether @tool_item is to be allocated the same size as other
homogeneous items. The effect is that all homogeneous items will have
the same width as the widest of the items.
a #GtkToolItem
whether @tool_item is the same size as other homogeneous items
Sets whether @tool_item should be considered important. The #GtkToolButton
class uses this property to determine whether to show or hide its label
when the toolbar style is %GTK_TOOLBAR_BOTH_HORIZ. The result is that
only tool buttons with the "is_important" property set have labels, an
effect known as "priority text"
a #GtkToolItem
whether the tool item should be considered important
Sets the #GtkMenuItem used in the toolbar overflow menu. The
@menu_item_id is used to identify the caller of this function and
should also be used with gtk_tool_item_get_proxy_menu_item().
See also #GtkToolItem::create-menu-proxy.
a #GtkToolItem
a string used to identify @menu_item
a #GtkMenuItem to be used in the overflow menu
Sets the #GtkTooltips object to be used for @tool_item, the
text to be displayed as tooltip on the item and the private text
to be used. See gtk_tooltips_set_tip().
Use gtk_tool_item_set_tooltip_text() instead.
a #GtkToolItem
The #GtkTooltips object to be used
text to be used as tooltip text for @tool_item
text to be used as private tooltip text
Sets the markup text to be displayed as tooltip on the item.
See gtk_widget_set_tooltip_markup().
a #GtkToolItem
markup text to be used as tooltip for @tool_item
Sets the text to be displayed as tooltip on the item.
See gtk_widget_set_tooltip_text().
a #GtkToolItem
text to be used as tooltip for @tool_item
Sets whether @tool_item has a drag window. When %TRUE the
toolitem can be used as a drag source through gtk_drag_source_set().
When @tool_item has a drag window it will intercept all events,
even those that would otherwise be sent to a child of @tool_item.
a #GtkToolItem
Whether @tool_item has a drag window.
Sets whether @tool_item is visible when the toolbar is docked horizontally.
a #GtkToolItem
Whether @tool_item is visible when in horizontal mode
Sets whether @tool_item is visible when the toolbar is docked
vertically. Some tool items, such as text entries, are too wide to be
useful on a vertically docked toolbar. If @visible_vertical is %FALSE
@tool_item will not appear on toolbars that are docked vertically.
a #GtkToolItem
whether @tool_item is visible when the toolbar
is in vertical mode
Emits the signal #GtkToolItem::toolbar_reconfigured on @tool_item.
#GtkToolbar and other #GtkToolShell implementations use this function
to notify children, when some aspect of their configuration changes.
a #GtkToolItem
This signal is emitted when the toolbar needs information from @tool_item
about whether the item should appear in the toolbar overflow menu. In
response the tool item should either
<itemizedlist>
<listitem>call gtk_tool_item_set_proxy_menu_item() with a %NULL
pointer and return %TRUE to indicate that the item should not appear
in the overflow menu
</listitem>
<listitem> call gtk_tool_item_set_proxy_menu_item() with a new menu
item and return %TRUE, or
</listitem>
<listitem> return %FALSE to indicate that the signal was not
handled by the item. This means that
the item will not appear in the overflow menu unless a later handler
installs a menu item.
</listitem>
</itemizedlist>
The toolbar may cache the result of this signal. When the tool item changes
how it will respond to this signal it must call gtk_tool_item_rebuild_menu()
to invalidate the cache and ensure that the toolbar rebuilds its overflow
menu.
%TRUE if the signal was handled, %FALSE if not
This signal is emitted when the toolitem's tooltip changes.
Application developers can use gtk_tool_item_set_tooltip() to
set the item's tooltip.
With the new tooltip API, there is no
need to use this signal anymore.
%TRUE if the signal was handled, %FALSE if not
the #GtkTooltips
the tooltip text
the tooltip private text
This signal is emitted when some property of the toolbar that the
item is a child of changes. For custom subclasses of #GtkToolItem,
the default handler of this signal use the functions
<itemizedlist>
<listitem>gtk_tool_shell_get_orientation()</listitem>
<listitem>gtk_tool_shell_get_style()</listitem>
<listitem>gtk_tool_shell_get_icon_size()</listitem>
<listitem>gtk_tool_shell_get_relief_style()</listitem>
</itemizedlist>
to find out what the toolbar should look like and change
themselves accordingly.
a #GtkToolItem
A #GtkToolItemGroup is used together with #GtkToolPalette to add
#GtkToolItem<!-- -->s to a palette like container with different
categories and drag and drop support.
Creates a new tool item group with label @label.
a new #GtkToolItemGroup.
the label of the new group
Gets whether @group is collapsed or expanded.
%TRUE if @group is collapsed, %FALSE if it is expanded
a GtkToolItemGroup
Gets the tool item at position (x, y).
the #GtkToolItem at position (x, y)
a #GtkToolItemGroup
the x position
the y position
Gets the ellipsization mode of @group.
the #PangoEllipsizeMode of @group
a #GtkToolItemGroup
Gets the relief mode of the header button of @group.
the #GtkReliefStyle
a #GtkToolItemGroup
Gets the position of @item in @group as index.
the index of @item in @group or -1 if @item is no child of @group
a #GtkToolItemGroup
a #GtkToolItem
Gets the label of @group.
the label of @group. The label is an internal string of @group
and must not be modified. Note that %NULL is returned if a custom
label has been set with gtk_tool_item_group_set_label_widget()
a #GtkToolItemGroup
Gets the label widget of @group.
See gtk_tool_item_group_set_label_widget().
the label widget of @group
a #GtkToolItemGroup
Gets the number of tool items in @group.
the number of tool items in @group
a #GtkToolItemGroup
Gets the tool item at @index in group.
the #GtkToolItem at index
a #GtkToolItemGroup
the index
Inserts @item at @position in the list of children of @group.
a #GtkToolItemGroup
the #GtkToolItem to insert into @group
the position of @item in @group, starting with 0.
The position -1 means end of list.
Sets whether the @group should be collapsed or expanded.
a #GtkToolItemGroup
whether the @group should be collapsed or expanded
Sets the ellipsization mode which should be used by labels in @group.
a #GtkToolItemGroup
the #PangoEllipsizeMode labels in @group should use
Set the button relief of the group header.
See gtk_button_set_relief() for details.
a #GtkToolItemGroup
the #GtkReliefStyle
Sets the position of @item in the list of children of @group.
a #GtkToolItemGroup
the #GtkToolItem to move to a new position, should
be a child of @group.
the new position of @item in @group, starting with 0.
The position -1 means end of list.
Sets the label of the tool item group. The label is displayed in the header
of the group.
a #GtkToolItemGroup
the new human-readable label of of the group
Sets the label of the tool item group.
The label widget is displayed in the header of the group, in place
of the usual label.
a #GtkToolItemGroup
the widget to be displayed in place of the usual label
A #GtkToolPalette allows you to add #GtkToolItem<!-- -->s to a palette-like
container with different categories and drag and drop support.
A #GtkToolPalette is created with a call to gtk_tool_palette_new().
#GtkToolItem<!-- -->s cannot be added directly to a #GtkToolPalette -
instead they are added to a #GtkToolItemGroup which can than be added
to a #GtkToolPalette. To add a #GtkToolItemGroup to a #GtkToolPalette,
use gtk_container_add().
|[
GtkWidget *palette, *group;
GtkToolItem *item;
palette = gtk_tool_palette_new ();
group = gtk_tool_item_group_new (_("Test Category"));
gtk_container_add (GTK_CONTAINER (palette), group);
item = gtk_tool_button_new_from_stock (GTK_STOCK_OK);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
]|
The easiest way to use drag and drop with #GtkToolPalette is to call
gtk_tool_palette_add_drag_dest() with the desired drag source @palette
and the desired drag target @widget. Then gtk_tool_palette_get_drag_item()
can be used to get the dragged item in the #GtkWidget::drag-data-received
signal handler of the drag target.
|[
static void
passive_canvas_drag_data_received (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection,
guint info,
guint time,
gpointer data)
{
GtkWidget *palette;
GtkWidget *item;
/<!-- -->* Get the dragged item *<!-- -->/
palette = gtk_widget_get_ancestor (gtk_drag_get_source_widget (context),
GTK_TYPE_TOOL_PALETTE);
if (palette != NULL)
item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette),
selection);
/<!-- -->* Do something with item *<!-- -->/
}
GtkWidget *target, palette;
palette = gtk_tool_palette_new ();
target = gtk_drawing_area_new ();
g_signal_connect (G_OBJECT (target), "drag-data-received",
G_CALLBACK (passive_canvas_drag_data_received), NULL);
gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), target,
GTK_DEST_DEFAULT_ALL,
GTK_TOOL_PALETTE_DRAG_ITEMS,
GDK_ACTION_COPY);
]|
Creates a new tool palette.
a new #GtkToolPalette
Get the target entry for a dragged #GtkToolItemGroup.
the #GtkTargetEntry for a dragged group
Gets the target entry for a dragged #GtkToolItem.
the #GtkTargetEntry for a dragged item.
Sets @palette as drag source (see gtk_tool_palette_set_drag_source())
and sets @widget as a drag destination for drags from @palette.
See gtk_drag_dest_set().
a #GtkToolPalette
a #GtkWidget which should be a drag destination for @palette
the flags that specify what actions GTK+ should take for drops
on that widget
the #GtkToolPaletteDragTarget<!-- -->s which the widget
should support
the #GdkDragAction<!-- -->s which the widget should suppport
Get the dragged item from the selection.
This could be a #GtkToolItem or a #GtkToolItemGroup.
the dragged item in selection
a #GtkToolPalette
a #GtkSelectionData
Gets the group at position (x, y).
the #GtkToolItemGroup at position or %NULL
if there is no such group
a #GtkToolPalette
the x position
the y position
Gets the item at position (x, y).
See gtk_tool_palette_get_drop_group().
the #GtkToolItem at position or %NULL if there is no such item
a #GtkToolPalette
the x position
the y position
Gets whether @group is exclusive or not.
See gtk_tool_palette_set_exclusive().
%TRUE if @group is exclusive
a #GtkToolPalette
a #GtkToolItemGroup which is a child of palette
Gets whether group should be given extra space.
See gtk_tool_palette_set_expand().
%TRUE if group should be given extra space, %FALSE otherwise
a #GtkToolPalette
a #GtkToolItemGroup which is a child of palette
Gets the position of @group in @palette as index.
See gtk_tool_palette_set_group_position().
the index of group or -1 if @group is not a child of @palette
a #GtkToolPalette
a #GtkToolItemGroup
Gets the horizontal adjustment of the tool palette.
the horizontal adjustment of @palette
a #GtkToolPalette
Gets the size of icons in the tool palette.
See gtk_tool_palette_set_icon_size().
the #GtkIconSize of icons in the tool palette
a #GtkToolPalette
Gets the style (icons, text or both) of items in the tool palette.
the #GtkToolbarStyle of items in the tool palette.
a #GtkToolPalette
Gets the vertical adjustment of the tool palette.
the vertical adjustment of @palette
a #GtkToolPalette
Sets the tool palette as a drag source.
Enables all groups and items in the tool palette as drag sources
on button 1 and button 3 press with copy and move actions.
See gtk_drag_source_set().
a #GtkToolPalette
the #GtkToolPaletteDragTarget<!-- -->s
which the widget should support
Sets whether the group should be exclusive or not.
If an exclusive group is expanded all other groups are collapsed.
a #GtkToolPalette
a #GtkToolItemGroup which is a child of palette
whether the group should be exclusive or not
Sets whether the group should be given extra space.
a #GtkToolPalette
a #GtkToolItemGroup which is a child of palette
whether the group should be given extra space
Sets the position of the group as an index of the tool palette.
If position is 0 the group will become the first child, if position is
-1 it will become the last child.
a #GtkToolPalette
a #GtkToolItemGroup which is a child of palette
a new index for group
Sets the size of icons in the tool palette.
a #GtkToolPalette
the #GtkIconSize that icons in the tool
palette shall have
Sets the style (text, icons or both) of items in the tool palette.
a #GtkToolPalette
the #GtkToolbarStyle that items in the tool palette shall have
Unsets the tool palette icon size set with gtk_tool_palette_set_icon_size(),
so that user preferences will be used to determine the icon size.
a #GtkToolPalette
Unsets a toolbar style set with gtk_tool_palette_set_style(),
so that user preferences will be used to determine the toolbar style.
a #GtkToolPalette
The size of the icons in a tool palette is normally determined by
the #GtkSettings:toolbar-icon-size setting. When this property is set,
it overrides the setting.
This should only be used for special-purpose tool palettes, normal
application tool palettes should respect the user preferences for the
size of icons.
Is %TRUE if the #GtkToolPalette:icon-size property has been set.
The style of items in the tool palette.
Set the scroll adjustments for the viewport.
Usually scrolled containers like GtkScrolledWindow will emit this
signal to connect two instances of GtkScrollbar to the scroll
directions of the GtkToolpalette.
The horizontal adjustment
The vertical adjustment
Flags used to specify the supported drag targets.
Support drag of items.
Support drag of groups.
The #GtkToolShell interface allows container widgets to provide additional
information when embedding #GtkToolItem widgets.
Retrieves the current ellipsize mode for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
instead.
the current ellipsize mode of @shell
a #GtkToolShell
mandatory implementation of gtk_tool_shell_get_icon_size().
Retrieves the current orientation for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_orientation()
instead.
the current orientation of @shell
a #GtkToolShell
Returns the relief style of buttons on @shell. Tool items must not call this
function directly, but rely on gtk_tool_item_get_relief_style() instead.
The relief style of buttons on @shell.
a #GtkToolShell
Retrieves whether the tool shell has text, icons, or both. Tool items must
not call this function directly, but rely on gtk_tool_item_get_style()
instead.
the current style of @shell
a #GtkToolShell
Retrieves the current text alignment for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_text_alignment()
instead.
the current text alignment of @shell
a #GtkToolShell
Retrieves the current text orientation for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_text_orientation()
instead.
the current text orientation of @shell
a #GtkToolShell
Retrieves the current text size group for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_text_size_group()
instead.
the current text size group of @shell
a #GtkToolShell
Calling this function signals the tool shell that the overflow menu item for
tool items have changed. If there is an overflow menu and if it is visible
when this function it called, the menu will be rebuilt.
Tool items must not call this function directly, but rely on
gtk_tool_item_rebuild_menu() instead.
a #GtkToolShell
Retrieves the current ellipsize mode for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
instead.
the current ellipsize mode of @shell
a #GtkToolShell
Retrieves the icon size for the tool shell. Tool items must not call this
function directly, but rely on gtk_tool_item_get_icon_size() instead.
the current size for icons of @shell
a #GtkToolShell
Retrieves the current orientation for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_orientation()
instead.
the current orientation of @shell
a #GtkToolShell
Returns the relief style of buttons on @shell. Tool items must not call this
function directly, but rely on gtk_tool_item_get_relief_style() instead.
The relief style of buttons on @shell.
a #GtkToolShell
Retrieves whether the tool shell has text, icons, or both. Tool items must
not call this function directly, but rely on gtk_tool_item_get_style()
instead.
the current style of @shell
a #GtkToolShell
Retrieves the current text alignment for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_text_alignment()
instead.
the current text alignment of @shell
a #GtkToolShell
Retrieves the current text orientation for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_text_orientation()
instead.
the current text orientation of @shell
a #GtkToolShell
Retrieves the current text size group for the tool shell. Tool items must not
call this function directly, but rely on gtk_tool_item_get_text_size_group()
instead.
the current text size group of @shell
a #GtkToolShell
Calling this function signals the tool shell that the overflow menu item for
tool items have changed. If there is an overflow menu and if it is visible
when this function it called, the menu will be rebuilt.
Tool items must not call this function directly, but rely on
gtk_tool_item_rebuild_menu() instead.
a #GtkToolShell
Virtual function table for the #GtkToolShell interface.
mandatory implementation of gtk_tool_shell_get_icon_size().
mandatory implementation of gtk_tool_shell_get_orientation().
the current orientation of @shell
a #GtkToolShell
mandatory implementation of gtk_tool_shell_get_style().
the current style of @shell
a #GtkToolShell
optional implementation of gtk_tool_shell_get_relief_style().
The relief style of buttons on @shell.
a #GtkToolShell
optional implementation of gtk_tool_shell_rebuild_menu().
a #GtkToolShell
optional implementation of gtk_tool_shell_get_text_orientation().
the current text orientation of @shell
a #GtkToolShell
optional implementation of gtk_tool_shell_get_text_alignment().
the current text alignment of @shell
a #GtkToolShell
optional implementation of gtk_tool_shell_get_ellipsize_mode().
the current ellipsize mode of @shell
a #GtkToolShell
optional implementation of gtk_tool_shell_get_text_size_group().
the current text size group of @shell
a #GtkToolShell
Creates a new toolbar.
the newly-created toolbar.
Adds a new element to the end of a toolbar.
If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element.
If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine
the radio group for the new element. In all other cases, @widget must
be %NULL.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the new toolbar element as a #GtkWidget.
a #GtkToolbar.
a value of type #GtkToolbarChildType that determines what @widget will be.
a #GtkWidget, or %NULL.
the element's label.
the element's tooltip.
used for context-sensitive help about this toolbar element.
a #GtkWidget that provides pictorial representation of the element's function.
the function to be executed when the button is pressed.
any data you wish to pass to the callback.
Inserts a new item into the toolbar. You must specify the position
in the toolbar where it will be inserted.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the new toolbar item as a #GtkWidget.
a #GtkToolbar.
give your toolbar button a label.
a string that appears when the user holds the mouse over this item.
use with #GtkTipsQuery.
a #GtkWidget that should be used as the button's icon.
the function to be executed when the button is pressed.
a pointer to any data you wish to be passed to the callback.
Adds a new space to the end of the toolbar.
Use gtk_toolbar_insert() instead.
a #GtkToolbar.
Adds a widget to the end of the given toolbar.
Use gtk_toolbar_insert() instead.
a #GtkToolbar.
a #GtkWidget to add to the toolbar.
the element's tooltip.
used for context-sensitive help about this toolbar element.
Returns the position corresponding to the indicated point on
@toolbar. This is useful when dragging items to the toolbar:
this function returns the position a new item should be
inserted.
@x and @y are in @toolbar coordinates.
The position corresponding to the point (@x, @y) on the toolbar.
a #GtkToolbar
x coordinate of a point on the toolbar
y coordinate of a point on the toolbar
Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size().
the current icon size for the icons on
the toolbar.
a #GtkToolbar
Returns the position of @item on the toolbar, starting from 0.
It is an error if @item is not a child of the toolbar.
the position of item on the toolbar.
a #GtkToolbar
a #GtkToolItem that is a child of @toolbar
Returns the number of items on the toolbar.
the number of items on the toolbar
a #GtkToolbar
Returns the @n<!-- -->'th item on @toolbar, or %NULL if the
toolbar does not contain an @n<!-- -->'th item.
The @n<!-- -->'th #GtkToolItem on @toolbar,
or %NULL if there isn't an @n<!-- -->'th item.
a #GtkToolbar
A position on the toolbar
Retrieves the current orientation of the toolbar. See
gtk_toolbar_set_orientation().
Use gtk_orientable_get_orientation() instead.
the orientation
a #GtkToolbar
Returns the relief style of buttons on @toolbar. See
gtk_button_set_relief().
The relief style of buttons on @toolbar.
a #GtkToolbar
Returns whether the toolbar has an overflow menu.
See gtk_toolbar_set_show_arrow().
%TRUE if the toolbar has an overflow menu.
a #GtkToolbar
Retrieves whether the toolbar has text, icons, or both . See
gtk_toolbar_set_style().
the current style of @toolbar
a #GtkToolbar
Retrieves whether tooltips are enabled. See
gtk_toolbar_set_tooltips().
The toolkit-wide #GtkSettings:gtk-enable-tooltips property
is now used instead.
%TRUE if tooltips are enabled
a #GtkToolbar
Insert a #GtkToolItem into the toolbar at position @pos. If @pos is
0 the item is prepended to the start of the toolbar. If @pos is
negative, the item is appended to the end of the toolbar.
a #GtkToolbar
a #GtkToolItem
the position of the new item
Inserts a new element in the toolbar at the given position.
If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element.
If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine
the radio group for the new element. In all other cases, @widget must
be %NULL.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the new toolbar element as a #GtkWidget.
a #GtkToolbar.
a value of type #GtkToolbarChildType that determines what @widget
will be.
a #GtkWidget, or %NULL.
the element's label.
the element's tooltip.
used for context-sensitive help about this toolbar element.
a #GtkWidget that provides pictorial representation of the element's function.
the function to be executed when the button is pressed.
any data you wish to pass to the callback.
the number of widgets to insert this element after.
Inserts a new item into the toolbar. You must specify the position in the
toolbar where it will be inserted.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the new toolbar item as a #GtkWidget.
a #GtkToolbar.
give your toolbar button a label.
a string that appears when the user holds the mouse over this item.
use with #GtkTipsQuery.
a #GtkWidget that should be used as the button's icon.
the function to be executed when the button is pressed.
a pointer to any data you wish to be passed to the callback.
the number of widgets to insert this item after.
Inserts a new space in the toolbar at the specified position.
Use gtk_toolbar_insert() instead.
a #GtkToolbar
the number of widgets after which a space should be inserted.
Inserts a stock item at the specified position of the toolbar. If
@stock_id is not a known stock item ID, it's inserted verbatim,
except that underscores used to mark mnemonics are removed.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the inserted widget
A #GtkToolbar
The id of the stock item you want to insert
The text in the tooltip of the toolbar button
The private text of the tooltip
The callback called when the toolbar button is clicked.
user data passed to callback
The position the button shall be inserted at.
-1 means at the end.
Inserts a widget in the toolbar at the given position.
Use gtk_toolbar_insert() instead.
a #GtkToolbar.
a #GtkWidget to add to the toolbar.
the element's tooltip.
used for context-sensitive help about this toolbar element.
the number of widgets to insert this widget after.
Adds a new element to the beginning of a toolbar.
If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element.
If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine
the radio group for the new element. In all other cases, @widget must
be %NULL.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the new toolbar element as a #GtkWidget.
a #GtkToolbar.
a value of type #GtkToolbarChildType that determines what @widget will be.
a #GtkWidget, or %NULL
the element's label.
the element's tooltip.
used for context-sensitive help about this toolbar element.
a #GtkWidget that provides pictorial representation of the element's function.
the function to be executed when the button is pressed.
any data you wish to pass to the callback.
Adds a new button to the beginning (top or left edges) of the given toolbar.
@callback must be a pointer to a function taking a #GtkWidget and a gpointer as
arguments. Use G_CALLBACK() to cast the function to #GCallback.
Use gtk_toolbar_insert() instead.
the new toolbar item as a #GtkWidget.
a #GtkToolbar.
give your toolbar button a label.
a string that appears when the user holds the mouse over this item.
use with #GtkTipsQuery.
a #GtkWidget that should be used as the button's icon.
the function to be executed when the button is pressed.
a pointer to any data you wish to be passed to the callback.
Adds a new space to the beginning of the toolbar.
Use gtk_toolbar_insert() instead.
a #GtkToolbar.
Adds a widget to the beginning of the given toolbar.
Use gtk_toolbar_insert() instead.
a #GtkToolbar.
a #GtkWidget to add to the toolbar.
the element's tooltip.
used for context-sensitive help about this toolbar element.
Removes a space from the specified position.
Use gtk_toolbar_insert() instead.
a #GtkToolbar.
the index of the space to remove.
Highlights @toolbar to give an idea of what it would look like
if @item was added to @toolbar at the position indicated by @index_.
If @item is %NULL, highlighting is turned off. In that case @index_
is ignored.
The @tool_item passed to this function must not be part of any widget
hierarchy. When an item is set as drop highlight item it can not
added to any widget hierarchy or used as highlight item for another
toolbar.
a #GtkToolbar
a #GtkToolItem, or %NULL to turn of highlighting
a position on @toolbar
This function sets the size of stock icons in the toolbar. You
can call it both before you add the icons and after they've been
added. The size you set will override user preferences for the default
icon size.
This should only be used for special-purpose toolbars, normal
application toolbars should respect the user preferences for the
size of icons.
A #GtkToolbar
The #GtkIconSize that stock icons in the
toolbar shall have.
Sets whether a toolbar should appear horizontally or vertically.
Use gtk_orientable_set_orientation() instead.
a #GtkToolbar.
a new #GtkOrientation.
Sets whether to show an overflow menu when @toolbar isn’t allocated enough
size to show all of its items. If %TRUE, items which can’t fit in @toolbar,
and which have a proxy menu item set by gtk_tool_item_set_proxy_menu_item()
or #GtkToolItem::create-menu-proxy, will be available in an overflow menu,
which can be opened by an added arrow button. If %FALSE, @toolbar will
request enough size to fit all of its child items without any overflow.
a #GtkToolbar
Whether to show an overflow menu
Alters the view of @toolbar to display either icons only, text only, or both.
a #GtkToolbar.
the new style for @toolbar.
Sets if the tooltips of a toolbar should be active or not.
The toolkit-wide #GtkSettings:gtk-enable-tooltips property
is now used instead.
a #GtkToolbar.
set to %FALSE to disable the tooltips, or %TRUE to enable them.
Unsets toolbar icon size set with gtk_toolbar_set_icon_size(), so that
user preferences will be used to determine the icon size.
a #GtkToolbar
Unsets a toolbar style set with gtk_toolbar_set_style(), so that
user preferences will be used to determine the toolbar style.
a #GtkToolbar
The size of the icons in a toolbar is normally determined by
the toolbar-icon-size setting. When this property is set, it
overrides the setting.
This should only be used for special-purpose toolbars, normal
application toolbars should respect the user preferences for the
size of icons.
Is %TRUE if the icon-size property has been set.
If the tooltips of the toolbar should be active or not.
A keybinding signal used internally by GTK+. This signal can't
be used in application code
%TRUE if the signal was handled, %FALSE if not
%TRUE if the first item should be focused
Emitted when the orientation of the toolbar changes.
the new #GtkOrientation of the toolbar
Emitted when the user right-clicks the toolbar or uses the
keybinding to display a popup menu.
Application developers should handle this signal if they want
to display a context menu on the toolbar. The context-menu should
appear at the coordinates given by @x and @y. The mouse button
number is given by the @button parameter. If the menu was popped
up using the keybaord, @button is -1.
return %TRUE if the signal was handled, %FALSE if not
the x coordinate of the point where the menu should appear
the y coordinate of the point where the menu should appear
the mouse button the user pressed, or -1
Emitted when the style of the toolbar changes.
the new #GtkToolbarStyle of the toolbar
Triggers a new tooltip query on @display, in order to update the current
visible tooltip, or to show/hide the current tooltip. This function is
useful to call when, for example, the state of the widget changed by a
key press.
a #GdkDisplay
Replaces the widget packed into the tooltip with
@custom_widget. @custom_widget does not get destroyed when the tooltip goes
away.
By default a box with a #GtkImage and #GtkLabel is embedded in
the tooltip, which can be configured using gtk_tooltip_set_markup()
and gtk_tooltip_set_icon().
a #GtkTooltip
a #GtkWidget, or %NULL to unset the old custom widget.
Sets the icon of the tooltip (which is in front of the text) to be
@pixbuf. If @pixbuf is %NULL, the image will be hidden.
a #GtkTooltip
a #GdkPixbuf, or %NULL
Sets the icon of the tooltip (which is in front of the text)
to be the icon indicated by @gicon with the size indicated
by @size. If @gicon is %NULL, the image will be hidden.
a #GtkTooltip
a #GIcon representing the icon, or %NULL
a stock icon size
Sets the icon of the tooltip (which is in front of the text) to be
the icon indicated by @icon_name with the size indicated
by @size. If @icon_name is %NULL, the image will be hidden.
a #GtkTooltip
an icon name, or %NULL
a stock icon size
Sets the icon of the tooltip (which is in front of the text) to be
the stock item indicated by @stock_id with the size indicated
by @size. If @stock_id is %NULL, the image will be hidden.
a #GtkTooltip
a stock id, or %NULL
a stock icon size
Sets the text of the tooltip to be @markup, which is marked up
with the <link
linkend="PangoMarkupFormat">Pango text markup language</link>.
If @markup is %NULL, the label will be hidden.
a #GtkTooltip
a markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>) or %NULL
Sets the text of the tooltip to be @text. If @text is %NULL, the label
will be hidden. See also gtk_tooltip_set_markup().
a #GtkTooltip
a text string or %NULL
Sets the area of the widget, where the contents of this tooltip apply,
to be @rect (in widget coordinates). This is especially useful for
properly setting tooltips on #GtkTreeView rows and cells, #GtkIconViews,
etc.
For setting tooltips on #GtkTreeView, please refer to the convenience
functions for this: gtk_tree_view_set_tooltip_row() and
gtk_tree_view_set_tooltip_cell().
a #GtkTooltip
a #GdkRectangle
Determines the tooltips and the widget they belong to from the window in
which they are displayed.
This function is mostly intended for use by accessibility technologies;
applications should have little use for it.
%TRUE if @tip_window is displaying tooltips, otherwise %FALSE.
a #GtkWindow
the return location for the tooltips which are displayed
in @tip_window, or %NULL
the return location for the widget whose tooltips
are displayed, or %NULL
Adds a tooltip containing the message @tip_text to the specified #GtkWidget.
a #GtkTooltips.
the #GtkWidget you wish to associate the tip with.
a string containing the tip itself.
a string of any further information that may be useful if the user gets stuck.
Asks the #GtkTreeDragDest to insert a row before the path @dest,
deriving the contents of the row from @selection_data. If @dest is
outside the tree so that inserting before it is impossible, %FALSE
will be returned. Also, %FALSE may be returned if the new row is
not created for some model-specific reason. Should robustly handle
a @dest no longer found in the model!
whether a new row was created before position @dest
a #GtkTreeDragDest
row to drop in front of
data to drop
Determines whether a drop is possible before the given @dest_path,
at the same depth as @dest_path. i.e., can we drop the data in
@selection_data at that location. @dest_path does not have to
exist; the return value will almost certainly be %FALSE if the
parent of @dest_path doesn't exist, though.
%TRUE if a drop is possible before @dest_path
a #GtkTreeDragDest
destination row
the data being dragged
Asks the #GtkTreeDragDest to insert a row before the path @dest,
deriving the contents of the row from @selection_data. If @dest is
outside the tree so that inserting before it is impossible, %FALSE
will be returned. Also, %FALSE may be returned if the new row is
not created for some model-specific reason. Should robustly handle
a @dest no longer found in the model!
whether a new row was created before position @dest
a #GtkTreeDragDest
row to drop in front of
data to drop
Determines whether a drop is possible before the given @dest_path,
at the same depth as @dest_path. i.e., can we drop the data in
@selection_data at that location. @dest_path does not have to
exist; the return value will almost certainly be %FALSE if the
parent of @dest_path doesn't exist, though.
%TRUE if a drop is possible before @dest_path
a #GtkTreeDragDest
destination row
the data being dragged
whether a new row was created before position @dest
a #GtkTreeDragDest
row to drop in front of
data to drop
%TRUE if a drop is possible before @dest_path
a #GtkTreeDragDest
destination row
the data being dragged
Asks the #GtkTreeDragSource to delete the row at @path, because
it was moved somewhere else via drag-and-drop. Returns %FALSE
if the deletion fails because @path no longer exists, or for
some model-specific reason. Should robustly handle a @path no
longer found in the model!
%TRUE if the row was successfully deleted
a #GtkTreeDragSource
row that was being dragged
Asks the #GtkTreeDragSource to fill in @selection_data with a
representation of the row at @path. @selection_data->target gives
the required type of the data. Should robustly handle a @path no
longer found in the model!
%TRUE if data of the required type was provided
a #GtkTreeDragSource
row that was dragged
a #GtkSelectionData to fill with data
from the dragged row
Asks the #GtkTreeDragSource whether a particular row can be used as
the source of a DND operation. If the source doesn't implement
this interface, the row is assumed draggable.
%TRUE if the row can be dragged
a #GtkTreeDragSource
row on which user is initiating a drag
Asks the #GtkTreeDragSource to delete the row at @path, because
it was moved somewhere else via drag-and-drop. Returns %FALSE
if the deletion fails because @path no longer exists, or for
some model-specific reason. Should robustly handle a @path no
longer found in the model!
%TRUE if the row was successfully deleted
a #GtkTreeDragSource
row that was being dragged
Asks the #GtkTreeDragSource to fill in @selection_data with a
representation of the row at @path. @selection_data->target gives
the required type of the data. Should robustly handle a @path no
longer found in the model!
%TRUE if data of the required type was provided
a #GtkTreeDragSource
row that was dragged
a #GtkSelectionData to fill with data
from the dragged row
Asks the #GtkTreeDragSource whether a particular row can be used as
the source of a DND operation. If the source doesn't implement
this interface, the row is assumed draggable.
%TRUE if the row can be dragged
a #GtkTreeDragSource
row on which user is initiating a drag
%TRUE if the row can be dragged
a #GtkTreeDragSource
row on which user is initiating a drag
%TRUE if data of the required type was provided
a #GtkTreeDragSource
row that was dragged
a #GtkSelectionData to fill with data
from the dragged row
%TRUE if the row was successfully deleted
a #GtkTreeDragSource
row that was being dragged
Creates a dynamically allocated tree iterator as a copy of @iter.
This function is not intended for use in applications, because you
can just copy the structs by value
(<literal>GtkTreeIter new_iter = iter;</literal>).
You must free this iter with gtk_tree_iter_free().
a newly-allocated copy of @iter.
A #GtkTreeIter.
Frees an iterator that has been allocated by gtk_tree_iter_copy().
This function is mainly used for language bindings.
A dynamically allocated tree iterator.
Returns the type of the column.
The type of the column.
A #GtkTreeModel.
The column index.
Returns a set of flags supported by this interface. The flags are a bitwise
combination of #GtkTreeModelFlags. The flags supported should not change
during the lifecycle of the @tree_model.
The flags supported by this interface.
A #GtkTreeModel.
Sets @iter to a valid iterator pointing to @path.
%TRUE, if @iter was set.
A #GtkTreeModel.
The uninitialized #GtkTreeIter.
The #GtkTreePath.
Returns the number of columns supported by @tree_model.
The number of columns.
A #GtkTreeModel.
Returns a newly-created #GtkTreePath referenced by @iter. This path should
be freed with gtk_tree_path_free().
a newly-created #GtkTreePath.
A #GtkTreeModel.
The #GtkTreeIter.
Initializes and sets @value to that at @column.
When done with @value, g_value_unset() needs to be called
to free any allocated memory.
A #GtkTreeModel.
The #GtkTreeIter.
The column to lookup the value at.
An empty #GValue to set.
Sets @iter to point to the first child of @parent. If @parent has no
children, %FALSE is returned and @iter is set to be invalid. @parent
will remain a valid node after this function has been called.
If @parent is %NULL returns the first node, equivalent to
<literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
%TRUE, if @child has been set to the first child.
A #GtkTreeModel.
The new #GtkTreeIter to be set to the child.
The #GtkTreeIter, or %NULL
Returns %TRUE if @iter has children, %FALSE otherwise.
%TRUE if @iter has children.
A #GtkTreeModel.
The #GtkTreeIter to test for children.
Returns the number of children that @iter has. As a special case, if @iter
is %NULL, then the number of toplevel nodes is returned.
The number of children of @iter.
A #GtkTreeModel.
The #GtkTreeIter, or %NULL.
Sets @iter to point to the node following it at the current level. If there
is no next @iter, %FALSE is returned and @iter is set to be invalid.
%TRUE if @iter has been changed to the next node.
A #GtkTreeModel.
The #GtkTreeIter.
Sets @iter to be the child of @parent, using the given index. The first
index is 0. If @n is too big, or @parent has no children, @iter is set
to an invalid iterator and %FALSE is returned. @parent will remain a valid
node after this function has been called. As a special case, if @parent is
%NULL, then the @n<!-- -->th root node is set.
%TRUE, if @parent has an @n<!-- -->th child.
A #GtkTreeModel.
The #GtkTreeIter to set to the nth child.
The #GtkTreeIter to get the child from, or %NULL.
Then index of the desired child.
Sets @iter to be the parent of @child. If @child is at the toplevel, and
doesn't have a parent, then @iter is set to an invalid iterator and %FALSE
is returned. @child will remain a valid node after this function has been
called.
%TRUE, if @iter is set to the parent of @child.
A #GtkTreeModel
The new #GtkTreeIter to set to the parent.
The #GtkTreeIter.
Lets the tree ref the node. This is an optional method for models to
implement. To be more specific, models may ignore this call as it exists
primarily for performance reasons.
This function is primarily meant as a way for views to let caching model
know when nodes are being displayed (and hence, whether or not to cache that
node.) For example, a file-system based model would not want to keep the
entire file-hierarchy in memory, just the sections that are currently being
displayed by every current view.
A model should be expected to be able to get an iter independent of its
reffed state.
A #GtkTreeModel.
The #GtkTreeIter.
Emits the "row-changed" signal on @tree_model.
A #GtkTreeModel
A #GtkTreePath pointing to the changed row
A valid #GtkTreeIter pointing to the changed row
Emits the "row-deleted" signal on @tree_model. This should be called by
models after a row has been removed. The location pointed to by @path
should be the location that the row previously was at. It may not be a
valid location anymore.
A #GtkTreeModel
A #GtkTreePath pointing to the previous location of the deleted row.
Emits the "row-has-child-toggled" signal on @tree_model. This should be
called by models after the child state of a node changes.
A #GtkTreeModel
A #GtkTreePath pointing to the changed row
A valid #GtkTreeIter pointing to the changed row
Emits the "row-inserted" signal on @tree_model
A #GtkTreeModel
A #GtkTreePath pointing to the inserted row
A valid #GtkTreeIter pointing to the inserted row
Emits the "rows-reordered" signal on @tree_model. This should be called by
models when their rows have been reordered.
A #GtkTreeModel
A #GtkTreePath pointing to the tree node whose children have been
reordered
A valid #GtkTreeIter pointing to the node whose children have been
reordered, or %NULL if the depth of @path is 0.
an array of integers mapping the current position of each child
to its old position before the re-ordering,
i.e. @new_order<literal>[newpos] = oldpos</literal>.
Lets the tree unref the node. This is an optional method for models to
implement. To be more specific, models may ignore this call as it exists
primarily for performance reasons.
For more information on what this means, see gtk_tree_model_ref_node().
Please note that nodes that are deleted are not unreffed.
A #GtkTreeModel.
The #GtkTreeIter.
Creates a new #GtkTreeModel, with @child_model as the child_model
and @root as the virtual root.
A new #GtkTreeModel.
A #GtkTreeModel.
A #GtkTreePath or %NULL.
Calls func on each node in model in a depth-first fashion.
If @func returns %TRUE, then the tree ceases to be walked, and
gtk_tree_model_foreach() returns.
A #GtkTreeModel
A function to be called on each row
User data to passed to func.
Gets the value of one or more cells in the row referenced by @iter.
The variable argument list should contain integer column numbers,
each column number followed by a place to store the value being
retrieved. The list is terminated by a -1. For example, to get a
value from column 0 with type %G_TYPE_STRING, you would
write: <literal>gtk_tree_model_get (model, iter, 0, &place_string_here, -1)</literal>,
where <literal>place_string_here</literal> is a <type>gchar*</type> to be
filled with the string.
Returned values with type %G_TYPE_OBJECT have to be unreferenced, values
with type %G_TYPE_STRING or %G_TYPE_BOXED have to be freed. Other values are
passed by value.
a #GtkTreeModel
a row in @tree_model
pairs of column number and value return locations, terminated by -1
Returns the type of the column.
The type of the column.
A #GtkTreeModel.
The column index.
Returns a set of flags supported by this interface. The flags are a bitwise
combination of #GtkTreeModelFlags. The flags supported should not change
during the lifecycle of the @tree_model.
The flags supported by this interface.
A #GtkTreeModel.
Sets @iter to a valid iterator pointing to @path.
%TRUE, if @iter was set.
A #GtkTreeModel.
The uninitialized #GtkTreeIter.
The #GtkTreePath.
Initializes @iter with the first iterator in the tree (the one at the path
"0") and returns %TRUE. Returns %FALSE if the tree is empty.
%TRUE, if @iter was set.
A #GtkTreeModel.
The uninitialized #GtkTreeIter.
Sets @iter to a valid iterator pointing to @path_string, if it
exists. Otherwise, @iter is left invalid and %FALSE is returned.
%TRUE, if @iter was set.
A #GtkTreeModel.
An uninitialized #GtkTreeIter.
A string representation of a #GtkTreePath.
Returns the number of columns supported by @tree_model.
The number of columns.
A #GtkTreeModel.
Returns a newly-created #GtkTreePath referenced by @iter. This path should
be freed with gtk_tree_path_free().
a newly-created #GtkTreePath.
A #GtkTreeModel.
The #GtkTreeIter.
Generates a string representation of the iter. This string is a ':'
separated list of numbers. For example, "4:10:0:3" would be an
acceptable return value for this string.
A newly-allocated string. Must be freed with g_free().
A #GtkTreeModel.
An #GtkTreeIter.
See gtk_tree_model_get(), this version takes a <type>va_list</type>
for language bindings to use.
a #GtkTreeModel
a row in @tree_model
<type>va_list</type> of column/return location pairs
Initializes and sets @value to that at @column.
When done with @value, g_value_unset() needs to be called
to free any allocated memory.
A #GtkTreeModel.
The #GtkTreeIter.
The column to lookup the value at.
An empty #GValue to set.
Sets @iter to point to the first child of @parent. If @parent has no
children, %FALSE is returned and @iter is set to be invalid. @parent
will remain a valid node after this function has been called.
If @parent is %NULL returns the first node, equivalent to
<literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
%TRUE, if @child has been set to the first child.
A #GtkTreeModel.
The new #GtkTreeIter to be set to the child.
The #GtkTreeIter, or %NULL
Returns %TRUE if @iter has children, %FALSE otherwise.
%TRUE if @iter has children.
A #GtkTreeModel.
The #GtkTreeIter to test for children.
Returns the number of children that @iter has. As a special case, if @iter
is %NULL, then the number of toplevel nodes is returned.
The number of children of @iter.
A #GtkTreeModel.
The #GtkTreeIter, or %NULL.
Sets @iter to point to the node following it at the current level. If there
is no next @iter, %FALSE is returned and @iter is set to be invalid.
%TRUE if @iter has been changed to the next node.
A #GtkTreeModel.
The #GtkTreeIter.
Sets @iter to be the child of @parent, using the given index. The first
index is 0. If @n is too big, or @parent has no children, @iter is set
to an invalid iterator and %FALSE is returned. @parent will remain a valid
node after this function has been called. As a special case, if @parent is
%NULL, then the @n<!-- -->th root node is set.
%TRUE, if @parent has an @n<!-- -->th child.
A #GtkTreeModel.
The #GtkTreeIter to set to the nth child.
The #GtkTreeIter to get the child from, or %NULL.
Then index of the desired child.
Sets @iter to be the parent of @child. If @child is at the toplevel, and
doesn't have a parent, then @iter is set to an invalid iterator and %FALSE
is returned. @child will remain a valid node after this function has been
called.
%TRUE, if @iter is set to the parent of @child.
A #GtkTreeModel
The new #GtkTreeIter to set to the parent.
The #GtkTreeIter.
Lets the tree ref the node. This is an optional method for models to
implement. To be more specific, models may ignore this call as it exists
primarily for performance reasons.
This function is primarily meant as a way for views to let caching model
know when nodes are being displayed (and hence, whether or not to cache that
node.) For example, a file-system based model would not want to keep the
entire file-hierarchy in memory, just the sections that are currently being
displayed by every current view.
A model should be expected to be able to get an iter independent of its
reffed state.
A #GtkTreeModel.
The #GtkTreeIter.
Emits the "row-changed" signal on @tree_model.
A #GtkTreeModel
A #GtkTreePath pointing to the changed row
A valid #GtkTreeIter pointing to the changed row
Emits the "row-deleted" signal on @tree_model. This should be called by
models after a row has been removed. The location pointed to by @path
should be the location that the row previously was at. It may not be a
valid location anymore.
A #GtkTreeModel
A #GtkTreePath pointing to the previous location of the deleted row.
Emits the "row-has-child-toggled" signal on @tree_model. This should be
called by models after the child state of a node changes.
A #GtkTreeModel
A #GtkTreePath pointing to the changed row
A valid #GtkTreeIter pointing to the changed row
Emits the "row-inserted" signal on @tree_model
A #GtkTreeModel
A #GtkTreePath pointing to the inserted row
A valid #GtkTreeIter pointing to the inserted row
Emits the "rows-reordered" signal on @tree_model. This should be called by
models when their rows have been reordered.
A #GtkTreeModel
A #GtkTreePath pointing to the tree node whose children have been
reordered
A valid #GtkTreeIter pointing to the node whose children have been
reordered, or %NULL if the depth of @path is 0.
an array of integers mapping the current position of each child
to its old position before the re-ordering,
i.e. @new_order<literal>[newpos] = oldpos</literal>.
Creates a new #GtkTreeModel, with @child_model as the child model.
A new #GtkTreeModel.
A #GtkTreeModel
Lets the tree unref the node. This is an optional method for models to
implement. To be more specific, models may ignore this call as it exists
primarily for performance reasons.
For more information on what this means, see gtk_tree_model_ref_node().
Please note that nodes that are deleted are not unreffed.
A #GtkTreeModel.
The #GtkTreeIter.
This signal is emitted when a row in the model has changed.
a #GtkTreePath identifying the changed row
a valid #GtkTreeIter pointing to the changed row
This signal is emitted when a row has been deleted.
Note that no iterator is passed to the signal handler,
since the row is already deleted.
This should be called by models after a row has been removed.
The location pointed to by @path should be the location that
the row previously was at. It may not be a valid location anymore.
a #GtkTreePath identifying the row
This signal is emitted when a row has gotten the first child row or lost
its last child row.
a #GtkTreePath identifying the row
a valid #GtkTreeIter pointing to the row
This signal is emitted when a new row has been inserted in the model.
Note that the row may still be empty at this point, since
it is a common pattern to first insert an empty row, and
then fill it with the desired values.
a #GtkTreePath identifying the new row
a valid #GtkTreeIter pointing to the new row
This signal is emitted when the children of a node in the #GtkTreeModel
have been reordered.
Note that this signal is <emphasis>not</emphasis> emitted
when rows are reordered by DND, since this is implemented
by removing and then reinserting the row.
a #GtkTreePath identifying the tree node whose children
have been reordered
a valid #GtkTreeIter pointing to the node whose
an array of integers mapping the current position of
each child to its old position before the re-ordering,
i.e. @new_order<literal>[newpos] = oldpos</literal>.
This function should almost never be called. It clears the @filter
of any cached iterators that haven't been reffed with
gtk_tree_model_ref_node(). This might be useful if the child model
being filtered is static (and doesn't change often) and there has been
a lot of unreffed access to nodes. As a side effect of this function,
all unreffed iters will be invalid.
A #GtkTreeModelFilter.
Sets @filter_iter to point to the row in @filter that corresponds to the
row pointed at by @child_iter. If @filter_iter was not set, %FALSE is
returned.
%TRUE, if @filter_iter was set, i.e. if @child_iter is a
valid iterator pointing to a visible row in child model.
A #GtkTreeModelFilter.
An uninitialized #GtkTreeIter.
A valid #GtkTreeIter pointing to a row on the child model.
Converts @child_path to a path relative to @filter. That is, @child_path
points to a path in the child model. The rerturned path will point to the
same row in the filtered model. If @child_path isn't a valid path on the
child model or points to a row which is not visible in @filter, then %NULL
is returned.
A newly allocated #GtkTreePath, or %NULL.
A #GtkTreeModelFilter.
A #GtkTreePath to convert.
Sets @child_iter to point to the row pointed to by @filter_iter.
A #GtkTreeModelFilter.
An uninitialized #GtkTreeIter.
A valid #GtkTreeIter pointing to a row on @filter.
Converts @filter_path to a path on the child model of @filter. That is,
@filter_path points to a location in @filter. The returned path will
point to the same location in the model not being filtered. If @filter_path
does not point to a location in the child model, %NULL is returned.
A newly allocated #GtkTreePath, or %NULL.
A #GtkTreeModelFilter.
A #GtkTreePath to convert.
Returns a pointer to the child model of @filter.
A pointer to a #GtkTreeModel.
A #GtkTreeModelFilter.
Emits ::row_changed for each row in the child model, which causes
the filter to re-evaluate whether a row is visible or not.
A #GtkTreeModelFilter.
With the @n_columns and @types parameters, you give an array of column
types for this model (which will be exposed to the parent model/view).
The @func, @data and @destroy parameters are for specifying the modify
function. The modify function will get called for <emphasis>each</emphasis>
data access, the goal of the modify function is to return the data which
should be displayed at the location specified using the parameters of the
modify function.
A #GtkTreeModelFilter.
The number of columns in the filter model.
The #GType<!-- -->s of the columns.
A #GtkTreeModelFilterModifyFunc
User data to pass to the modify function, or %NULL.
Destroy notifier of @data, or %NULL.
Sets @column of the child_model to be the column where @filter should
look for visibility information. @columns should be a column of type
%G_TYPE_BOOLEAN, where %TRUE means that a row is visible, and %FALSE
if not.
A #GtkTreeModelFilter.
A #gint which is the column containing the visible information.
Sets the visible function used when filtering the @filter to be @func. The
function should return %TRUE if the given row should be visible and
%FALSE otherwise.
If the condition calculated by the function changes over time (e.g. because
it depends on some global parameters), you must call
gtk_tree_model_filter_refilter() to keep the visibility information of
the model uptodate.
Note that @func is called whenever a row is inserted, when it may still be
empty. The visible function should therefore take special care of empty
rows, like in the example below.
<informalexample><programlisting>
static gboolean
visible_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
/* Visible if row is non-empty and first column is "HI" */
gchar *str;
gboolean visible = FALSE;
gtk_tree_model_get (model, iter, 0, &str, -1);
if (str && strcmp (str, "HI") == 0)
visible = TRUE;
g_free (str);
return visible;
}
</programlisting></informalexample>
A #GtkTreeModelFilter.
A #GtkTreeModelFilterVisibleFunc, the visible function.
User data to pass to the visible function, or %NULL.
Destroy notifier of @data, or %NULL.
A #GtkTreeModel
A #GtkTreePath pointing to the changed row
A valid #GtkTreeIter pointing to the changed row
A #GtkTreeModel
A #GtkTreePath pointing to the inserted row
A valid #GtkTreeIter pointing to the inserted row
A #GtkTreeModel
A #GtkTreePath pointing to the changed row
A valid #GtkTreeIter pointing to the changed row
A #GtkTreeModel
A #GtkTreePath pointing to the previous location of the deleted row.
A #GtkTreeModel
A #GtkTreePath pointing to the tree node whose children have been
reordered
A valid #GtkTreeIter pointing to the node whose children have been
reordered, or %NULL if the depth of @path is 0.
an array of integers mapping the current position of each child
to its old position before the re-ordering,
i.e. @new_order<literal>[newpos] = oldpos</literal>.
The flags supported by this interface.
A #GtkTreeModel.
The number of columns.
A #GtkTreeModel.
The type of the column.
A #GtkTreeModel.
The column index.
%TRUE, if @iter was set.
A #GtkTreeModel.
The uninitialized #GtkTreeIter.
The #GtkTreePath.
a newly-created #GtkTreePath.
A #GtkTreeModel.
The #GtkTreeIter.
A #GtkTreeModel.
The #GtkTreeIter.
The column to lookup the value at.
An empty #GValue to set.
%TRUE if @iter has been changed to the next node.
A #GtkTreeModel.
The #GtkTreeIter.
%TRUE, if @child has been set to the first child.
A #GtkTreeModel.
The new #GtkTreeIter to be set to the child.
The #GtkTreeIter, or %NULL
%TRUE if @iter has children.
A #GtkTreeModel.
The #GtkTreeIter to test for children.
The number of children of @iter.
A #GtkTreeModel.
The #GtkTreeIter, or %NULL.
%TRUE, if @parent has an @n<!-- -->th child.
A #GtkTreeModel.
The #GtkTreeIter to set to the nth child.
The #GtkTreeIter to get the child from, or %NULL.
Then index of the desired child.
%TRUE, if @iter is set to the parent of @child.
A #GtkTreeModel
The new #GtkTreeIter to set to the parent.
The #GtkTreeIter.
A #GtkTreeModel.
The #GtkTreeIter.
A #GtkTreeModel.
The #GtkTreeIter.
This function should almost never be called. It clears the @tree_model_sort
of any cached iterators that haven't been reffed with
gtk_tree_model_ref_node(). This might be useful if the child model being
sorted is static (and doesn't change often) and there has been a lot of
unreffed access to nodes. As a side effect of this function, all unreffed
iters will be invalid.
A #GtkTreeModelSort
Sets @sort_iter to point to the row in @tree_model_sort that corresponds to
the row pointed at by @child_iter. If @sort_iter was not set, %FALSE
is returned. Note: a boolean is only returned since 2.14.
%TRUE, if @sort_iter was set, i.e. if @sort_iter is a
valid iterator pointer to a visible row in the child model.
A #GtkTreeModelSort
An uninitialized #GtkTreeIter.
A valid #GtkTreeIter pointing to a row on the child model
Converts @child_path to a path relative to @tree_model_sort. That is,
@child_path points to a path in the child model. The returned path will
point to the same row in the sorted model. If @child_path isn't a valid
path on the child model, then %NULL is returned.
A newly allocated #GtkTreePath, or %NULL
A #GtkTreeModelSort
A #GtkTreePath to convert
Sets @child_iter to point to the row pointed to by @sorted_iter.
A #GtkTreeModelSort
An uninitialized #GtkTreeIter
A valid #GtkTreeIter pointing to a row on @tree_model_sort.
Converts @sorted_path to a path on the child model of @tree_model_sort.
That is, @sorted_path points to a location in @tree_model_sort. The
returned path will point to the same location in the model not being
sorted. If @sorted_path does not point to a location in the child model,
%NULL is returned.
A newly allocated #GtkTreePath, or %NULL
A #GtkTreeModelSort
A #GtkTreePath to convert
Returns the model the #GtkTreeModelSort is sorting.
the "child model" being sorted
a #GtkTreeModelSort
<warning><para>
This function is slow. Only use it for debugging and/or testing purposes.
</para></warning>
Checks if the given iter is a valid iter for this #GtkTreeModelSort.
%TRUE if the iter is valid, %FALSE if the iter is invalid.
A #GtkTreeModelSort.
A #GtkTreeIter.
This resets the default sort function to be in the 'unsorted' state. That
is, it is in the same order as the child model. It will re-sort the model
to be in the same order as the child model only if the #GtkTreeModelSort
is in 'unsorted' state.
A #GtkTreeModelSort
Creates a new #GtkTreePath. This structure refers to a row.
A newly created #GtkTreePath.
Creates a new #GtkTreePath. The string representation of this path is "0"
A new #GtkTreePath.
Creates a new path with @first_index and @varargs as indices.
A newly created #GtkTreePath.
first integer
Creates a new #GtkTreePath initialized to @path. @path is expected to be a
colon separated list of numbers. For example, the string "10:4:0" would
create a path of depth 3 pointing to the 11th child of the root node, the 5th
child of that 11th child, and the 1st child of that 5th child. If an invalid
path string is passed in, %NULL is returned.
A newly-created #GtkTreePath, or %NULL
The string representation of a path.
Appends a new index to a path. As a result, the depth of the path is
increased.
A #GtkTreePath.
The index.
Compares two paths. If @a appears before @b in a tree, then -1 is returned.
If @b appears before @a, then 1 is returned. If the two nodes are equal,
then 0 is returned.
The relative positions of @a and @b
A #GtkTreePath.
A #GtkTreePath to compare with.
Creates a new #GtkTreePath as a copy of @path.
A new #GtkTreePath.
A #GtkTreePath.
Moves @path to point to the first child of the current path.
A #GtkTreePath.
Frees @path.
A #GtkTreePath.
Returns the current depth of @path.
The depth of @path
A #GtkTreePath.
Returns the current indices of @path. This is an array of integers, each
representing a node in a tree. This value should not be freed.
The current indices, or %NULL.
A #GtkTreePath.
Returns the current indices of @path.
This is an array of integers, each representing a node in a tree.
It also returns the number of elements in the array.
The array should not be freed.
The current indices, or %NULL.
A #GtkTreePath.
Number of elements returned in the integer array
Returns %TRUE if @descendant is a descendant of @path.
%TRUE if @descendant is contained inside @path
a #GtkTreePath
another #GtkTreePath
Returns %TRUE if @path is a descendant of @ancestor.
%TRUE if @ancestor contains @path somewhere below it
a #GtkTreePath
another #GtkTreePath
Moves the @path to point to the next node at the current depth.
A #GtkTreePath.
Prepends a new index to a path. As a result, the depth of the path is
increased.
A #GtkTreePath.
The index.
Moves the @path to point to the previous node at the current depth,
if it exists.
%TRUE if @path has a previous node, and the move was made.
A #GtkTreePath.
Generates a string representation of the path. This string is a ':'
separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
A newly-allocated string. Must be freed with g_free().
A #GtkTreePath
Moves the @path to point to its parent node, if it has a parent.
%TRUE if @path has a parent, and the move was made.
A #GtkTreePath.
Creates a row reference based on @path. This reference will keep pointing
to the node pointed to by @path, so long as it exists. It listens to all
signals emitted by @model, and updates its path appropriately. If @path
isn't a valid path in @model, then %NULL is returned.
A newly allocated #GtkTreeRowReference, or %NULL
A #GtkTreeModel
A valid #GtkTreePath to monitor
You do not need to use this function. Creates a row reference based on
@path. This reference will keep pointing to the node pointed to by @path,
so long as it exists. If @path isn't a valid path in @model, then %NULL is
returned. However, unlike references created with
gtk_tree_row_reference_new(), it does not listen to the model for changes.
The creator of the row reference must do this explicitly using
gtk_tree_row_reference_inserted(), gtk_tree_row_reference_deleted(),
gtk_tree_row_reference_reordered().
These functions must be called exactly once per proxy when the
corresponding signal on the model is emitted. This single call
updates all row references for that proxy. Since built-in GTK+
objects like #GtkTreeView already use this mechanism internally,
using them as the proxy object will produce unpredictable results.
Further more, passing the same object as @model and @proxy
doesn't work for reasons of internal implementation.
This type of row reference is primarily meant by structures that need to
carefully monitor exactly when a row reference updates itself, and is not
generally needed by most applications.
A newly allocated #GtkTreeRowReference, or %NULL
A proxy #GObject
A #GtkTreeModel
A valid #GtkTreePath to monitor
Copies a #GtkTreeRowReference.
a copy of @reference.
a #GtkTreeRowReference
Free's @reference. @reference may be %NULL.
A #GtkTreeRowReference, or %NULL
Returns the model that the row reference is monitoring.
the model
A #GtkTreeRowReference
Returns a path that the row reference currently points to, or %NULL if the
path pointed to is no longer valid.
A current path, or %NULL.
A #GtkTreeRowReference
Returns %TRUE if the @reference is non-%NULL and refers to a current valid
path.
%TRUE if @reference points to a valid path.
A #GtkTreeRowReference, or %NULL
Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
know that the model emitted the "row_deleted" signal.
A #GObject
The path position that was deleted
Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
know that the model emitted the "row_inserted" signal.
A #GObject
The row position that was inserted
Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
know that the model emitted the "rows_reordered" signal.
A #GObject
The parent path of the reordered signal
The iter pointing to the parent of the reordered
The new order of rows
Returns the number of rows that have been selected in @tree.
The number of rows selected.
A #GtkTreeSelection.
Gets the selection mode for @selection. See
gtk_tree_selection_set_mode().
the current selection mode
a #GtkTreeSelection
Returns the current selection function.
The function.
A #GtkTreeSelection.
Sets @iter to the currently selected node if @selection is set to
#GTK_SELECTION_SINGLE or #GTK_SELECTION_BROWSE. @iter may be NULL if you
just want to test if @selection has any selected nodes. @model is filled
with the current model as a convenience. This function will not work if you
use @selection is #GTK_SELECTION_MULTIPLE.
TRUE, if there is a selected node.
A #GtkTreeSelection.
A pointer to set to the #GtkTreeModel, or NULL.
The #GtkTreeIter, or NULL.
Creates a list of path of all selected rows. Additionally, if you are
planning on modifying the model after calling this function, you may
want to convert the returned list into a list of #GtkTreeRowReference<!-- -->s.
To do this, you can use gtk_tree_row_reference_new().
To free the return value, use:
|[
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
]|
A #GList containing a #GtkTreePath for each selected row.
A #GtkTreeSelection.
A pointer to set to the #GtkTreeModel, or %NULL.
Returns the tree view associated with @selection.
A #GtkTreeView
A #GtkTreeSelection
Returns the user data for the selection function.
The user data.
A #GtkTreeSelection.
Returns %TRUE if the row at @iter is currently selected.
%TRUE, if @iter is selected
A #GtkTreeSelection
A valid #GtkTreeIter
Returns %TRUE if the row pointed to by @path is currently selected. If @path
does not point to a valid location, %FALSE is returned
%TRUE if @path is selected.
A #GtkTreeSelection.
A #GtkTreePath to check selection on.
Selects all the nodes. @selection must be set to #GTK_SELECTION_MULTIPLE
mode.
A #GtkTreeSelection.
Selects the specified iterator.
A #GtkTreeSelection.
The #GtkTreeIter to be selected.
Select the row at @path.
A #GtkTreeSelection.
The #GtkTreePath to be selected.
Selects a range of nodes, determined by @start_path and @end_path inclusive.
@selection must be set to #GTK_SELECTION_MULTIPLE mode.
A #GtkTreeSelection.
The initial node of the range.
The final node of the range.
Calls a function for each selected node. Note that you cannot modify
the tree or selection from within this function. As a result,
gtk_tree_selection_get_selected_rows() might be more useful.
A #GtkTreeSelection.
The function to call for each selected node.
user data to pass to the function.
Sets the selection mode of the @selection. If the previous type was
#GTK_SELECTION_MULTIPLE, then the anchor is kept selected, if it was
previously selected.
A #GtkTreeSelection.
The selection mode
Sets the selection function. If set, this function is called before any node
is selected or unselected, giving some control over which nodes are selected.
The select function should return %TRUE if the state of the node may be toggled,
and %FALSE if the state of the node should be left unchanged.
A #GtkTreeSelection.
The selection function.
The selection function's data.
The destroy function for user data. May be NULL.
Unselects all the nodes.
A #GtkTreeSelection.
Unselects the specified iterator.
A #GtkTreeSelection.
The #GtkTreeIter to be unselected.
Unselects the row at @path.
A #GtkTreeSelection.
The #GtkTreePath to be unselected.
Unselects a range of nodes, determined by @start_path and @end_path
inclusive.
A #GtkTreeSelection.
The initial node of the range.
The initial node of the range.
Fills in @sort_column_id and @order with the current sort column and the
order. It returns %TRUE unless the @sort_column_id is
%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
%TRUE if the sort column is not one of the special sort
column ids.
A #GtkTreeSortable
The sort column id to be filled in
The #GtkSortType to be filled in
Returns %TRUE if the model has a default sort function. This is used
primarily by GtkTreeViewColumns in order to determine if a model can
go back to the default state, or not.
%TRUE, if the model has a default sort function
A #GtkTreeSortable
Sets the default comparison function used when sorting to be @sort_func.
If the current sort column id of @sortable is
%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
this function.
If @sort_func is %NULL, then there will be no default comparison function.
This means that once the model has been sorted, it can't go back to the
default state. In this case, when the current sort column id of @sortable
is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
A #GtkTreeSortable
Destroy notifier of @user_data, or %NULL
Sets the current sort column to be @sort_column_id. The @sortable will
resort itself to reflect this change, after emitting a
#GtkTreeSortable::sort-column-changed signal. @sort_column_id may either be
a regular column id, or one of the following special values:
<variablelist>
<varlistentry>
<term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
<listitem>the default sort function will be used, if it is set</listitem>
</varlistentry>
<varlistentry>
<term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
<listitem>no sorting will occur</listitem>
</varlistentry>
</variablelist>
A #GtkTreeSortable
the sort column id to set
The sort order of the column
Sets the comparison function used when sorting to be @sort_func. If the
current sort column id of @sortable is the same as @sort_column_id, then
the model will sort using this function.
A #GtkTreeSortable
the sort column id to set the function for
Destroy notifier of @user_data, or %NULL
Emits a #GtkTreeSortable::sort-column-changed signal on @sortable.
A #GtkTreeSortable
Fills in @sort_column_id and @order with the current sort column and the
order. It returns %TRUE unless the @sort_column_id is
%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
%TRUE if the sort column is not one of the special sort
column ids.
A #GtkTreeSortable
The sort column id to be filled in
The #GtkSortType to be filled in
Returns %TRUE if the model has a default sort function. This is used
primarily by GtkTreeViewColumns in order to determine if a model can
go back to the default state, or not.
%TRUE, if the model has a default sort function
A #GtkTreeSortable
Sets the default comparison function used when sorting to be @sort_func.
If the current sort column id of @sortable is
%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
this function.
If @sort_func is %NULL, then there will be no default comparison function.
This means that once the model has been sorted, it can't go back to the
default state. In this case, when the current sort column id of @sortable
is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
A #GtkTreeSortable
The comparison function
User data to pass to @sort_func, or %NULL
Destroy notifier of @user_data, or %NULL
Sets the current sort column to be @sort_column_id. The @sortable will
resort itself to reflect this change, after emitting a
#GtkTreeSortable::sort-column-changed signal. @sort_column_id may either be
a regular column id, or one of the following special values:
<variablelist>
<varlistentry>
<term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
<listitem>the default sort function will be used, if it is set</listitem>
</varlistentry>
<varlistentry>
<term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
<listitem>no sorting will occur</listitem>
</varlistentry>
</variablelist>
A #GtkTreeSortable
the sort column id to set
The sort order of the column
Sets the comparison function used when sorting to be @sort_func. If the
current sort column id of @sortable is the same as @sort_column_id, then
the model will sort using this function.
A #GtkTreeSortable
the sort column id to set the function for
The comparison function
User data to pass to @sort_func, or %NULL
Destroy notifier of @user_data, or %NULL
Emits a #GtkTreeSortable::sort-column-changed signal on @sortable.
A #GtkTreeSortable
The ::sort-column-changed signal is emitted when the sort column
or sort order of @sortable is changed. The signal is emitted before
the contents of @sortable are resorted.
A #GtkTreeSortable
%TRUE if the sort column is not one of the special sort
column ids.
A #GtkTreeSortable
The sort column id to be filled in
The #GtkSortType to be filled in
A #GtkTreeSortable
the sort column id to set
The sort order of the column
A #GtkTreeSortable
the sort column id to set the function for
Destroy notifier of @user_data, or %NULL
A #GtkTreeSortable
Destroy notifier of @user_data, or %NULL
%TRUE, if the model has a default sort function
A #GtkTreeSortable
Creates a new tree store as with @n_columns columns each of the types passed
in. Note that only types derived from standard GObject fundamental types
are supported.
As an example, <literal>gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING,
GDK_TYPE_PIXBUF);</literal> will create a new #GtkTreeStore with three columns, of type
<type>int</type>, <type>string</type> and #GdkPixbuf respectively.
a new #GtkTreeStore
number of columns in the tree store
all #GType types for the columns, from first to last
Non vararg creation function. Used primarily by language bindings.
a new #GtkTreeStore
number of columns in the tree store
an array of #GType types for the columns, from first to last
Appends a new row to @tree_store. If @parent is non-%NULL, then it will append the
new row after the last child of @parent, otherwise it will append a row to
the top level. @iter will be changed to point to this new row. The row will
be empty after this function is called. To fill in values, you need to call
gtk_tree_store_set() or gtk_tree_store_set_value().
A #GtkTreeStore
An unset #GtkTreeIter to set to the appended row
A valid #GtkTreeIter, or %NULL
Removes all rows from @tree_store
a #GtkTreeStore
Creates a new row at @position. If parent is non-%NULL, then the row will be
made a child of @parent. Otherwise, the row will be created at the toplevel.
If @position is larger than the number of rows at that level, then the new
row will be inserted to the end of the list. @iter will be changed to point
to this new row. The row will be empty after this function is called. To
fill in values, you need to call gtk_tree_store_set() or
gtk_tree_store_set_value().
A #GtkTreeStore
An unset #GtkTreeIter to set to the new row
A valid #GtkTreeIter, or %NULL
position to insert the new row
Inserts a new row after @sibling. If @sibling is %NULL, then the row will be
prepended to @parent 's children. If @parent and @sibling are %NULL, then
the row will be prepended to the toplevel. If both @sibling and @parent are
set, then @parent must be the parent of @sibling. When @sibling is set,
@parent is optional.
@iter will be changed to point to this new row. The row will be empty after
this function is called. To fill in values, you need to call
gtk_tree_store_set() or gtk_tree_store_set_value().
A #GtkTreeStore
An unset #GtkTreeIter to set to the new row
A valid #GtkTreeIter, or %NULL
A valid #GtkTreeIter, or %NULL
Inserts a new row before @sibling. If @sibling is %NULL, then the row will
be appended to @parent 's children. If @parent and @sibling are %NULL, then
the row will be appended to the toplevel. If both @sibling and @parent are
set, then @parent must be the parent of @sibling. When @sibling is set,
@parent is optional.
@iter will be changed to point to this new row. The row will be empty after
this function is called. To fill in values, you need to call
gtk_tree_store_set() or gtk_tree_store_set_value().
A #GtkTreeStore
An unset #GtkTreeIter to set to the new row
A valid #GtkTreeIter, or %NULL
A valid #GtkTreeIter, or %NULL
Creates a new row at @position. @iter will be changed to point to this
new row. If @position is larger than the number of rows on the list, then
the new row will be appended to the list. The row will be filled with
the values given to this function.
Calling
<literal>gtk_tree_store_insert_with_values (tree_store, iter, position, ...)</literal>
has the same effect as calling
|[
gtk_tree_store_insert (tree_store, iter, position);
gtk_tree_store_set (tree_store, iter, ...);
]|
with the different that the former will only emit a row_inserted signal,
while the latter will emit row_inserted, row_changed and if the tree store
is sorted, rows_reordered. Since emitting the rows_reordered signal
repeatedly can affect the performance of the program,
gtk_tree_store_insert_with_values() should generally be preferred when
inserting rows in a sorted tree store.
A #GtkTreeStore
An unset #GtkTreeIter to set the new row, or %NULL.
A valid #GtkTreeIter, or %NULL
position to insert the new row
pairs of column number and value, terminated with -1
A variant of gtk_tree_store_insert_with_values() which takes
the columns and values as two arrays, instead of varargs. This
function is mainly intended for language bindings.
A #GtkTreeStore
An unset #GtkTreeIter to set the new row, or %NULL.
A valid #GtkTreeIter, or %NULL
position to insert the new row
an array of column numbers
an array of GValues
the length of the @columns and @values arrays
Returns %TRUE if @iter is an ancestor of @descendant. That is, @iter is the
parent (or grandparent or great-grandparent) of @descendant.
%TRUE, if @iter is an ancestor of @descendant
A #GtkTreeStore
A valid #GtkTreeIter
A valid #GtkTreeIter
Returns the depth of @iter. This will be 0 for anything on the root level, 1
for anything down a level, etc.
The depth of @iter
A #GtkTreeStore
A valid #GtkTreeIter
WARNING: This function is slow. Only use it for debugging and/or testing
purposes.
Checks if the given iter is a valid iter for this #GtkTreeStore.
%TRUE if the iter is valid, %FALSE if the iter is invalid.
A #GtkTreeStore.
A #GtkTreeIter.
Moves @iter in @tree_store to the position after @position. @iter and
@position should be in the same level. Note that this function only
works with unsorted stores. If @position is %NULL, @iter will be moved
to the start of the level.
A #GtkTreeStore.
A #GtkTreeIter.
A #GtkTreeIter.
Moves @iter in @tree_store to the position before @position. @iter and
@position should be in the same level. Note that this function only
works with unsorted stores. If @position is %NULL, @iter will be
moved to the end of the level.
A #GtkTreeStore.
A #GtkTreeIter.
A #GtkTreeIter or %NULL.
Prepends a new row to @tree_store. If @parent is non-%NULL, then it will prepend
the new row before the first child of @parent, otherwise it will prepend a row
to the top level. @iter will be changed to point to this new row. The row
will be empty after this function is called. To fill in values, you need to
call gtk_tree_store_set() or gtk_tree_store_set_value().
A #GtkTreeStore
An unset #GtkTreeIter to set to the prepended row
A valid #GtkTreeIter, or %NULL
Removes @iter from @tree_store. After being removed, @iter is set to the
next valid row at that level, or invalidated if it previously pointed to the
last one.
%TRUE if @iter is still valid, %FALSE if not.
A #GtkTreeStore
A valid #GtkTreeIter
Reorders the children of @parent in @tree_store to follow the order
indicated by @new_order. Note that this function only works with
unsorted stores.
A #GtkTreeStore.
A #GtkTreeIter.
an array of integers mapping the new position of each child
to its old position before the re-ordering,
i.e. @new_order<literal>[newpos] = oldpos</literal>.
Sets the value of one or more cells in the row referenced by @iter.
The variable argument list should contain integer column numbers,
each column number followed by the value to be set.
The list is terminated by a -1. For example, to set column 0 with type
%G_TYPE_STRING to "Foo", you would write
<literal>gtk_tree_store_set (store, iter, 0, "Foo", -1)</literal>.
The value will be referenced by the store if it is a %G_TYPE_OBJECT, and it
will be copied if it is a %G_TYPE_STRING or %G_TYPE_BOXED.
A #GtkTreeStore
A valid #GtkTreeIter for the row being modified
pairs of column number and value, terminated with -1
This function is meant primarily for #GObjects that inherit from
#GtkTreeStore, and should only be used when constructing a new
#GtkTreeStore. It will not function after a row has been added,
or a method on the #GtkTreeModel interface is called.
A #GtkTreeStore
Number of columns for the tree store
An array of #GType types, one for each column
See gtk_tree_store_set(); this version takes a <type>va_list</type> for
use by language bindings.
A #GtkTreeStore
A valid #GtkTreeIter for the row being modified
<type>va_list</type> of column/value pairs
Sets the data in the cell specified by @iter and @column.
The type of @value must be convertible to the type of the
column.
a #GtkTreeStore
A valid #GtkTreeIter for the row being modified
column number to modify
new value for the cell
A variant of gtk_tree_store_set_valist() which takes
the columns and values as two arrays, instead of varargs. This
function is mainly intended for language bindings or in case
the number of columns to change is not known until run-time.
A #GtkTreeStore
A valid #GtkTreeIter for the row being modified
an array of column numbers
an array of GValues
the length of the @columns and @values arrays
Swaps @a and @b in the same level of @tree_store. Note that this function
only works with unsorted stores.
A #GtkTreeStore.
A #GtkTreeIter.
Another #GtkTreeIter.
Creates a new #GtkTreeView widget.
A newly created #GtkTreeView widget.
Creates a new #GtkTreeView widget with the model initialized to @model.
A newly created #GtkTreeView widget.
the model.
Activates the cell determined by @path and @column.
A #GtkTreeView
The #GtkTreePath to be activated.
The #GtkTreeViewColumn to be activated.
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 number of columns in @tree_view after appending.
A #GtkTreeView.
The #GtkTreeViewColumn to add.
Recursively collapses all visible, expanded nodes in @tree_view.
A #GtkTreeView.
Collapses a row (hides its child rows, if they exist).
%TRUE if the row was collapsed.
a #GtkTreeView
path to a row in the @tree_view
Resizes all columns to their optimal width. Only works after the
treeview has been realized.
A #GtkTreeView.
Converts bin_window coordinates to coordinates for the
tree (the full scrollable area of the tree).
a #GtkTreeView
X coordinate relative to bin_window
Y coordinate relative to bin_window
return location for tree X coordinate
return location for tree Y coordinate
Converts bin_window coordinates (see gtk_tree_view_get_bin_window())
to widget relative coordinates.
a #GtkTreeView
bin_window X coordinate
bin_window Y coordinate
return location for widget X coordinate
return location for widget Y coordinate
Converts tree coordinates (coordinates in full scrollable area of the tree)
to bin_window coordinates.
a #GtkTreeView
tree X coordinate
tree Y coordinate
return location for X coordinate relative to bin_window
return location for Y coordinate relative to bin_window
Converts tree coordinates (coordinates in full scrollable area of the tree)
to widget coordinates.
a #GtkTreeView
X coordinate relative to the tree
Y coordinate relative to the tree
return location for widget X coordinate
return location for widget Y coordinate
Converts widget coordinates to coordinates for the bin_window
(see gtk_tree_view_get_bin_window()).
a #GtkTreeView
X coordinate relative to the widget
Y coordinate relative to the widget
return location for bin_window X coordinate
return location for bin_window Y coordinate
Converts widget coordinates to coordinates for the
tree (the full scrollable area of the tree).
a #GtkTreeView
X coordinate relative to the widget
Y coordinate relative to the widget
return location for tree X coordinate
return location for tree Y coordinate
Creates a #GdkPixmap representation of the row at @path.
This image is used for a drag icon.
a newly-allocated pixmap of the drag icon.
a #GtkTreeView
a #GtkTreePath in @tree_view
Turns @tree_view into a drop destination for automatic DND. Calling
this method sets #GtkTreeView:reorderable to %FALSE.
a #GtkTreeView
the table of targets that the drag will support
the number of items in @targets
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.
a #GtkTreeView
Mask of allowed buttons to start drag
the table of targets that the drag will support
the number of items in @targets
the bitmask of possible actions for a drag from this
widget
Recursively expands all nodes in the @tree_view.
A #GtkTreeView.
Opens the row so its children are visible.
%TRUE if the row existed and had children
a #GtkTreeView
path to a row
whether to recursively expand, or just expand immediate children
Expands the row at @path. This will also expand all parent rows of
@path as necessary.
A #GtkTreeView.
path to a row.
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 #GtkTreeView
a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordiantes
rectangle to fill with cell background rect
Returns the window that @tree_view renders to.
This is used primarily to compare to <literal>event->window</literal>
to confirm that the event on @tree_view is on the right window.
A #GdkWindow, or %NULL when @tree_view
hasn't been realized yet
A #GtkTreeView
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 #GtkTreeView
a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordinates
rectangle to fill with cell rect
Gets the #GtkTreeViewColumn at the given position in the #tree_view.
The #GtkTreeViewColumn, or %NULL if the
position is outside the range of columns.
A #GtkTreeView.
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 ().
A list of #GtkTreeViewColumn s
A #GtkTreeView
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.
A #GtkTreeView
A pointer to be filled with the current cursor path, or %NULL
A pointer to be filled with the current focus column, or %NULL
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.
whether there is a row at the given position, %TRUE if this
is indeed the case.
a #GtkTreeView
the position to determine the destination row for
the position to determine the destination row for
Return location for the path of the highlighted row, or %NULL.
Return location for the drop position, or %NULL
Gets information about the row that is highlighted for feedback.
a #GtkTreeView
Return location for the path of the highlighted row, or %NULL.
Return location for the drop position, or %NULL
Returns whether or not the tree allows to start interactive searching
by typing in text.
whether or not to let the user search interactively
A #GtkTreeView
Returns whether or not tree lines are drawn in @tree_view.
%TRUE if tree lines are drawn in @tree_view, %FALSE
otherwise.
a #GtkTreeView.
Returns the column that is the current expander column.
This column has the expander arrow drawn next to it.
The expander column.
A #GtkTreeView
Returns whether fixed height mode is turned on for @tree_view.
%TRUE if @tree_view is in fixed height mode
a #GtkTreeView
Returns which grid lines are enabled in @tree_view.
a #GtkTreeViewGridLines value indicating which grid lines
are enabled.
a #GtkTreeView
Gets the #GtkAdjustment currently being used for the horizontal aspect.
A #GtkAdjustment object, or %NULL
if none is currently being used.
A #GtkTreeView
Returns whether all header columns are clickable.
%TRUE if all header columns are clickable, otherwise %FALSE
A #GtkTreeView.
Returns %TRUE if the headers on the @tree_view are visible.
Whether the headers are visible or not.
A #GtkTreeView.
Returns whether hover expansion mode is turned on for @tree_view.
%TRUE if @tree_view is in hover expansion mode
a #GtkTreeView
Returns whether hover selection mode is turned on for @tree_view.
%TRUE if @tree_view is in hover selection mode
a #GtkTreeView
Returns the amount, in pixels, of extra indentation for child levels
in @tree_view.
the amount of extra indentation for child levels in
@tree_view. A return value of 0 means that this feature is disabled.
a #GtkTreeView.
Returns the model the #GtkTreeView is based on. Returns %NULL if the
model is unset.
A #GtkTreeModel, or %NULL if none is currently being used.
a #GtkTreeView
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 <literal>event->window ==
gtk_tree_view_get_bin_window (<!-- -->)</literal>. It is primarily for
things like popup menus. If @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().
%TRUE if a row exists at that coordinate.
A #GtkTreeView.
The x position to be identified (relative to bin_window).
The y position to be identified (relative to bin_window).
A pointer to a #GtkTreePath pointer to be filled in, or %NULL
A pointer to a #GtkTreeViewColumn pointer to be filled in, or %NULL
A pointer where the X coordinate relative to the cell can be placed, or %NULL
A pointer where the Y coordinate relative to the cell can be placed, or %NULL
Retrieves whether the user can reorder the tree via drag-and-drop. See
gtk_tree_view_set_reorderable().
%TRUE if the tree can be reordered.
a #GtkTreeView
Returns the current row separator function.
the current row separator function.
a #GtkTreeView
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.
%TRUE if rubber banding in @tree_view is enabled.
a #GtkTreeView
Gets the setting set by gtk_tree_view_set_rules_hint().
%TRUE if rules are useful for the user of this tree
a #GtkTreeView
Gets the column searched on by the interactive search code.
the column the interactive search code searches in.
A #GtkTreeView
Returns the #GtkEntry which is currently in use as interactive search
entry for @tree_view. In case the built-in entry is being used, %NULL
will be returned.
the entry currently in use as search entry.
A #GtkTreeView
Returns the compare function currently in use.
the currently used compare function for the search code.
A #GtkTreeView
Returns the positioning function currently in use.
the currently used function for positioning the search dialog.
A #GtkTreeView
Gets the #GtkTreeSelection associated with @tree_view.
A #GtkTreeSelection object.
A #GtkTreeView.
Returns whether or not expanders are drawn in @tree_view.
%TRUE if expanders are drawn in @tree_view, %FALSE
otherwise.
a #GtkTreeView.
Returns the column of @tree_view's model which is being used for
displaying tooltips on @tree_view's rows.
the index of the tooltip column that is currently being
used, or -1 if this is disabled.
a #GtkTreeView
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.
whether or not the given tooltip context points to a row.
a #GtkTreeView
the x coordinate (relative to widget coordinates)
the y coordinate (relative to widget coordinates)
whether this is a keyboard tooltip or not
a pointer to receive a #GtkTreeModel or %NULL
a pointer to receive a #GtkTreePath or %NULL
a pointer to receive a #GtkTreeIter or %NULL
Gets the #GtkAdjustment currently being used for the vertical aspect.
A #GtkAdjustment object, or %NULL
if none is currently being used.
A #GtkTreeView
Sets @start_path and @end_path to be the first and last visible path.
Note that there may be invisible paths in between.
The paths should be freed with gtk_tree_path_free() after use.
%TRUE, if valid paths were placed in @start_path and @end_path.
A #GtkTreeView
Return location for start of region,
or %NULL.
Return location for end of region, or %NULL.
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.
a #GtkTreeView
rectangle to fill
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 number of columns in @tree_view after insertion.
A #GtkTreeView.
The #GtkTreeViewColumn to be inserted.
The position to insert @column in.
Creates a new #GtkTreeViewColumn and inserts it into the @tree_view at
@position. If @position is -1, then the newly created column is inserted at
the end. The column is initialized with the attributes given. 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.
The number of columns in @tree_view after insertion.
A #GtkTreeView
The position to insert the new column in.
The title to set the header to.
The #GtkCellRenderer.
A %NULL-terminated list of attributes.
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.
number of columns in the tree view post-insert
a #GtkTreeView
Position to insert, -1 for append
column title
cell renderer for column
function to set attributes of cell renderer
data for @func
destroy notifier for @data
Returns whether a rubber banding operation is currently being done
in @tree_view.
%TRUE if a rubber banding operation is currently being
done in @tree_view.
a #GtkTreeView
Calls @func on all expanded rows.
A #GtkTreeView
A function to be called
User data to be passed to the function.
Moves @column to be after to @base_column. If @base_column is %NULL, then
@column is placed in the first position.
A #GtkTreeView
The #GtkTreeViewColumn to be moved.
The #GtkTreeViewColumn to be moved relative to, or %NULL.
Removes @column from @tree_view.
The number of columns in @tree_view after removing.
A #GtkTreeView.
The #GtkTreeViewColumn to remove.
Activates the cell determined by @path and @column.
A #GtkTreeView
The #GtkTreePath to be activated.
The #GtkTreeViewColumn to be activated.
Returns %TRUE if the node pointed to by @path is expanded in @tree_view.
%TRUE if #path is expanded.
A #GtkTreeView.
A #GtkTreePath to test expansion state.
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.
A #GtkTreeView.
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.
a #GtkTreeView
X coordinate of new top-left pixel of visible area, or -1
Y coordinate of new top-left pixel of visible area, or -1
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 #GtkTreeView.
A function to determine which columns are reorderable, or %NULL.
User data to be passed to @func, or %NULL
Destroy notifier for @user_data, or %NULL
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 #GtkTreeView
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 #GtkTreeView
A #GtkTreePath
A #GtkTreeViewColumn, or %NULL
A #GtkCellRenderer, or %NULL
%TRUE if the specified cell should start being edited.
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.
A #GtkTreeView
Function to be called when a view row is destroyed, or %NULL
User data to be passed to @func, or %NULL
Destroy notifier for @data, or %NULL
Sets the row that is highlighted for feedback.
a #GtkTreeView
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.
A #GtkTreeView
%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.
a #GtkTreeView
%TRUE to enable tree line drawing, %FALSE otherwise.
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.
A #GtkTreeView
%NULL, or the column to draw the expander arrow at.
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.
a #GtkTreeView
%TRUE to enable fixed height mode
Sets which grid lines to draw in @tree_view.
a #GtkTreeView
a #GtkTreeViewGridLines value indicating which grid lines to
enable.
Sets the #GtkAdjustment for the current horizontal aspect.
A #GtkTreeView
The #GtkAdjustment to set, or %NULL
Allow the column title buttons to be clicked.
A #GtkTreeView.
%TRUE if the columns are clickable.
Sets the visibility state of the headers.
A #GtkTreeView.
%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.
a #GtkTreeView
%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.
a #GtkTreeView
%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.
a #GtkTreeView
the amount, in pixels, of extra indentation in @tree_view.
Sets the model for a #GtkTreeView. If the @tree_view already has a model
set, it will remove it before setting the new model. If @model is %NULL,
then it will unset the old model.
A #GtkTreeNode.
The model.
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.
A #GtkTreeView.
%TRUE, if the tree can be reordered.
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 #GtkTreeView
a #GtkTreeViewRowSeparatorFunc
user data to pass to @func, or %NULL
destroy notifier for @data, or %NULL
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.
a #GtkTreeView
%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 <emphasis>not</emphasis> use it
just because you prefer the appearance of the ruled tree; that's a
question for the theme. Some themes will draw tree rows in
alternating colors even when rules are turned off, and users who
prefer that appearance all the time can choose those themes. You
should call this function only as a <emphasis>semantic</emphasis>
hint to the theme engine that your tree makes alternating colors
useful from a functional standpoint (since it has lots of columns,
generally).
a #GtkTreeView
%TRUE if the tree requires reading across rows
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.
A #GtkTreeView
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.
A #GtkTreeView
the entry the interactive search code of @tree_view should use or %NULL
Sets the compare function for the interactive search capabilities; note
that somewhat like strcmp() returning 0 for equality
#GtkTreeViewSearchEqualFunc returns %FALSE on matches.
A #GtkTreeView
the compare function to use during the search
user data to pass to @search_equal_func, or %NULL
Destroy notifier for @search_user_data, or %NULL
Sets the function to use when positioning the search dialog.
A #GtkTreeView
the function to use to position the search dialog, or %NULL
to use the default search position function
user data to pass to @func, or %NULL
Destroy notifier for @data, or %NULL
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.
a #GtkTreeView
%TRUE to enable expander drawing, %FALSE otherwise.
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 #GtkTreeView
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.
a #GtkTreeView
an integer, which is a valid column number for @tree_view's model
Sets the tip area of @tooltip to be the area covered by the row at @path.
See also gtk_tree_view_set_tooltip_column() for a simpler alternative.
See also gtk_tooltip_set_tip_area().
a #GtkTreeView
a #GtkTooltip
a #GtkTreePath
Sets the #GtkAdjustment for the current vertical aspect.
A #GtkTreeView
The #GtkAdjustment to set, or %NULL
Converts tree coordinates (coordinates in full scrollable area of the tree)
to bin_window coordinates.
Due to historial reasons the name of this function is
incorrect. For converting bin_window coordinates to coordinates relative
to bin_window, please see
gtk_tree_view_convert_bin_window_to_widget_coords().
a #GtkTreeView
tree X coordinate
tree Y coordinate
return location for X coordinate relative to bin_window
return location for Y coordinate relative to bin_window
Undoes the effect of
gtk_tree_view_enable_model_drag_dest(). Calling this method sets
#GtkTreeView:reorderable to %FALSE.
a #GtkTreeView
Undoes the effect of
gtk_tree_view_enable_model_drag_source(). Calling this method sets
#GtkTreeView:reorderable to %FALSE.
a #GtkTreeView
Converts bin_window coordinates to coordinates for the
tree (the full scrollable area of the tree).
Due to historial reasons the name of this function is
incorrect. For converting coordinates relative to the widget to
bin_window coordinates, please see
gtk_tree_view_convert_widget_to_bin_window_coords().
a #GtkTreeView
X coordinate relative to bin_window
Y coordinate relative to bin_window
return location for tree X coordinate
return location for tree Y coordinate
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 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.
The number of columns of the treeview has changed.
The position of the cursor (focused cell) has changed.
The "row-activated" signal is emitted when the method
gtk_tree_view_row_activated() is called or the user double clicks
a treeview row. It is also emitted when a non-editable row is
selected and one of the keys: Space, Shift+Space, Return or
Enter is pressed.
For selection handling refer to the <link linkend="TreeWidget">tree
widget conceptual overview</link> as well as #GtkTreeSelection.
the #GtkTreePath for the activated row
the #GtkTreeViewColumn in which the activation occurred
The given row has been collapsed (child nodes are hidden).
the tree iter of the collapsed row
a tree path that points to the row
The given row has been expanded (child nodes are shown).
the tree iter of the expanded row
a tree path that points to the row
Set the scroll adjustments for the tree view. Usually scrolled containers
like #GtkScrolledWindow will emit this signal to connect two instances
of #GtkScrollbar to the scroll directions of the #GtkTreeView.
The given row is about to be collapsed (hide its children nodes). Use this
signal if you need to control the collapsibility of individual rows.
%FALSE to allow collapsing, %TRUE to reject
the tree iter of the row to collapse
a tree path that points to the row
The given row is about to be expanded (show its children nodes). Use this
signal if you need to control the expandability of individual rows.
%FALSE to allow expansion, %TRUE to reject
the tree iter of the row to expand
a tree path that points to the row
A #GtkTreeView
The #GtkTreePath to be activated.
The #GtkTreeViewColumn to be activated.
Creates a new #GtkTreeViewColumn.
A newly created #GtkTreeViewColumn.
Creates a new #GtkTreeViewColumn with a number of default values. This is
equivalent to calling gtk_tree_view_column_set_title(),
gtk_tree_view_column_pack_start(), and
gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
Here's a simple example:
|[
enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
...
{
GtkTreeViewColumn *column;
GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Title",
renderer,
"text", TEXT_COLUMN,
"foreground", COLOR_COLUMN,
NULL);
}
]|
A newly created #GtkTreeViewColumn.
The title to set the header to.
The #GtkCellRenderer.
A %NULL-terminated list of attributes.
Emits the "clicked" signal on the column. This function will only work if
@tree_column is clickable.
a #GtkTreeViewColumn
Adds an attribute mapping to the list in @tree_column. The @column is the
column of the model to get a value from, and the @attribute is the
parameter on @cell_renderer to be set from the value. So for example
if column 2 of the model contains strings, you could have the
"text" attribute of a #GtkCellRendererText get its values from
column 2.
A #GtkTreeViewColumn.
the #GtkCellRenderer to set attributes on
An attribute on the renderer
The column position on the model to get the attribute from.
Obtains the horizontal position and size of a cell in a column. If the
cell is not found in the column, @start_pos and @width are not changed and
%FALSE is returned.
%TRUE if @cell belongs to @tree_column.
a #GtkTreeViewColumn
a #GtkCellRenderer
return location for the horizontal position of @cell within
@tree_column, may be %NULL
return location for the width of @cell, may be %NULL
Obtains the width and height needed to render the column. This is used
primarily by the #GtkTreeView.
A #GtkTreeViewColumn.
The area a cell in the column will be allocated, or %NULL
location to return x offset of a cell relative to @cell_area, or %NULL
location to return y offset of a cell relative to @cell_area, or %NULL
location to return width needed to render a cell, or %NULL
location to return height needed to render a cell, or %NULL
Returns %TRUE if any of the cells packed into the @tree_column are visible.
For this to be meaningful, you must first initialize the cells with
gtk_tree_view_column_cell_set_cell_data()
%TRUE, if any of the cells packed into the @tree_column are currently visible
A #GtkTreeViewColumn
Sets the cell renderer based on the @tree_model and @iter. That is, for
every attribute mapping in @tree_column, it will get a value from the set
column on the @iter, and use that value to set the attribute on the cell
renderer. This is used primarily by the #GtkTreeView.
A #GtkTreeViewColumn.
The #GtkTreeModel to to get the cell renderers attributes from.
The #GtkTreeIter to to get the cell renderer's attributes from.
%TRUE, if the row has children
%TRUE, if the row has visible children
Unsets all the mappings on all renderers on the @tree_column.
A #GtkTreeViewColumn
Clears all existing attributes previously set with
gtk_tree_view_column_set_attributes().
a #GtkTreeViewColumn
a #GtkCellRenderer to clear the attribute mapping on.
Emits the "clicked" signal on the column. This function will only work if
@tree_column is clickable.
a #GtkTreeViewColumn
Sets the current keyboard focus to be at @cell, if the column contains
2 or more editable and activatable cells.
A #GtkTreeViewColumn
A #GtkCellRenderer
Returns the current x alignment of @tree_column. This value can range
between 0.0 and 1.0.
The current alignent of @tree_column.
A #GtkTreeViewColumn.
Returns a newly-allocated #GList of all the cell renderers in the column,
in no particular order. The list must be freed with g_list_free().
use gtk_cell_layout_get_cells() instead.
A list of #GtkCellRenderers
A #GtkTreeViewColumn
Returns %TRUE if the user can click on the header for the column.
%TRUE if user can click the column header.
a #GtkTreeViewColumn
Return %TRUE if the column expands to take any available space.
%TRUE, if the column expands
a #GtkTreeViewColumn
Gets the fixed width of the column. This value is only meaning may not be
the actual width of the column on the screen, just what is requested.
the fixed width of the column
a #GtkTreeViewColumn
Returns the maximum width in pixels of the @tree_column, or -1 if no maximum
width is set.
The maximum width of the @tree_column.
A #GtkTreeViewColumn.
Returns the minimum width in pixels of the @tree_column, or -1 if no minimum
width is set.
The minimum width of the @tree_column.
A #GtkTreeViewColumn.
Returns %TRUE if the @tree_column can be reordered by the user.
%TRUE if the @tree_column can be reordered by the user.
A #GtkTreeViewColumn
Returns %TRUE if the @tree_column can be resized by the end user.
%TRUE, if the @tree_column can be resized.
A #GtkTreeViewColumn
Returns the current type of @tree_column.
The type of @tree_column.
A #GtkTreeViewColumn.
Gets the logical @sort_column_id that the model sorts on when this
column is selected for sorting.
See gtk_tree_view_column_set_sort_column_id().
the current @sort_column_id for this column, or -1 if
this column can't be used for sorting.
a #GtkTreeViewColumn
Gets the value set by gtk_tree_view_column_set_sort_indicator().
whether the sort indicator arrow is displayed
a #GtkTreeViewColumn
Gets the value set by gtk_tree_view_column_set_sort_order().
the sort order the sort indicator is indicating
a #GtkTreeViewColumn
Returns the spacing of @tree_column.
the spacing of @tree_column.
A #GtkTreeViewColumn.
Returns the title of the widget.
the title of the column. This string should not be
modified or freed.
A #GtkTreeViewColumn.
Returns the #GtkTreeView wherein @tree_column has been inserted.
If @column is currently not inserted in any tree view, %NULL is
returned.
The tree view wherein @column has
been inserted if any, %NULL otherwise.
A #GtkTreeViewColumn
Returns %TRUE if @tree_column is visible.
whether the column is visible or not. If it is visible, then
the tree will show the column.
A #GtkTreeViewColumn.
Returns the #GtkWidget in the button on the column header.
If a custom widget has not been set then %NULL is returned.
The #GtkWidget in the column
header, or %NULL
A #GtkTreeViewColumn.
Returns the current size of @tree_column in pixels.
The current width of @tree_column.
A #GtkTreeViewColumn.
Adds the @cell to end of the column. If @expand is %FALSE, then the @cell
is allocated no more space than it needs. Any unused space is divided
evenly between cells for which @expand is %TRUE.
A #GtkTreeViewColumn.
The #GtkCellRenderer.
%TRUE if @cell is to be given extra space allocated to @tree_column.
Packs the @cell into the beginning of the column. If @expand is %FALSE, then
the @cell is allocated no more space than it needs. Any unused space is divided
evenly between cells for which @expand is %TRUE.
A #GtkTreeViewColumn.
The #GtkCellRenderer.
%TRUE if @cell is to be given extra space allocated to @tree_column.
Flags the column, and the cell renderers added to this column, to have
their sizes renegotiated.
A #GtkTreeViewColumn
Sets the alignment of the title or custom widget inside the column header.
The alignment determines its location inside the button -- 0.0 for left, 0.5
for center, 1.0 for right.
A #GtkTreeViewColumn.
The alignment, which is between [0.0 and 1.0] inclusive.
Sets the attributes in the list as the attributes of @tree_column.
The attributes should be in attribute/column order, as in
gtk_tree_view_column_add_attribute(). All existing attributes
are removed, and replaced with the new attributes.
A #GtkTreeViewColumn.
the #GtkCellRenderer we're setting the attributes of
A %NULL-terminated list of attributes.
Sets the #GtkTreeViewColumnFunc to use for the column. This
function is used instead of the standard attributes mapping for
setting the column value, and should set the value of @tree_column's
cell renderer as appropriate. @func may be %NULL to remove an
older one.
A #GtkTreeViewColumn
A #GtkCellRenderer
The #GtkTreeViewColumnFunc to use.
The user data for @func.
The destroy notification for @func_data
Sets the header to be active if @active is %TRUE. When the header is active,
then it can take keyboard focus, and can be clicked.
A #GtkTreeViewColumn.
%TRUE if the header is active.
Sets the column to take available extra space. This space is shared equally
amongst all columns that have the expand set to %TRUE. If no column has this
option set, then the last column gets all extra space. By default, every
column is created with this %FALSE.
A #GtkTreeViewColumn
%TRUE if the column should take available extra space, %FALSE if not
Sets the size of the column in pixels. This is meaningful only if the sizing
type is #GTK_TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to
the min/max width for the column. Please note that the min/max width of the
column doesn't actually affect the "fixed_width" property of the widget, just
the actual size when displayed.
A #GtkTreeViewColumn.
The size to set @tree_column to. Must be greater than 0.
Sets the maximum width of the @tree_column. If @max_width is -1, then the
maximum width is unset. Note, the column can actually be wider than max
width if it's the last column in a view. In this case, the column expands to
fill any extra space.
A #GtkTreeViewColumn.
The maximum width of the column in pixels, or -1.
Sets the minimum width of the @tree_column. If @min_width is -1, then the
minimum width is unset.
A #GtkTreeViewColumn.
The minimum width of the column in pixels, or -1.
If @reorderable is %TRUE, then the column can be reordered by the end user
dragging the header.
A #GtkTreeViewColumn
%TRUE, if the column can be reordered.
If @resizable is %TRUE, then the user can explicitly resize the column by
grabbing the outer edge of the column button. If resizable is %TRUE and
sizing mode of the column is #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.
A #GtkTreeViewColumn
%TRUE, if the column can be resized
Sets the growth behavior of @tree_column to @type.
A #GtkTreeViewColumn.
The #GtkTreeViewColumnSizing.
Sets the logical @sort_column_id that this column sorts on when this column
is selected for sorting. Doing so makes the column header clickable.
a #GtkTreeViewColumn
The @sort_column_id of the model to sort on.
Call this function with a @setting of %TRUE to display an arrow in
the header button indicating the column is sorted. Call
gtk_tree_view_column_set_sort_order() to change the direction of
the arrow.
a #GtkTreeViewColumn
%TRUE to display an indicator that the column is sorted
Changes the appearance of the sort indicator.
This <emphasis>does not</emphasis> actually sort the model. Use
gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
support. This function is primarily for custom sorting behavior, and should
be used in conjunction with gtk_tree_sortable_set_sort_column() to do
that. For custom models, the mechanism will vary.
The sort indicator changes direction to indicate normal sort or reverse sort.
Note that you must have the sort indicator enabled to see anything when
calling this function; see gtk_tree_view_column_set_sort_indicator().
a #GtkTreeViewColumn
sort order that the sort indicator should indicate
Sets the spacing field of @tree_column, which is the number of pixels to
place between cell renderers packed into it.
A #GtkTreeViewColumn.
distance between cell renderers in pixels.
Sets the title of the @tree_column. If a custom widget has been set, then
this value is ignored.
A #GtkTreeViewColumn.
The title of the @tree_column.
Sets the visibility of @tree_column.
A #GtkTreeViewColumn.
%TRUE if the @tree_column is visible.
Sets the widget in the header to be @widget. If widget is %NULL, then the
header button is set with a #GtkLabel set to the title of @tree_column.
A #GtkTreeViewColumn.
A child #GtkWidget, or %NULL.
Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
clickable. Set to %-1 to make the column unsortable.
a #GtkTreeViewColumn
Creates a new ui manager object.
a new ui manager object.
Looks up an action by following a path. See gtk_ui_manager_get_widget()
for more information about paths.
the action whose proxy widget is found by following the path,
or %NULL if no widget was found.
a path
Looks up a widget by following a path.
The path consists of the names specified in the XML description of the UI.
separated by '/'. Elements which don't have a name or action attribute in
the XML (e.g. <popup>) can be addressed by their XML element name
(e.g. "popup"). The root element ("/ui") can be omitted in the path.
Note that the widget found by following a path that ends in a <menu>
element is the menuitem to which the menu is attached, not the menu itself.
Also note that the widgets constructed by a ui manager are not tied to
the lifecycle of the ui manager. If you add the widgets returned by this
function to some container or explicitly ref them, they will survive the
destruction of the ui manager.
the widget found by following the path, or %NULL if no widget
was found.
a path
Adds a UI element to the current contents of @self.
If @type is %GTK_UI_MANAGER_AUTO, GTK+ inserts a menuitem, toolitem or
separator if such an element can be inserted at the place determined by
@path. Otherwise @type must indicate an element that can be inserted at
the place determined by @path.
If @path points to a menuitem or toolitem, the new element will be inserted
before or after this item, depending on @top.
a #GtkUIManager
the merge id for the merged UI, see gtk_ui_manager_new_merge_id()
a path
the name for the added UI element
the name of the action to be proxied, or %NULL to add a separator
the type of UI element to add.
if %TRUE, the UI element is added before its siblings, otherwise it
is added after its siblings.
Parses a file containing a <link linkend="XML-UI">UI definition</link> and
merges it with the current contents of @self.
The merge id for the merged UI. The merge id can be used
to unmerge the UI with gtk_ui_manager_remove_ui(). If an error occurred,
the return value is 0.
a #GtkUIManager object
the name of the file to parse
Parses a string containing a <link linkend="XML-UI">UI definition</link> and
merges it with the current contents of @self. An enclosing <ui>
element is added if it is missing.
The merge id for the merged UI. The merge id can be used
to unmerge the UI with gtk_ui_manager_remove_ui(). If an error occurred,
the return value is 0.
a #GtkUIManager object
the string to parse
the length of @buffer (may be -1 if @buffer is nul-terminated)
Makes sure that all pending updates to the UI have been completed.
This may occasionally be necessary, since #GtkUIManager updates the
UI in an idle function. A typical example where this function is
useful is to enforce that the menubar and toolbar have been added to
the main window before showing it:
|[
gtk_container_add (GTK_CONTAINER (window), vbox);
g_signal_connect (merge, "add-widget",
G_CALLBACK (add_widget), vbox);
gtk_ui_manager_add_ui_from_file (merge, "my-menus");
gtk_ui_manager_add_ui_from_file (merge, "my-toolbars");
gtk_ui_manager_ensure_update (merge);
gtk_widget_show (window);
]|
a #GtkUIManager
Returns the #GtkAccelGroup associated with @self.
the #GtkAccelGroup.
a #GtkUIManager object
Looks up an action by following a path. See gtk_ui_manager_get_widget()
for more information about paths.
the action whose proxy widget is found by following the path,
or %NULL if no widget was found.
a #GtkUIManager
a path
Returns the list of action groups associated with @self.
a #GList of
action groups. The list is owned by GTK+
and should not be modified.
a #GtkUIManager object
Returns whether menus generated by this #GtkUIManager
will have tearoff menu items.
whether tearoff menu items are added
a #GtkUIManager
Obtains a list of all toplevel widgets of the requested types.
a newly-allocated #GSList of
all toplevel widgets of the requested types. Free the returned list with g_slist_free().
a #GtkUIManager
specifies the types of toplevel widgets to include. Allowed
types are #GTK_UI_MANAGER_MENUBAR, #GTK_UI_MANAGER_TOOLBAR and
#GTK_UI_MANAGER_POPUP.
Creates a <link linkend="XML-UI">UI definition</link> of the merged UI.
A newly allocated string containing an XML representation of
the merged UI.
a #GtkUIManager
Looks up a widget by following a path.
The path consists of the names specified in the XML description of the UI.
separated by '/'. Elements which don't have a name or action attribute in
the XML (e.g. <popup>) can be addressed by their XML element name
(e.g. "popup"). The root element ("/ui") can be omitted in the path.
Note that the widget found by following a path that ends in a <menu>
element is the menuitem to which the menu is attached, not the menu itself.
Also note that the widgets constructed by a ui manager are not tied to
the lifecycle of the ui manager. If you add the widgets returned by this
function to some container or explicitly ref them, they will survive the
destruction of the ui manager.
the widget found by following the path, or %NULL if no widget
was found.
a #GtkUIManager
a path
Inserts an action group into the list of action groups associated
with @self. Actions in earlier groups hide actions with the same
name in later groups.
a #GtkUIManager object
the action group to be inserted
the position at which the group will be inserted.
Returns an unused merge id, suitable for use with
gtk_ui_manager_add_ui().
an unused merge id.
a #GtkUIManager
Removes an action group from the list of action groups associated
with @self.
a #GtkUIManager object
the action group to be removed
Unmerges the part of @self<!-- -->s content identified by @merge_id.
a #GtkUIManager object
a merge id as returned by gtk_ui_manager_add_ui_from_string()
Sets the "add_tearoffs" property, which controls whether menus
generated by this #GtkUIManager will have tearoff menu items.
Note that this only affects regular menus. Generated popup
menus never have tearoff menu items.
a #GtkUIManager
whether tearoff menu items are added
The "add-tearoffs" property controls whether generated menus
have tearoff menu items.
Note that this only affects regular menus. Generated popup
menus never have tearoff menu items.
The "actions-changed" signal is emitted whenever the set of actions
changes.
The add_widget signal is emitted for each generated menubar and toolbar.
It is not emitted for generated popup menus, which can be obtained by
gtk_ui_manager_get_widget().
the added widget
The connect_proxy signal is emitted after connecting a proxy to
an action in the group.
This is intended for simple customizations for which a custom action
class would be too clumsy, e.g. showing tooltips for menuitems in the
statusbar.
the action
the proxy
The disconnect_proxy signal is emitted after disconnecting a proxy
from an action in the group.
the action
the proxy
The post_activate signal is emitted just after the @action
is activated.
This is intended for applications to get notification
just after any action is activated.
the action
The pre_activate signal is emitted just before the @action
is activated.
This is intended for applications to get notification
just before any action is activated.
the action
the widget found by following the path, or %NULL if no widget
was found.
a path
the action whose proxy widget is found by following the path,
or %NULL if no widget was found.
a path
A #GtkVBox is a container that organizes child widgets into a single column.
Use the #GtkBox packing interface to determine the arrangement,
spacing, height, and alignment of #GtkVBox children.
All children are allocated the same width.
Creates a new #GtkVBox.
a new #GtkVBox.
%TRUE if all children are to be given equal space allotments.
the number of pixels to place by default between children.
Creates a new vertical button box.
a new button box #GtkWidget.
Retrieves the current layout used to arrange buttons in button box widgets.
Use gtk_button_box_get_layout() instead.
the current #GtkButtonBoxStyle.
Retrieves the current default spacing for vertical button boxes. This is the number of pixels
to be placed between the buttons when they are arranged.
Use gtk_box_get_spacing() instead.
the default number of pixels between buttons.
Sets a new layout mode that will be used by all button boxes.
Use gtk_button_box_set_layout() instead.
a new #GtkButtonBoxStyle.
Changes the default spacing that is placed between widgets in an
vertical button box.
Use gtk_box_set_spacing() instead.
an integer value.
The VPaned widget is a container widget with two
children arranged vertically. The division between
the two panes is adjustable by the user by dragging
a handle. See #GtkPaned for details.
Create a new #GtkVPaned
the new #GtkVPaned
<note>
This widget is considered too specialized/little-used for
GTK+, and will be removed in GTK 3. If your application needs this widget,
feel free to use it, as the widget is useful in some applications; it's just
not of general interest. However, we are not accepting new features for the
widget, and it will move out of the GTK+ distribution.
</note>
The VRuler widget is a widget arranged vertically creating a ruler that is
utilized around other widgets such as a text widget. The ruler is used to show
the location of the mouse on the window and to show the size of the window in
specified units. The available units of measurement are GTK_PIXELS, GTK_INCHES
and GTK_CENTIMETERS. GTK_PIXELS is the default unit of measurement.
Creates a new vertical ruler
a new #GtkVRuler.
The #GtkVScale widget is used to allow the user to select a value using
a vertical slider. To create one, use gtk_hscale_new_with_range().
The position to show the current value, and the number of decimal places
shown can be set using the parent #GtkScale class's functions.
Creates a new #GtkVScale.
a new #GtkVScale.
the #GtkAdjustment which sets the range of the scale.
Creates a new vertical scale widget that lets the user input a
number between @min and @max (including @min and @max) with the
increment @step. @step must be nonzero; it's the distance the
slider moves when using the arrow keys to adjust the scale value.
Note that the way in which the precision is derived works best if @step
is a power of ten. If the resulting precision is not suitable for your
needs, use gtk_scale_set_digits() to correct it.
a new #GtkVScale
minimum value
maximum value
step increment (tick size) used with keyboard shortcuts
The #GtkVScrollbar widget is a widget arranged vertically creating a
scrollbar. See #GtkScrollbar for details on
scrollbars. #GtkAdjustment pointers may be added to handle the
adjustment of the scrollbar or it may be left %NULL in which case one
will be created for you. See #GtkScrollbar for a description of what the
fields in an adjustment represent for a scrollbar.
Creates a new vertical scrollbar.
the new #GtkVScrollbar
the #GtkAdjustment to use, or %NULL to create a new adjustment
The #GtkVSeparator widget is a vertical separator, used to group the
widgets within a window. It displays a vertical line with a shadow to
make it appear sunken into the interface.
Creates a new #GtkVSeparator.
a new #GtkVSeparator.
The #GtkViewport widget acts as an adaptor class, implementing
scrollability for child widgets that lack their own scrolling
capabilities. Use #GtkViewport to scroll child widgets such as
#GtkTable, #GtkBox, and so on.
If a widget has native scrolling abilities, such as #GtkTextView,
#GtkTreeView or #GtkIconview, it can be added to a #GtkScrolledWindow
with gtk_container_add(). If a widget does not, you must first add the
widget to a #GtkViewport, then add the viewport to the scrolled window.
The convenience function gtk_scrolled_window_add_with_viewport() does
exactly this, so you can ignore the presence of the viewport.
Creates a new #GtkViewport with the given adjustments.
a new #GtkViewport.
horizontal adjustment.
vertical adjustment.
Gets the bin window of the #GtkViewport.
a #GdkWindow
a #GtkViewport
Returns the horizontal adjustment of the viewport.
the horizontal adjustment of @viewport.
a #GtkViewport.
Gets the shadow type of the #GtkViewport. See
gtk_viewport_set_shadow_type().
the shadow type
a #GtkViewport
Returns the vertical adjustment of the viewport.
the vertical adjustment of @viewport.
a #GtkViewport.
Gets the view window of the #GtkViewport.
a #GdkWindow
a #GtkViewport
Sets the horizontal adjustment of the viewport.
a #GtkViewport.
a #GtkAdjustment.
Sets the shadow type of the viewport.
a #GtkViewport.
the new shadow type.
Sets the vertical adjustment of the viewport.
a #GtkViewport.
a #GtkAdjustment.
Set the scroll adjustments for the viewport. Usually scrolled containers
like #GtkScrolledWindow will emit this signal to connect two instances
of #GtkScrollbar to the scroll directions of the #GtkViewport.
#GtkVolumeButton is a subclass of #GtkScaleButton that has
been tailored for use as a volume control widget with suitable
icons, tooltips and accessible labels.
Creates a #GtkVolumeButton, with a range between 0.0 and 1.0, with
a stepping of 0.02. Volume values can be obtained and modified using
the functions from #GtkScaleButton.
a new #GtkVolumeButton
Evaluates to %TRUE if the #GTK_APP_PAINTABLE flag has been set on the widget.
Use gtk_widget_get_app_paintable() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is allowed to receive the default action
via gtk_widget_grab_default().
Use gtk_widget_get_can_default() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is able to handle focus grabs.
Use gtk_widget_get_can_focus() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is a composite child of its parent.
Use the #GtkWidget:composite-child property instead.
a #GtkWidget.
Evaluates to %TRUE if the #GTK_DOUBLE_BUFFERED flag has been set on the widget.
Use gtk_widget_get_double_buffered() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is mapped and visible.
Use gtk_widget_is_drawable() instead.
a #GtkWidget.
Returns the widget flags from @wid.
Use the proper function to test individual states:
gtk_widget_get_app_paintable(), gtk_widget_get_can_default(),
gtk_widget_get_can_focus(), gtk_widget_get_double_buffered(),
gtk_widget_has_default(), gtk_widget_is_drawable(),
gtk_widget_has_focus(), gtk_widget_has_grab(), gtk_widget_get_mapped(),
gtk_widget_get_has_window(), gtk_widget_has_rc_style(),
gtk_widget_get_realized(), gtk_widget_get_receives_default(),
gtk_widget_get_sensitive(), gtk_widget_is_sensitive(),
gtk_widget_is_toplevel() or gtk_widget_get_visible().
a #GtkWidget.
Evaluates to %TRUE if the widget currently is receiving the default action.
Use gtk_widget_has_default() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget has grabbed the focus and no other
widget has done so more recently.
Use gtk_widget_has_focus() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is in the grab_widgets stack, and will be
the preferred one for receiving events other than ones of cosmetic value.
Use gtk_widget_has_grab() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is effectively sensitive.
Use gtk_widget_is_sensitive() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is mapped.
Use gtk_widget_get_mapped() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget doesn't have an own #GdkWindow.
Use gtk_widget_get_has_window() instead.
a #GtkWidget.
Evaluates to %TRUE if the #GTK_PARENT_SENSITIVE flag has be set on the widget.
Use gtk_widget_get_sensitive() on the parent widget instead.
a #GtkWidget.
Evaluates to %TRUE if the widget's style has been looked up through the rc
mechanism.
Use gtk_widget_has_rc_style() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is realized.
Use gtk_widget_get_realized() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget when focused will receive the default action
even if there is a different widget set as default.
Use gtk_widget_get_receives_default() instead.
a #GtkWidget.
Returns the saved state of the widget, as a #GtkStateType.
The saved state will be restored when a widget gets sensitive
again, after it has been made insensitive with gtk_widget_set_state()
or gtk_widget_set_sensitive().
Do not used it.
a #GtkWidget.
Evaluates to %TRUE if the #GTK_SENSITIVE flag has be set on the widget.
Use gtk_widget_get_sensitive() instead.
a #GtkWidget.
Turns on certain widget flags.
Use the proper function instead: gtk_widget_set_app_paintable(),
gtk_widget_set_can_default(), gtk_widget_set_can_focus(),
gtk_widget_set_double_buffered(), gtk_widget_set_has_window(),
gtk_widget_set_mapped(), gtk_widget_set_no_show_all(),
gtk_widget_set_realized(), gtk_widget_set_receives_default(),
gtk_widget_set_sensitive() or gtk_widget_set_visible().
a #GtkWidget.
the flags to set.
Returns the current state of the widget, as a #GtkStateType.
Use gtk_widget_get_state() instead.
a #GtkWidget.
Evaluates to %TRUE if the widget is a toplevel widget.
Use gtk_widget_is_toplevel() instead.
a #GtkWidget.
Gets the type of a widget.
Use G_OBJECT_TYPE() instead.
a #GtkWidget.
Turns off certain widget flags.
Use the proper function instead. See GTK_WIDGET_SET_FLAGS().
a #GtkWidget.
the flags to unset.
Evaluates to %TRUE if the widget is visible.
Use gtk_widget_get_visible() instead.
a #GtkWidget.
GtkWidget is the base class all widgets in GTK+ derive from. It manages the
widget lifecycle, states and style.
<refsect2 id="style-properties">
<para>
<structname>GtkWidget</structname> introduces <firstterm>style
properties</firstterm> - these are basically object properties that are stored
not on the object, but in the style object associated to the widget. Style
properties are set in <link linkend="gtk-Resource-Files">resource files</link>.
This mechanism is used for configuring such things as the location of the
scrollbar arrows through the theme, giving theme authors more control over the
look of applications without the need to write a theme engine in C.
</para>
<para>
Use gtk_widget_class_install_style_property() to install style properties for
a widget class, gtk_widget_class_find_style_property() or
gtk_widget_class_list_style_properties() to get information about existing
style properties and gtk_widget_style_get_property(), gtk_widget_style_get() or
gtk_widget_style_get_valist() to obtain the value of a style property.
</para>
</refsect2>
<refsect2 id="GtkWidget-BUILDER-UI">
<title>GtkWidget as GtkBuildable</title>
<para>
The GtkWidget implementation of the GtkBuildable interface supports a
custom <accelerator> element, which has attributes named key,
modifiers and signal and allows to specify accelerators.
</para>
<example>
<title>A UI definition fragment specifying an accelerator</title>
<programlisting><![CDATA[
<object class="GtkButton">
<accelerator key="q" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
</object>
]]></programlisting>
</example>
<para>
In addition to accelerators, <structname>GtkWidget</structname> also support a
custom <accessible> element, which supports actions and relations.
Properties on the accessible implementation of an object can be set by accessing the
internal child "accessible" of a <structname>GtkWidget</structname>.
</para>
<example>
<title>A UI definition fragment specifying an accessible</title>
<programlisting><![CDATA[
<object class="GtkButton" id="label1"/>
<property name="label">I am a Label for a Button</property>
</object>
<object class="GtkButton" id="button1">
<accessibility>
<action action_name="click" translatable="yes">Click the button.</action>
<relation target="label1" type="labelled-by"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-button1">
<property name="AtkObject::name">Clickable Button</property>
</object>
</child>
</object>
]]></programlisting>
</example>
</refsect2>
This is a convenience function for creating a widget and setting
its properties in one go. For example you might write:
<literal>gtk_widget_new (GTK_TYPE_LABEL, "label", "Hello World", "xalign",
0.0, NULL)</literal> to create a left-aligned label. Equivalent to
g_object_new(), but returns a widget so you don't have to
cast the object yourself.
a new #GtkWidget of type @widget_type
type ID of the widget to create
name of first property to set
value of first property, followed by more properties,
%NULL-terminated
Obtains the default colormap used to create widgets.
default widget colormap
Obtains the current default reading direction. See
gtk_widget_set_default_direction().
the current default direction.
Returns the default style used by all widgets initially.
the default style. This #GtkStyle object is owned
by GTK+ and should not be modified or freed.
Obtains the visual of the default colormap. Not really useful;
used to be useful before gdk_colormap_get_visual() existed.
visual of the default colormap
Removes a colormap pushed with gtk_widget_push_colormap().
Cancels the effect of a previous call to gtk_widget_push_composite_child().
Pushes @cmap onto a global stack of colormaps; the topmost
colormap on the stack will be used to create all widgets.
Remove @cmap with gtk_widget_pop_colormap(). There's little
reason to use this function.
a #GdkColormap
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 colormap to use when creating widgets.
gtk_widget_push_colormap() is a better function to use if
you only want to affect a few widgets, rather than all widgets.
a #GdkColormap
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.
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.
%TRUE if the accelerator can be activated.
a #GtkWidget
the ID of a signal installed on @widget
Emits a #GtkWidget::child-notify signal for the
<link linkend="child-properties">child property</link> @child_property
on @widget.
This is the analogue of g_object_notify() for child properties.
a #GtkWidget
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.
return from the event signal emission (%TRUE if
the event was handled)
a #GtkWidget
a #GdkEvent
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 <envar>GTK_MODULES</envar> or via another application library,
such as libgnome), then this #AtkObject instance may be a no-op. Likewise,
if no class-specific #AtkObject implementation is available for the widget
instance in question, it will inherit an #AtkObject implementation from the
first ancestor class for which such an implementation is defined.
The documentation of the <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
library contains more information about accessible objects and their uses.
the #AtkObject associated with @widget
a #GtkWidget
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.
a #GtkWidget
Reverses the effects of gtk_widget_show(), causing the widget to be
hidden (invisible to the user).
a #GtkWidget
Recursively hides a widget and any child widgets.
Use gtk_widget_hide() instead.
a #GtkWidget
This function is only for use in widget implementations. Causes
a widget to be mapped if it isn't already.
a #GtkWidget
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 the signal has been handled
a #GtkWidget
%TRUE if there are other widgets with the same mnemonic
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.
a #GtkWidget
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.
a #GtkWidget
Recursively shows a widget, and any child widgets (if the widget is
a container).
a #GtkWidget
This function is only used by #GtkContainer subclasses, to assign a size
and position to their child widgets.
a #GtkWidget
position and size to be allocated to @widget
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 #GtkWidget
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.
a #GtkWidget
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).
a #GtkWidget
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.
%TRUE if the widget was activatable
a #GtkWidget that's activatable
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 to install an accelerator on
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.
a #GtkWidget
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.
a #GtkWidget
a #GtkWidget that acts as a mnemonic label for @widget
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.
%TRUE if the accelerator can be activated.
a #GtkWidget
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.
%TRUE if focus ended up inside @widget
a #GtkWidget
direction of focus movement
Emits a #GtkWidget::child-notify signal for the
<link linkend="child-properties">child property</link> @child_property
on @widget.
This is the analogue of g_object_notify() for child properties.
a #GtkWidget
the name of a child property installed on the
class of @widget<!-- -->'s parent
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().
a #GtkWidget
location to store the length of the class path, or %NULL
location to store the class path as an allocated string, or %NULL
location to store the reverse class path as an allocated
string, or %NULL
Creates a new #PangoContext with the appropriate font map,
font description, and base direction for drawing text for
this widget. See also gtk_widget_get_pango_context().
the new #PangoContext
a #GtkWidget
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.
the new #PangoLayout
a #GtkWidget
text to set on the layout (can be %NULL)
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.
a #GtkWidget
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.
a #GtkWidget
address of a variable that contains @widget
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.
a #GtkWidget
area to draw
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.
a #GtkWidget
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.
a #GtkWidget
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.
return from the event signal emission (%TRUE if
the event was handled)
a #GtkWidget
a #GdkEvent
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.
a #GtkWidget
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 <envar>GTK_MODULES</envar> or via another application library,
such as libgnome), then this #AtkObject instance may be a no-op. Likewise,
if no class-specific #AtkObject implementation is available for the widget
instance in question, it will inherit an #AtkObject implementation from the
first ancestor class for which such an implementation is defined.
The documentation of the <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
library contains more information about accessible objects and their uses.
the #AtkObject associated with @widget
a #GtkWidget
Returns the #GtkAction that @widget is a proxy for.
See also gtk_action_get_proxies().
Use gtk_activatable_get_related_action() instead.
the action that a widget is a proxy for, or
%NULL, if it is not attached to an action.
a #GtkWidget
Retrieves the widget's allocation.
a #GtkWidget
a pointer to a #GtkAllocation to copy to
Gets the first ancestor of @widget with type @widget_type. For example,
<literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> gets
the first #GtkBox that's an ancestor of @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.
the ancestor widget, or %NULL if not found
a #GtkWidget
ancestor type
Determines whether the application intends to draw on the widget in
an #GtkWidget::expose-event handler.
See gtk_widget_set_app_paintable()
%TRUE if the widget is app paintable
a #GtkWidget
Determines whether @widget can be a default widget. See
gtk_widget_set_can_default().
%TRUE if @widget can be a default widget, %FALSE otherwise
a #GtkWidget
Determines whether @widget can own the input focus. See
gtk_widget_set_can_focus().
%TRUE if @widget can own the input focus, %FALSE otherwise
a #GtkWidget
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 #GtkWidget
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.
%TRUE if the widget is mapped with the parent.
a #GtkWidget
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.
the appropriate clipboard object. If no
clipboard already exists, a new one will
be created. Once a clipboard object has
been created, it is persistent for all time.
a #GtkWidget
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 colormap that will be used to render @widget. No reference will
be added to the returned colormap; it should not be unreferenced.
the colormap used by @widget
a #GtkWidget
Obtains the composite name of a widget.
the composite name of @widget, or %NULL if @widget is not
a composite child. The string should be freed when it is no
longer needed.
a #GtkWidget
Gets the reading direction for a particular widget. See
gtk_widget_set_direction().
the reading direction for the widget.
a #GtkWidget
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.
the #GdkDisplay for the toplevel for this widget.
a #GtkWidget
Determines whether the widget is double buffered.
See gtk_widget_set_double_buffered()
%TRUE if the widget is double buffered
a #GtkWidget
Returns the event mask for the widget (a bitfield containing flags
from the #GdkEventMask enumeration). These are the events that the widget
will receive.
event mask for @widget
a #GtkWidget
Retrieves the extension events the widget will receive; see
gdk_input_set_extension_events().
extension events for @widget
a #GtkWidget
Returns the current value of the has-tooltip property. See
GtkWidget:has-tooltip for more information.
current value of has-tooltip on @widget.
a #GtkWidget
Determines whether @widget has a #GdkWindow of its own. See
gtk_widget_set_has_window().
%TRUE if @widget has a window, %FALSE otherwise
a #GtkWidget
Whether the widget is mapped.
%TRUE if the widget is mapped, %FALSE otherwise.
a #GtkWidget
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.
the modifier style for the widget. This rc style is
owned by the widget. If you want to keep a pointer to value this
around, you must add a refcount using g_object_ref().
a #GtkWidget
Retrieves the name of a widget. See gtk_widget_set_name() for the
significance of widget names.
name of the widget. This string is owned by GTK+ and
should not be modified or freed
a #GtkWidget
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.
the current value of the "no-show-all" property.
a #GtkWidget
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.
the #PangoContext for the widget.
a #GtkWidget
Returns the parent container of @widget.
the parent container of @widget, or %NULL
a #GtkWidget
Gets @widget's parent window.
the parent window of @widget.
a #GtkWidget.
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.
a #GtkWidget
return location for the X coordinate, or %NULL
return location for the Y coordinate, or %NULL
Determines whether @widget is realized.
%TRUE if @widget is realized, %FALSE otherwise
a #GtkWidget
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().
%TRUE if @widget acts as default widget when focussed,
%FALSE otherwise
a #GtkWidget
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.
a #GtkWidget
a pointer to a #GtkRequisition to copy to
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.
the #GdkWindow root window for the toplevel for this widget.
a #GtkWidget
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.
the #GdkScreen for the toplevel for this widget.
a #GtkWidget
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().
%TRUE if the widget is sensitive
a #GtkWidget
Gets the settings object holding the settings (global property
settings, RC file information, etc) used for this widget.
Note that this function can only be called when the #GtkWidget
is attached to a toplevel, since the settings object is specific
to a particular #GdkScreen.
the relevant #GtkSettings object
a #GtkWidget
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.
a #GtkWidget
return location for width, or %NULL
return location for height, or %NULL
Create a #GdkPixmap of the contents of the widget and its children.
Works even if the widget is obscured. The depth and visual of the
resulting pixmap is dependent on the widget being snapshot and likely
differs from those of a target widget displaying the pixmap.
The function gdk_pixbuf_get_from_drawable() can be used to convert
the pixmap to a visual independant representation.
The snapshot area used by this function is the @widget's allocation plus
any extra space occupied by additional windows belonging to this widget
(such as the arrows of a spin button).
Thus, the resulting snapshot pixmap is possibly larger than the allocation.
If @clip_rect is non-%NULL, the resulting pixmap is shrunken to
match the specified clip_rect. The (x,y) coordinates of @clip_rect are
interpreted widget relative. If width or height of @clip_rect are 0 or
negative, the width or height of the resulting pixmap will be shrunken
by the respective amount.
For instance a @clip_rect <literal>{ +5, +5, -10, -10 }</literal> will
chop off 5 pixels at each side of the snapshot pixmap.
If non-%NULL, @clip_rect will contain the exact widget-relative snapshot
coordinates upon return. A @clip_rect of <literal>{ -1, -1, 0, 0 }</literal>
can be used to preserve the auto-grown snapshot area and use @clip_rect
as a pure output parameter.
The returned pixmap can be %NULL, if the resulting @clip_area was empty.
#GdkPixmap snapshot of the widget
a #GtkWidget
a #GdkRectangle or %NULL
Returns the widget's state. See gtk_widget_set_state().
the state of @widget.
a #GtkWidget
Simply an accessor function that returns @widget->style.
the widget's #GtkStyle
a #GtkWidget
Gets the contents of the tooltip for @widget.
the tooltip text, or %NULL. You should free the
returned string with g_free() when done.
a #GtkWidget
Gets the contents of the tooltip for @widget.
the tooltip text, or %NULL. You should free the
returned string with g_free() when done.
a #GtkWidget
Returns the #GtkWindow of the current tooltip. This can be the
GtkWindow created by default, or the custom tooltip window set
using gtk_widget_set_tooltip_window().
The #GtkWindow of the current tooltip.
a #GtkWidget
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();
<literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
would return
%NULL if @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. */
}
]|
the topmost ancestor of @widget, or @widget itself
if there's no ancestor.
a #GtkWidget
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().
%TRUE if the widget is visible
a #GtkWidget
Gets the visual that will be used to render @widget.
the visual for @widget
a #GtkWidget
Returns the widget's window if it is realized, %NULL otherwise
@widget's window.
a #GtkWidget
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 <literal>gtk_widget_set_can_default (@widget,
%TRUE)</literal>. The default widget is activated when
the user presses Enter in a window. Default widgets must be
activatable, that is, gtk_widget_activate() should affect them.
a #GtkWidget
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.
a #GtkWidget
Determines whether @widget is the current default widget within its
toplevel. See gtk_widget_set_can_default().
%TRUE if @widget is the current default widget within
its toplevel, %FALSE otherwise
a #GtkWidget
Determines if the widget has the global input focus. See
gtk_widget_is_focus() for the difference between having the global
input focus, and only having the focus within a toplevel.
%TRUE if the widget has the global input focus.
a #GtkWidget
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().
%TRUE if the widget is in the grab_widgets stack
a #GtkWidget
Determines if the widget style has been looked up through the rc mechanism.
%TRUE if the widget has been looked up through the rc
mechanism, %FALSE otherwise.
a #GtkWidget
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.
%TRUE if there is a #GdkScreen associcated
with the widget.
a #GtkWidget
Reverses the effects of gtk_widget_show(), causing the widget to be
hidden (invisible to the user).
a #GtkWidget
Recursively hides a widget and any child widgets.
Use gtk_widget_hide() instead.
a #GtkWidget
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.
%TRUE
a #GtkWidget
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.
a #GtkWidget
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
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.
%TRUE if there was an intersection
a #GtkWidget
a rectangle
rectangle to store intersection of @widget and @area
Determines whether @widget is somewhere inside @ancestor, possibly with
intermediate containers.
%TRUE if @ancestor contains @widget as a child,
grandchild, great grandchild, etc.
a #GtkWidget
another #GtkWidget
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()).
%TRUE if the widget can rely on its alpha
channel being drawn correctly.
a #GtkWidget
Determines whether @widget can be drawn to. A widget can be drawn
to if it is mapped and visible.
%TRUE if @widget is drawable, %FALSE otherwise
a #GtkWidget
Determines if the widget is the focus widget within its
toplevel. (This does not mean that the %HAS_FOCUS flag is
necessarily set; %HAS_FOCUS will only be set if the
toplevel widget additionally has the global input focus.)
%TRUE if the widget is the focus widget.
a #GtkWidget
Returns the widget's effective sensitivity, which means
it is sensitive itself and also its parent widget is sensntive
%TRUE if the widget is effectively sensitive
a #GtkWidget
Determines whether @widget is a toplevel widget. Currently only
#GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
widgets have no parent widget.
%TRUE if @widget is a toplevel, %FALSE otherwise
a #GtkWidget
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.
%TRUE if stopping keyboard navigation is fine, %FALSE
if the emitting widget should try to handle the keyboard
navigation attempt in its parent container(s).
a #GtkWidget
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().
a newly allocated #GList of closures
widget to list accelerator closures for
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
<emphasis>must</emphasis> call <literal>g_list_foreach (result,
(GFunc)g_object_ref, NULL)</literal> first, and then unref all the
widgets afterwards.
the list of
mnemonic labels; free this list
with g_list_free() when you are done with it.
a #GtkWidget
This function is only for use in widget implementations. Causes
a widget to be mapped if it isn't already.
a #GtkWidget
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 the signal has been handled
a #GtkWidget
%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.
a #GtkWidget
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.
a #GtkWidget
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().
a #GtkWidget
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().
a #GtkWidget
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().
a #GtkWidget
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.
a #GtkWidget
the #GtkRcStyle holding the style 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().
a #GtkWidget
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().
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.
a #GtkWidget
location to store length of the path, or %NULL
location to store allocated path string, or %NULL
location to store allocated reverse path string, or %NULL
This function does the same as gtk_widget_queue_draw().
Use gtk_widget_queue_draw() instead.
a #GtkWidget
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.
Use gtk_widget_queue_draw_area() instead.
a #GtkWidget
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.
a #GtkWidget
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.
a #GtkWidget
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.
a #GtkWidget
This function works like gtk_widget_queue_resize(),
except that the widget is not invalidated.
a #GtkWidget
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.
a #GtkWidget
Adds a reference to a widget. This function is exactly the same
as calling g_object_ref(), and exists mostly for historical
reasons. It can still be convenient to avoid casting a widget
to a #GObject, it saves a small amount of typing.
Use g_object_ref() instead.
the widget that was referenced
a #GtkWidget
Computes the intersection of a @widget's area and @region, returning
the intersection. The result may be empty, use gdk_region_empty() to
check.
A newly allocated region holding the intersection of @widget
and @region. The coordinates of the return value are
relative to @widget->window for %NO_WINDOW widgets, and
relative to the parent window of @widget->window for
widgets with their own window.
a #GtkWidget
a #GdkRegion, in the same coordinate system as
@widget->allocation. That is, relative to @widget->window
for %NO_WINDOW widgets; relative to the parent window
of @widget->window for widgets with their own window.
Removes an accelerator from @widget, previously installed with
gtk_widget_add_accelerator().
whether an accelerator was installed and could be removed
widget to install an accelerator on
accel group for this widget
GDK keyval of the accelerator
modifier key combination of the accelerator
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
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 new pixbuf, or %NULL if the
stock ID wasn't known
a #GtkWidget
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
Moves a widget from one #GtkContainer to another, handling reference
count issues to avoid destroying the widget.
a #GtkWidget
a #GtkContainer to move the widget into
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.
a #GtkWidget.
Recursively resets the shape on this widget and its descendants.
This function is being removed in GTK+ 3.0. Don't use it.
a #GtkWidget
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().
return from the event signal emission (%TRUE if
the event was handled)
a #GtkWidget
a expose #GdkEvent
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);
]|
the return value from the event signal emission: %TRUE
if the event was handled, and %FALSE otherwise
a #GtkWidget
a #GdkEvent of type GDK_FOCUS_CHANGE
Precursor of g_object_set().
Use g_object_set() instead.
a #GtkWidget
name of first property to set
value of first property, followed by more properties,
%NULL-terminated
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().
a #GtkWidget
path used to look up the accelerator
a #GtkAccelGroup.
Sets the widget's allocation. This should not be used
directly, but from within a widget's size_allocate method.
a #GtkWidget
a pointer to a #GtkAllocation to copy from
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);
]|
a #GtkWidget
%TRUE if the application will paint on the widget
Specifies whether @widget can be a default widget. See
gtk_widget_grab_default() for details about the meaning of
"default".
a #GtkWidget
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.
a #GtkWidget
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.
a #GtkWidget
if %TRUE, @widget should be mapped along with its parent.
Sets the colormap for the widget to the given value. Widget must not
have been previously realized. This probably should only be used
from an <function>init()</function> function (i.e. from the constructor
for the widget).
a #GtkWidget
a colormap
Sets a widgets composite name. The widget must be
a composite child of its parent; see gtk_widget_push_composite_child().
a #GtkWidget.
the name to set
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.
a #GtkWidget
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()).
a #GtkWidget
%TRUE to double-buffer a widget
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.
a #GtkWidget
event mask
Sets the extension events mask to @mode. See #GdkExtensionMode
and gdk_input_set_extension_events().
a #GtkWidget
bitfield of extension events to receive
Sets the has-tooltip property on @widget to @has_tooltip. See
GtkWidget:has-tooltip for more information.
a #GtkWidget
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.
a #GtkWidget
whether or not @widget has a window.
Marks the widget as being realized.
This function should only ever be called in a derived widget's
"map" or "unmap" implementation.
a #GtkWidget
%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.
a #GtkWidget
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.
a #GtkWidget
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().
a #GtkWidget
parent container
Sets a non default parent window for @widget.
a #GtkWidget.
the new parent window.
Marks the widget as being realized.
This function should only ever be called in a derived widget's
"realize" or "unrealize" implementation.
a #GtkWidget
%TRUE to mark the widget as realized
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".
a #GtkWidget
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 <emphasis>does</emphasis> draw on @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.
a #GtkWidget
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.
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.
%TRUE if the widget supports scrolling
a #GtkWidget
an adjustment for horizontal scrolling, or %NULL
an adjustment for vertical scrolling, or %NULL
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.
a #GtkWidget
%TRUE to make the widget sensitive
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."
a #GtkWidget
width @widget should request, or -1 to unset
height @widget should request, or -1 to unset
This function is for use in widget implementations. Sets the state
of a widget (insensitive, prelighted, etc.) Usually you should set
the state using wrapper functions such as gtk_widget_set_sensitive().
a #GtkWidget
new state for @widget
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 #GtkWidget
a #GtkStyle, or %NULL to remove the effect of a previous
gtk_widget_set_style() and go back to the default style
Sets @markup as the contents of the tooltip, which is marked up with
the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
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().
a #GtkWidget
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().
a #GtkWidget
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().
a #GtkWidget
a #GtkWindow, or %NULL
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.
a #GtkWidget
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.
Use gtk_widget_set_size_request() instead.
a #GtkWidget
minimum width, or -1 to unset
minimum height, or -1 to unset
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.
a #GtkWidget
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.
a #GtkWidget
a #GdkWindow
Sets a shape for this widget's GDK window. This allows for
transparent windows etc., see gdk_window_shape_combine_mask()
for more information.
a #GtkWidget
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.
a #GtkWidget
Recursively shows a widget, and any child widgets (if the widget is
a container).
a #GtkWidget
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.
a #GtkWidget
This function is only used by #GtkContainer subclasses, to assign a size
and position to their child widgets.
a #GtkWidget
position and size to be allocated to @widget
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 #GtkWidget
a #GtkRequisition to be filled in
This function attaches the widget's #GtkStyle to the widget's
#GdkWindow. It is a replacement for
<programlisting>
widget->style = gtk_style_attach (widget->style, widget->window);
</programlisting>
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 values of a multiple style properties of @widget.
a #GtkWidget
the name of the first property to get
pairs of property names and locations to
return the property values, starting with the location for
@first_property_name, terminated by %NULL.
Gets the value of a style property of @widget.
a #GtkWidget
the name of a style property
location to return the property value
Non-vararg variant of gtk_widget_style_get(). Used primarily by language
bindings.
a #GtkWidget
the name of the first property to get
a <type>va_list</type> of pairs of property names and
locations to return the property values, starting with the location
for @first_property_name.
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.
a #GtkWidget
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.
%FALSE if either widget was not realized, or there
was no common ancestor. In this case, nothing is stored in
*@dest_x and *@dest_y. Otherwise %TRUE.
a #GtkWidget
a #GtkWidget
X position relative to @src_widget
Y position relative to @src_widget
location to store X position relative to @dest_widget
location to store Y position relative to @dest_widget
Triggers a tooltip query on the display where the toplevel of @widget
is located. See gtk_tooltip_trigger_tooltip_query() for more
information.
a #GtkWidget
This function is only for use in widget implementations. Causes
a widget to be unmapped if it's currently mapped.
a #GtkWidget
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.
a #GtkWidget
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).
a #GtkWidget
Inverse of gtk_widget_ref(). Equivalent to g_object_unref().
Use g_object_unref() instead.
a #GtkWidget
Whether or not the widget is double buffered.
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.
Sets the text of tooltip to be the given string, which is marked up
with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
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.
The widget's window if it is realized, %NULL otherwise.
The ::button-press-event signal will be emitted when a button
(typically from a mouse) is pressed.
To receive this signal, the #GdkWindow associated to the
widget needs to enable the #GDK_BUTTON_PRESS_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventButton which triggered
this signal.
The ::button-release-event signal will be emitted when a button
(typically from a mouse) is released.
To receive this signal, the #GdkWindow associated to the
widget needs to enable the #GDK_BUTTON_RELEASE_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventButton which triggered
this signal.
Determines whether an accelerator that activates the signal
identified by @signal_id can currently be activated.
This signal is present to allow applications and derived
widgets to override the default #GtkWidget handling
for determining whether an accelerator can be activated.
%TRUE if the signal can be activated.
the ID of a signal installed on @widget
The ::child-notify signal is emitted for each
<link linkend="child-properties">child property</link> that has
changed on an object. The signal's detail holds the property name.
the #GParamSpec of the changed child property
The ::client-event will be emitted when the @widget's window
receives a message (via a ClientMessage event) from another
application.
%TRUE to stop other handlers from being invoked for
the event. %FALSE to propagate the event further.
the #GdkEventClient which triggered
this signal.
The ::composited-changed signal is emitted when the composited
status of @widget<!-- -->s screen changes.
See gdk_screen_is_composited().
The ::configure-event signal will be emitted when the size, position or
stacking of the @widget's window has changed.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask
automatically for all new windows.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventConfigure which triggered
this signal.
Emitted when a redirected window belonging to @widget gets drawn into.
The region/area members of the event shows what area of the redirected
drawable was drawn into.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventExpose event
The ::delete-event signal is emitted if a user requests that
a toplevel window is closed. The default handler for this signal
destroys the window. Connecting gtk_widget_hide_on_delete() to
this signal will cause the window to be hidden instead, so that
it can later be shown again without reconstructing it.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the event which triggered this signal
The ::destroy-event signal is emitted when a #GdkWindow is destroyed.
You rarely get this signal, because most widgets disconnect themselves
from their window before they destroy it, so no widget owns the
window at destroy time.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask
automatically for all new windows.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the event which triggered this signal
The ::direction-changed signal is emitted when the text direction
of a widget changes.
the previous text direction of @widget
The ::drag-begin signal is emitted on the drag source when a drag is
started. A typical reason to connect to this signal is to set up a
custom drag icon with gtk_drag_source_set_icon().
Note that some widgets set up a drag icon in the default handler of
this signal, so you may have to use g_signal_connect_after() to
override what the default handler did.
the drag context
The ::drag-data-delete signal is emitted on the drag source when a drag
with the action %GDK_ACTION_MOVE is successfully completed. The signal
handler is responsible for deleting the data that has been dropped. What
"delete" means depends on the context of the drag operation.
the drag context
The ::drag-data-get signal is emitted on the drag source when the drop
site requests the data which is dragged. It is the responsibility of
the signal handler to fill @data with the data in the format which
is indicated by @info. See gtk_selection_data_set() and
gtk_selection_data_set_text().
the drag context
the #GtkSelectionData to be filled with the dragged data
the info that has been registered with the target in the
#GtkTargetList
the timestamp at which the data was requested
The ::drag-data-received signal is emitted on the drop site when the
dragged data has been received. If the data was received in order to
determine whether the drop will be accepted, the handler is expected
to call gdk_drag_status() and <emphasis>not</emphasis> finish the drag.
If the data was received in response to a #GtkWidget::drag-drop signal
(and this is the last target to be received), the handler for this
signal is expected to process the received data and then call
gtk_drag_finish(), setting the @success parameter depending on whether
the data was processed successfully.
The handler may inspect and modify @drag_context->action before calling
gtk_drag_finish(), e.g. to implement %GDK_ACTION_ASK as shown in the
following example:
|[
void
drag_data_received (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint time)
{
if ((data->length >= 0) && (data->format == 8))
{
if (drag_context->action == GDK_ACTION_ASK)
{
GtkWidget *dialog;
gint response;
dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_YES_NO,
"Move the data ?\n");
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_YES)
drag_context->action = GDK_ACTION_MOVE;
else
drag_context->action = GDK_ACTION_COPY;
}
gtk_drag_finish (drag_context, TRUE, FALSE, time);
return;
}
gtk_drag_finish (drag_context, FALSE, FALSE, time);
}
]|
the drag context
where the drop happened
where the drop happened
the received data
the info that has been registered with the target in the
#GtkTargetList
the timestamp at which the data was received
The ::drag-drop signal is emitted on the drop site when the user drops
the data onto the widget. The signal handler must determine whether
the cursor position is in a drop zone or not. If it is not in a drop
zone, it returns %FALSE and no further processing is necessary.
Otherwise, the handler returns %TRUE. In this case, the handler must
ensure that gtk_drag_finish() is called to let the source know that
the drop is done. The call to gtk_drag_finish() can be done either
directly or in a #GtkWidget::drag-data-received handler which gets
triggered by calling gtk_drag_get_data() to receive the data for one
or more of the supported targets.
whether the cursor position is in a drop zone
the drag context
the x coordinate of the current cursor position
the y coordinate of the current cursor position
the timestamp of the motion event
The ::drag-end signal is emitted on the drag source when a drag is
finished. A typical reason to connect to this signal is to undo
things done in #GtkWidget::drag-begin.
the drag context
The ::drag-failed signal is emitted on the drag source when a drag has
failed. The signal handler may hook custom code to handle a failed DND
operation based on the type of error, it returns %TRUE is the failure has
been already handled (not showing the default "drag operation failed"
animation), otherwise it returns %FALSE.
%TRUE if the failed drag operation has been already handled.
the drag context
the result of the drag operation
The ::drag-leave signal is emitted on the drop site when the cursor
leaves the widget. A typical reason to connect to this signal is to
undo things done in #GtkWidget::drag-motion, e.g. undo highlighting
with gtk_drag_unhighlight()
the drag context
the timestamp of the motion event
The drag-motion signal is emitted on the drop site when the user
moves the cursor over the widget during a drag. The signal handler
must determine whether the cursor position is in a drop zone or not.
If it is not in a drop zone, it returns %FALSE and no further processing
is necessary. Otherwise, the handler returns %TRUE. In this case, the
handler is responsible for providing the necessary information for
displaying feedback to the user, by calling gdk_drag_status().
If the decision whether the drop will be accepted or rejected can't be
made based solely on the cursor position and the type of the data, the
handler may inspect the dragged data by calling gtk_drag_get_data() and
defer the gdk_drag_status() call to the #GtkWidget::drag-data-received
handler. Note that you cannot not pass #GTK_DEST_DEFAULT_DROP,
#GTK_DEST_DEFAULT_MOTION or #GTK_DEST_DEFAULT_ALL to gtk_drag_dest_set()
when using the drag-motion signal that way.
Also note that there is no drag-enter signal. The drag receiver has to
keep track of whether he has received any drag-motion signals since the
last #GtkWidget::drag-leave and if not, treat the drag-motion signal as
an "enter" signal. Upon an "enter", the handler will typically highlight
the drop site with gtk_drag_highlight().
|[
static void
drag_motion (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time)
{
GdkAtom target;
PrivateData *private_data = GET_PRIVATE_DATA (widget);
if (!private_data->drag_highlight)
{
private_data->drag_highlight = 1;
gtk_drag_highlight (widget);
}
target = gtk_drag_dest_find_target (widget, context, NULL);
if (target == GDK_NONE)
gdk_drag_status (context, 0, time);
else
{
private_data->pending_status = context->suggested_action;
gtk_drag_get_data (widget, context, target, time);
}
return TRUE;
}
static void
drag_data_received (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection_data,
guint info,
guint time)
{
PrivateData *private_data = GET_PRIVATE_DATA (widget);
if (private_data->suggested_action)
{
private_data->suggested_action = 0;
/* We are getting this data due to a request in drag_motion,
* rather than due to a request in drag_drop, so we are just
* supposed to call gdk_drag_status (), not actually paste in
* the data.
*/
str = gtk_selection_data_get_text (selection_data);
if (!data_is_acceptable (str))
gdk_drag_status (context, 0, time);
else
gdk_drag_status (context, private_data->suggested_action, time);
}
else
{
/* accept the drop */
}
}
]|
whether the cursor position is in a drop zone
the drag context
the x coordinate of the current cursor position
the y coordinate of the current cursor position
the timestamp of the motion event
The ::enter-notify-event will be emitted when the pointer enters
the @widget's window.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_ENTER_NOTIFY_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventCrossing which triggered
this signal.
The GTK+ main loop will emit three signals for each GDK event delivered
to a widget: one generic ::event signal, another, more specific,
signal that matches the type of event delivered (e.g.
#GtkWidget::key-press-event) and finally a generic
#GtkWidget::event-after signal.
%TRUE to stop other handlers from being invoked for the event
and to cancel the emission of the second specific ::event signal.
%FALSE to propagate the event further and to allow the emission of
the second signal. The ::event-after signal is emitted regardless of
the return value.
the #GdkEvent which triggered this signal
After the emission of the #GtkWidget::event signal and (optionally)
the second more specific signal, ::event-after will be emitted
regardless of the previous two signals handlers return values.
the #GdkEvent which triggered this signal
The ::expose-event signal is emitted when an area of a previously
obscured #GdkWindow is made visible and needs to be redrawn.
#GTK_NO_WINDOW widgets will get a synthesized event from their parent
widget.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_EXPOSURE_MASK mask.
Note that the ::expose-event signal has been replaced by a ::draw
signal in GTK+ 3. The <link linkend="http://library.gnome.org/devel/gtk3/3.0/gtk-migrating-2-to-3.html">GTK+ 3 migration guide</link>
for hints on how to port from ::expose-event to ::draw.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventExpose which triggered
this signal.
%TRUE to stop other handlers from being invoked for the event. %FALSE to propagate the event further.
The ::focus-in-event signal will be emitted when the keyboard focus
enters the @widget's window.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_FOCUS_CHANGE_MASK mask.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventFocus which triggered
this signal.
The ::focus-out-event signal will be emitted when the keyboard focus
leaves the @widget's window.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_FOCUS_CHANGE_MASK mask.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventFocus which triggered this
signal.
Emitted when a pointer or keyboard grab on a window belonging
to @widget gets broken.
On X11, this happens when the grab window becomes unviewable
(i.e. it or one of its ancestors is unmapped), or if the same
application grabs the pointer or keyboard again.
%TRUE to stop other handlers from being invoked for
the event. %FALSE to propagate the event further.
the #GdkEventGrabBroken event
The ::grab-notify signal is emitted when a widget becomes
shadowed by a GTK+ grab (not a pointer or keyboard grab) on
another widget, or when it becomes unshadowed due to a grab
being removed.
A widget is shadowed by a gtk_grab_add() when the topmost
grab widget in the grab stack of its window group is not
its ancestor.
%FALSE if the widget becomes shadowed, %TRUE
if it becomes unshadowed
The ::hierarchy-changed signal is emitted when the
anchored state of a widget changes. A widget is
<firstterm>anchored</firstterm> when its toplevel
ancestor is a #GtkWindow. This signal is emitted when
a widget changes from un-anchored to anchored or vice-versa.
the previous toplevel ancestor, or %NULL
if the widget was previously unanchored
The ::key-press-event signal is emitted when a key is pressed.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_KEY_PRESS_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventKey which triggered this signal.
The ::key-release-event signal is emitted when a key is pressed.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_KEY_RELEASE_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventKey which triggered this signal.
Gets emitted if keyboard navigation fails.
See gtk_widget_keynav_failed() for details.
%TRUE if stopping keyboard navigation is fine, %FALSE
if the emitting widget should try to handle the keyboard
navigation attempt in its parent container(s).
the direction of movement
The ::leave-notify-event will be emitted when the pointer leaves
the @widget's window.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_LEAVE_NOTIFY_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventCrossing which triggered
this signal.
The ::map-event signal will be emitted when the @widget's window is
mapped. A window is mapped when it becomes visible on the screen.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask
automatically for all new windows.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventAny which triggered this signal.
The ::motion-notify-event signal is emitted when the pointer moves
over the widget's #GdkWindow.
To receive this signal, the #GdkWindow associated to the widget
needs to enable the #GDK_POINTER_MOTION_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventMotion which triggered
this signal.
The ::no-expose-event will be emitted when the @widget's window is
drawn as a copy of another #GdkDrawable (with gdk_draw_drawable() or
gdk_window_copy_area()) which was completely unobscured. If the source
window was partially obscured #GdkEventExpose events will be generated
for those areas.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventNoExpose which triggered
this signal.
The ::parent-set signal is emitted when a new parent
has been set on a widget.
the previous parent, or %NULL if the widget
just got its initial parent.
This signal gets emitted whenever a widget should pop up a context
menu. This usually happens through the standard key binding mechanism;
by pressing a certain key while a widget is focused, the user can cause
the widget to pop up a menu. For example, the #GtkEntry widget creates
a menu with clipboard commands. See <xref linkend="checklist-popup-menu"/>
for an example of how to use this signal.
%TRUE if a menu was activated
The ::property-notify-event signal will be emitted when a property on
the @widget's window has been changed or deleted.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_PROPERTY_CHANGE_MASK mask.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventProperty which triggered
this signal.
To receive this signal the #GdkWindow associated to the widget needs
to enable the #GDK_PROXIMITY_IN_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventProximity which triggered
this signal.
To receive this signal the #GdkWindow associated to the widget needs
to enable the #GDK_PROXIMITY_OUT_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventProximity which triggered
this signal.
Emitted when #GtkWidget:has-tooltip is %TRUE and the #GtkSettings:gtk-tooltip-timeout
has expired with the cursor hovering "above" @widget; or emitted when @widget got
focus in keyboard mode.
Using the given coordinates, the signal handler should determine
whether a tooltip should be shown for @widget. If this is the case
%TRUE should be returned, %FALSE otherwise. Note that if
@keyboard_mode is %TRUE, the values of @x and @y are undefined and
should not be used.
The signal handler is free to manipulate @tooltip with the therefore
destined function calls.
%TRUE if @tooltip should be shown right now, %FALSE otherwise.
the x coordinate of the cursor position where the request has
been emitted, relative to @widget->window
the y coordinate of the cursor position where the request has
been emitted, relative to @widget->window
%TRUE if the tooltip was trigged using the keyboard
a #GtkTooltip
The ::screen-changed signal gets emitted when the
screen of a widget has changed.
the previous screen, or %NULL if the
widget was not associated with a screen before
The ::scroll-event signal is emitted when a button in the 4 to 7
range is pressed. Wheel mice are usually configured to generate
button press events for buttons 4 and 5 when the wheel is turned.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_BUTTON_PRESS_MASK mask.
This signal will be sent to the grab widget if there is one.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventScroll which triggered
this signal.
The ::selection-clear-event signal will be emitted when the
the @widget's window has lost ownership of a selection.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventSelection which triggered
this signal.
%TRUE to stop other handlers from being invoked for the event. %FALSE to propagate the event further.
The ::selection-request-event signal will be emitted when
another client requests ownership of the selection owned by
the @widget's window.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventSelection which triggered
this signal.
The ::state-changed signal is emitted when the widget state changes.
See gtk_widget_get_state().
the previous state
The ::style-set signal is emitted when a new style has been set
on a widget. Note that style-modifying functions like
gtk_widget_modify_base() also cause this signal to be emitted.
the previous style, or %NULL if the widget
just got its initial style
The ::unmap-event signal will be emitted when the @widget's window is
unmapped. A window is unmapped when it becomes invisible on the screen.
To receive this signal, the #GdkWindow associated to the widget needs
to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask
automatically for all new windows.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventAny which triggered this signal
The ::visibility-notify-event will be emitted when the @widget's window
is obscured or unobscured.
To receive this signal the #GdkWindow associated to the widget needs
to enable the #GDK_VISIBILITY_NOTIFY_MASK mask.
%TRUE to stop other handlers from being invoked for the event.
%FALSE to propagate the event further.
the #GdkEventVisibility which
triggered this signal.
The ::window-state-event will be emitted when the state of the
toplevel window associated to the @widget changes.
To receive this signal the #GdkWindow associated to the widget
needs to enable the #GDK_STRUCTURE_MASK mask. GDK will enable
this mask automatically for all new windows.
%TRUE to stop other handlers from being invoked for the
event. %FALSE to propagate the event further.
the #GdkEventWindowState which
triggered this signal.
<structfield>activate_signal</structfield>
The signal to emit when a widget of this class is activated,
gtk_widget_activate() handles the emission. Implementation of this
signal is optional.
<structfield>set_scroll_adjustment_signal</structfield>
This signal is emitted when a widget of this class is added
to a scrolling aware parent, gtk_widget_set_scroll_adjustments()
handles the emission.
Implementation of this signal is optional.
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkWidget
a #GtkRequisition to be filled in
a #GtkWidget
position and size to be allocated to @widget
a #GtkWidget
%TRUE if the signal has been handled
a #GtkWidget
%TRUE if there are other widgets with the same mnemonic
a #GtkWidget
return from the event signal emission (%TRUE if
the event was handled)
a #GtkWidget
a #GdkEvent
the #AtkObject associated with @widget
a #GtkWidget
%TRUE if the accelerator can be activated.
a #GtkWidget
the ID of a signal installed on @widget
Finds a style property of a widget class by name.
the #GParamSpec of the style property or
%NULL if @class has no style property with that name.
a #GtkWidgetClass
the name of the style property to find
Installs a style property on a widget class. The parser for the
style property is determined by the value type of @pspec.
a #GtkWidgetClass
the #GParamSpec for the property
Installs a style property on a widget class.
a #GtkWidgetClass
the #GParamSpec for the style property
the parser for the style property
Returns all style properties of a widget class.
an newly
allocated array of #GParamSpec*. The array must be freed with
g_free().
a #GtkWidgetClass
location to return the number of style properties found
Tells about certain properties of the widget.
widgets without a real parent, as there are #GtkWindow<!-- -->s and
#GtkMenu<!-- -->s have this flag set throughout their lifetime.
Toplevel widgets always contain their own #GdkWindow.
Indicative for a widget that does not provide its own #GdkWindow.
Visible action (e.g. drawing) is performed on the parent's #GdkWindow.
Set by gtk_widget_realize(), unset by gtk_widget_unrealize().
A realized widget has an associated #GdkWindow.
Set by gtk_widget_map(), unset by gtk_widget_unmap().
Only realized widgets can be mapped. It means that gdk_window_show()
has been called on the widgets window(s).
Set by gtk_widget_show(), unset by gtk_widget_hide(). Implies that a
widget will be mapped as soon as its parent is mapped.
Set and unset by gtk_widget_set_sensitive().
The sensitivity of a widget determines whether it will receive
certain events (e.g. button or key presses). One premise for
the widget's sensitivity is to have this flag set.
Set and unset by gtk_widget_set_sensitive() operations on the
parents of the widget.
This is the second premise for the widget's sensitivity. Once
it has %GTK_SENSITIVE and %GTK_PARENT_SENSITIVE set, its state is
effectively sensitive. This is expressed (and can be examined) by
the #GTK_WIDGET_IS_SENSITIVE macro.
Determines whether a widget is able to handle focus grabs.
Set by gtk_widget_grab_focus() for widgets that also
have %GTK_CAN_FOCUS set. The flag will be unset once another widget
grabs the focus.
The widget is allowed to receive the default action via
gtk_widget_grab_default() and will reserve space to draw the default if possible
The widget currently is receiving the default action and
should be drawn appropriately if possible
Set by gtk_grab_add(), unset by gtk_grab_remove(). It means that the
widget is in the grab_widgets stack, and will be the preferred one for
receiving events other than ones of cosmetic value.
Indicates that the widget's style has been looked up through the rc
mechanism. It does not imply that the widget actually had a style
defined through the rc mechanism.
Indicates that the widget is a composite child of its parent; see
gtk_widget_push_composite_child(), gtk_widget_pop_composite_child().
Unused since before GTK+ 1.2, will be removed in a future version.
Set and unset by gtk_widget_set_app_paintable().
Must be set on widgets whose window the application directly draws on,
in order to keep GTK+ from overwriting the drawn stuff. See
<xref linkend="app-paintable-widgets"/> for a detailed
description of this flag.
The widget when focused will receive the default action and have
%GTK_HAS_DEFAULT set even if there is a different widget set as default.
Set and unset by gtk_widget_set_double_buffered().
Indicates that exposes done on the widget should be
double-buffered. See <xref linkend="double-buffering"/> for a
detailed discussion of how double-buffering works in GTK+ and
why you may want to disable it for special cases.
Creates a new #GtkWindow, which is a toplevel window that can
contain other widgets. Nearly always, the type of the window should
be #GTK_WINDOW_TOPLEVEL. If you're implementing something like a
popup menu from scratch (which is a bad idea, just use #GtkMenu),
you might use #GTK_WINDOW_POPUP. #GTK_WINDOW_POPUP is not for
dialogs, though in some other toolkits dialogs are called "popups".
In GTK+, #GTK_WINDOW_POPUP means a pop-up menu or pop-up tooltip.
On X11, popup windows are not controlled by the <link
linkend="gtk-X11-arch">window manager</link>.
If you simply want an undecorated window (no window borders), use
gtk_window_set_decorated(), don't use #GTK_WINDOW_POPUP.
a new #GtkWindow.
type of window
Gets the value set by gtk_window_set_default_icon_list().
The list is a copy and should be freed with g_list_free(),
but the pixbufs in the list have not had their reference count
incremented.
copy of default icon list
Returns the fallback icon name for windows that has been set
with gtk_window_set_default_icon_name(). The returned
string is owned by GTK+ and should not be modified. It
is only valid until the next call to
gtk_window_set_default_icon_name().
the fallback icon name for windows
Returns a list of all existing toplevel windows. 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 <emphasis>must</emphasis> call
<literal>g_list_foreach (result, (GFunc)g_object_ref, NULL)</literal> first, and
then unref all the widgets afterwards.
list of toplevel widgets
By default, after showing the first #GtkWindow, GTK+ calls
gdk_notify_startup_complete(). Call this function to disable
the automatic startup notification. You might do this if your
first window is a splash screen, and you want to delay notification
until after your real main window has been shown, for example.
In that example, you would disable startup notification
temporarily, show your splash screen, then re-enable it so that
showing the main window would automatically result in notification.
%TRUE to automatically do startup notification
Sets an icon to be used as fallback for windows that haven't
had gtk_window_set_icon() called on them from a pixbuf.
the icon
Sets an icon to be used as fallback for windows that haven't
had gtk_window_set_icon_list() called on them from a file
on disk. Warns on failure if @err is %NULL.
%TRUE if setting the icon succeeded.
location of icon file
Sets an icon list to be used as fallback for windows that haven't
had gtk_window_set_icon_list() called on them to set up a
window-specific icon list. This function allows you to set up the
icon for all windows in your app at once.
See gtk_window_set_icon_list() for more details.
a list of #GdkPixbuf
Sets an icon to be used as fallback for windows that haven't
had gtk_window_set_icon_list() called on them from a named
themed icon, see gtk_window_set_icon_name().
the name of the themed icon
If @focus is not the current focus widget, and is focusable, sets
it as the focus widget for the window. If @focus is %NULL, unsets
the focus widget for this window. To set the focus to a particular
widget in the toplevel, it is usually more convenient to use
gtk_widget_grab_focus() instead of this function.
a #GtkWindow
widget to be the new focus widget, or %NULL to unset
any focus widget for the toplevel window.
Activates the default widget for the window, unless the current
focused widget has been configured to receive the default action
(see gtk_widget_set_receives_default()), in which case the
focused widget is activated.
%TRUE if a widget got activated.
a #GtkWindow
Activates the current focused widget within the window.
%TRUE if a widget got activated.
a #GtkWindow
Activates mnemonics and accelerators for this #GtkWindow. This is normally
called by the default ::key_press_event handler for toplevel windows,
however in some cases it may be useful to call this directly when
overriding the standard key handling for a toplevel window.
%TRUE if a mnemonic or accelerator was found and activated.
a #GtkWindow
a #GdkEventKey
Associate @accel_group with @window, such that calling
gtk_accel_groups_activate() on @window will activate accelerators
in @accel_group.
window to attach accelerator group to
a #GtkAccelGroup
Adds a mnemonic to this window.
a #GtkWindow
the mnemonic
the widget that gets activated by the mnemonic
Starts moving a window. This function is used if an application has
window movement grips. When GDK can support it, the window movement
will be done using the standard mechanism for the <link
linkend="gtk-X11-arch">window manager</link> or windowing
system. Otherwise, GDK will try to emulate window movement,
potentially not all that well, depending on the windowing system.
a #GtkWindow
mouse button that initiated the drag
X position where the user clicked to initiate the drag, in root window coordinates
Y position where the user clicked to initiate the drag
timestamp from the click event that initiated the drag
Starts resizing a window. This function is used if an application
has window resizing controls. When GDK can support it, the resize
will be done using the standard mechanism for the <link
linkend="gtk-X11-arch">window manager</link> or windowing
system. Otherwise, GDK will try to emulate window resizing,
potentially not all that well, depending on the windowing system.
a #GtkWindow
position of the resize control
mouse button that initiated the drag
X position where the user clicked to initiate the drag, in root window coordinates
Y position where the user clicked to initiate the drag
timestamp from the click event that initiated the drag
Asks to deiconify (i.e. unminimize) the specified @window. Note
that you shouldn't assume the window is definitely deiconified
afterward, because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could iconify it
again before your code which assumes deiconification gets to run.
You can track iconification via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Asks to place @window in the fullscreen state. Note that you
shouldn't assume the window is definitely full screen afterward,
because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could unfullscreen it
again, and not all window managers honor requests to fullscreen
windows. But normally the window will end up fullscreen. Just
don't write code that crashes if not.
You can track the fullscreen state via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Gets the value set by gtk_window_set_accept_focus().
%TRUE if window should receive the input focus
a #GtkWindow
Returns whether the window has been set to have decorations
such as a title bar via gtk_window_set_decorated().
%TRUE if the window has been set to have decorations
a #GtkWindow
Gets the default size of the window. A value of -1 for the width or
height indicates that a default size has not been explicitly set
for that dimension, so the "natural" size of the window will be
used.
a #GtkWindow
location to store the default width, or %NULL
location to store the default height, or %NULL
Returns the default widget for @window. See gtk_window_set_default()
for more details.
the default widget, or %NULL if there is none.
a #GtkWindow
Returns whether the window has been set to have a close button
via gtk_window_set_deletable().
%TRUE if the window has been set to have a close button
a #GtkWindow
Returns whether the window will be destroyed with its transient parent. See
gtk_window_set_destroy_with_parent ().
%TRUE if the window will be destroyed with its transient parent.
a #GtkWindow
Retrieves the current focused widget within the window.
Note that this is the widget that would have the focus
if the toplevel window focused; if the toplevel window
is not focused then <literal>gtk_widget_has_focus (widget)</literal> will
not be %TRUE for the widget.
the currently focused widget, or %NULL if there is none.
a #GtkWindow
Gets the value set by gtk_window_set_focus_on_map().
%TRUE if window should receive the input focus when
mapped.
a #GtkWindow
(Note: this is a special-purpose function intended for the
framebuffer port; see gtk_window_set_has_frame(). It will not
return the size of the window border drawn by the <link
linkend="gtk-X11-arch">window manager</link>, which is the normal
case when using a windowing system. See
gdk_window_get_frame_extents() to get the standard window border
extents.)
Retrieves the dimensions of the frame window for this toplevel.
See gtk_window_set_has_frame(), gtk_window_set_frame_dimensions().
This function will be removed in GTK+ 3
a #GtkWindow
location to store the width of the frame at the left, or %NULL
location to store the height of the frame at the top, or %NULL
location to store the width of the frame at the returns, or %NULL
location to store the height of the frame at the bottom, or %NULL
Gets the value set by gtk_window_set_gravity().
window gravity
a #GtkWindow
Returns the group for @window or the default group, if
@window is %NULL or if @window does not have an explicit
window group.
the #GtkWindowGroup for a window or the default group
a #GtkWindow, or %NULL
Accessor for whether the window has a frame window exterior to
@window->window. Gets the value set by gtk_window_set_has_frame ().
This function will be removed in GTK+ 3
%TRUE if a frame has been added to the window
via gtk_window_set_has_frame().
a #GtkWindow
Gets the value set by gtk_window_set_icon() (or if you've
called gtk_window_set_icon_list(), gets the first icon in
the icon list).
icon for window
a #GtkWindow
Retrieves the list of icons set by gtk_window_set_icon_list().
The list is copied, but the reference count on each
member won't be incremented.
copy of window's icon list
a #GtkWindow
Returns the name of the themed icon for the window,
see gtk_window_set_icon_name().
the icon name or %NULL if the window has
no themed icon
a #GtkWindow
Returns the mnemonic modifier for this window. See
gtk_window_set_mnemonic_modifier().
the modifier mask used to activate
mnemonics on this window.
a #GtkWindow
Returns whether the window is modal. See gtk_window_set_modal().
%TRUE if the window is set to be modal and
establishes a grab when shown
a #GtkWindow
Fetches the requested opacity for this window. See
gtk_window_set_opacity().
the requested opacity for this window.
a #GtkWindow
This function returns the position you need to pass to
gtk_window_move() to keep @window in its current position. This
means that the meaning of the returned value varies with window
gravity. See gtk_window_move() for more details.
If you haven't changed the window gravity, its gravity will be
#GDK_GRAVITY_NORTH_WEST. This means that gtk_window_get_position()
gets the position of the top-left corner of the window manager
frame for the window. gtk_window_move() sets the position of this
same top-left corner.
gtk_window_get_position() is not 100% reliable because the X Window System
does not specify a way to obtain the geometry of the
decorations placed on a window by the window manager.
Thus GTK+ is using a "best guess" that works with most
window managers.
Moreover, nearly all window managers are historically broken with
respect to their handling of window gravity. So moving a window to
its current position as returned by gtk_window_get_position() tends
to result in moving the window slightly. Window managers are
slowly getting better over time.
If a window has gravity #GDK_GRAVITY_STATIC the window manager
frame is not relevant, and thus gtk_window_get_position() will
always produce accurate results. However you can't use static
gravity to do things like place a window in a corner of the screen,
because static gravity ignores the window manager decorations.
If you are saving and restoring your application's window
positions, you should know that it's impossible for applications to
do this without getting it somewhat wrong because applications do
not have sufficient knowledge of window manager state. The Correct
Mechanism is to support the session management protocol (see the
"GnomeClient" object in the GNOME libraries for example) and allow
the window manager to save your window sizes and positions.
a #GtkWindow
return location for X coordinate of gravity-determined reference point
return location for Y coordinate of gravity-determined reference point
Gets the value set by gtk_window_set_resizable().
%TRUE if the user can resize the window
a #GtkWindow
Returns the role of the window. See gtk_window_set_role() for
further explanation.
the role of the window if set, or %NULL. The
returned is owned by the widget and must not be modified
or freed.
a #GtkWindow
Returns the #GdkScreen associated with @window.
a #GdkScreen.
a #GtkWindow.
Obtains the current size of @window. If @window is not onscreen,
it returns the size GTK+ will suggest to the <link
linkend="gtk-X11-arch">window manager</link> for the initial window
size (but this is not reliably the same as the size the window
manager will actually select). The size obtained by
gtk_window_get_size() is the last size received in a
#GdkEventConfigure, that is, GTK+ uses its locally-stored size,
rather than querying the X server for the size. As a result, if you
call gtk_window_resize() then immediately call
gtk_window_get_size(), the size won't have taken effect yet. After
the window manager processes the resize request, GTK+ receives
notification that the size has changed via a configure event, and
the size of the window gets updated.
Note 1: Nearly any use of this function creates a race condition,
because the size of the window may change between the time that you
get the size and the time that you perform some action assuming
that size is the current size. To avoid race conditions, connect to
"configure-event" on the window and adjust your size-dependent
state to match the size delivered in the #GdkEventConfigure.
Note 2: The returned size does <emphasis>not</emphasis> include the
size of the window manager decorations (aka the window frame or
border). Those are not drawn by GTK+ and GTK+ has no reliable
method of determining their size.
Note 3: If you are getting a window size in order to position
the window onscreen, there may be a better way. The preferred
way is to simply set the window's semantic type with
gtk_window_set_type_hint(), which allows the window manager to
e.g. center dialogs. Also, if you set the transient parent of
dialogs with gtk_window_set_transient_for() window managers
will often center the dialog over its parent window. It's
much preferred to let the window manager handle these
things rather than doing it yourself, because all apps will
behave consistently and according to user prefs if the window
manager handles it. Also, the window manager can take the size
of the window decorations/border into account, while your
application cannot.
In any case, if you insist on application-specified window
positioning, there's <emphasis>still</emphasis> a better way than
doing it yourself - gtk_window_set_position() will frequently
handle the details for you.
a #GtkWindow
return location for width, or %NULL
return location for height, or %NULL
Gets the value set by gtk_window_set_skip_pager_hint().
%TRUE if window shouldn't be in pager
a #GtkWindow
Gets the value set by gtk_window_set_skip_taskbar_hint()
%TRUE if window shouldn't be in taskbar
a #GtkWindow
Retrieves the title of the window. See gtk_window_set_title().
the title of the window, or %NULL if none has
been set explicitely. The returned string is owned by the widget
and must not be modified or freed.
a #GtkWindow
Fetches the transient parent for this window. See
gtk_window_set_transient_for().
the transient parent for this window, or %NULL
if no transient parent has been set.
a #GtkWindow
Gets the type hint for this window. See gtk_window_set_type_hint().
the type hint for @window.
a #GtkWindow
Gets the value set by gtk_window_set_urgency_hint()
%TRUE if window is urgent
a #GtkWindow
Gets the type of the window. See #GtkWindowType.
the type of the window
a #GtkWindow
Returns whether @window has an explicit window group.
%TRUE if @window has an explicit window group.
Since 2.22
a #GtkWindow
Returns whether the input focus is within this GtkWindow.
For real toplevel windows, this is identical to gtk_window_is_active(),
but for embedded windows, like #GtkPlug, the results will differ.
%TRUE if the input focus is within this GtkWindow
a #GtkWindow
Asks to iconify (i.e. minimize) the specified @window. Note that
you shouldn't assume the window is definitely iconified afterward,
because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could deiconify it
again, or there may not be a window manager in which case
iconification isn't possible, etc. But normally the window will end
up iconified. Just don't write code that crashes if not.
It's permitted to call this function before showing a window,
in which case the window will be iconified before it ever appears
onscreen.
You can track iconification via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Returns whether the window is part of the current active toplevel.
(That is, the toplevel window receiving keystrokes.)
The return value is %TRUE if the window is active toplevel
itself, but also if it is, say, a #GtkPlug embedded in the active toplevel.
You might use this function if you wanted to draw a widget
differently in an active window from a widget in an inactive window.
See gtk_window_has_toplevel_focus()
%TRUE if the window part of the current active window.
a #GtkWindow
Asks to maximize @window, so that it becomes full-screen. Note that
you shouldn't assume the window is definitely maximized afterward,
because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could unmaximize it
again, and not all window managers support maximization. But
normally the window will end up maximized. Just don't write code
that crashes if not.
It's permitted to call this function before showing a window,
in which case the window will be maximized when it appears onscreen
initially.
You can track maximization via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Activates the targets associated with the mnemonic.
%TRUE if the activation is done.
a #GtkWindow
the mnemonic
the modifiers
Asks the <link linkend="gtk-X11-arch">window manager</link> to move
@window to the given position. Window managers are free to ignore
this; most window managers ignore requests for initial window
positions (instead using a user-defined placement algorithm) and
honor requests after the window has already been shown.
Note: the position is the position of the gravity-determined
reference point for the window. The gravity determines two things:
first, the location of the reference point in root window
coordinates; and second, which point on the window is positioned at
the reference point.
By default the gravity is #GDK_GRAVITY_NORTH_WEST, so the reference
point is simply the @x, @y supplied to gtk_window_move(). The
top-left corner of the window decorations (aka window frame or
border) will be placed at @x, @y. Therefore, to position a window
at the top left of the screen, you want to use the default gravity
(which is #GDK_GRAVITY_NORTH_WEST) and move the window to 0,0.
To position a window at the bottom right corner of the screen, you
would set #GDK_GRAVITY_SOUTH_EAST, which means that the reference
point is at @x + the window width and @y + the window height, and
the bottom-right corner of the window border will be placed at that
reference point. So, to place a window in the bottom right corner
you would first set gravity to south east, then write:
<literal>gtk_window_move (window, gdk_screen_width () - window_width,
gdk_screen_height () - window_height)</literal> (note that this
example does not take multi-head scenarios into account).
The Extended Window Manager Hints specification at <ulink
url="http://www.freedesktop.org/Standards/wm-spec">
http://www.freedesktop.org/Standards/wm-spec</ulink> has a
nice table of gravities in the "implementation notes" section.
The gtk_window_get_position() documentation may also be relevant.
a #GtkWindow
X coordinate to move window to
Y coordinate to move window to
Parses a standard X Window System geometry string - see the
manual page for X (type 'man X') for details on this.
gtk_window_parse_geometry() does work on all GTK+ ports
including Win32 but is primarily intended for an X environment.
If either a size or a position can be extracted from the
geometry string, gtk_window_parse_geometry() returns %TRUE
and calls gtk_window_set_default_size() and/or gtk_window_move()
to resize/move the window.
If gtk_window_parse_geometry() returns %TRUE, it will also
set the #GDK_HINT_USER_POS and/or #GDK_HINT_USER_SIZE hints
indicating to the window manager that the size/position of
the window was user-specified. This causes most window
managers to honor the geometry.
Note that for gtk_window_parse_geometry() to work as expected, it has
to be called when the window has its "final" size, i.e. after calling
gtk_widget_show_all() on the contents and gtk_window_set_geometry_hints()
on the window.
|[
#include <gtk/gtk.h>
static void
fill_with_content (GtkWidget *vbox)
{
/* fill with content... */
}
int
main (int argc, char *argv[])
{
GtkWidget *window, *vbox;
GdkGeometry size_hints = {
100, 50, 0, 0, 100, 50, 10, 10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
};
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
fill_with_content (vbox);
gtk_widget_show_all (vbox);
gtk_window_set_geometry_hints (GTK_WINDOW (window),
window,
&size_hints,
GDK_HINT_MIN_SIZE |
GDK_HINT_BASE_SIZE |
GDK_HINT_RESIZE_INC);
if (argc > 1)
{
if (!gtk_window_parse_geometry (GTK_WINDOW (window), argv[1]))
fprintf (stderr, "Failed to parse '%s'\n", argv[1]);
}
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
]|
%TRUE if string was parsed successfully
a #GtkWindow
geometry string
Presents a window to the user. This may mean raising the window
in the stacking order, deiconifying it, moving it to the current
desktop, and/or giving it the keyboard focus, possibly dependent
on the user's platform, window manager, and preferences.
If @window is hidden, this function calls gtk_widget_show()
as well.
This function should be used when the user tries to open a window
that's already open. Say for example the preferences dialog is
currently open, and the user chooses Preferences from the menu
a second time; use gtk_window_present() to move the already-open dialog
where the user can see it.
If you are calling this function in response to a user interaction,
it is preferable to use gtk_window_present_with_time().
a #GtkWindow
Presents a window to the user in response to a user interaction.
If you need to present a window without a timestamp, use
gtk_window_present(). See gtk_window_present() for details.
a #GtkWindow
the timestamp of the user interaction (typically a
button or key press event) which triggered this call
Propagate a key press or release event to the focus widget and
up the focus container chain until a widget handles @event.
This is normally called by the default ::key_press_event and
::key_release_event handlers for toplevel windows,
however in some cases it may be useful to call this directly when
overriding the standard key handling for a toplevel window.
%TRUE if a widget in the focus chain handled the event.
a #GtkWindow
a #GdkEventKey
Reverses the effects of gtk_window_add_accel_group().
a #GtkWindow
a #GtkAccelGroup
Removes a mnemonic from this window.
a #GtkWindow
the mnemonic
the widget that gets activated by the mnemonic
Hides @window, then reshows it, resetting the
default size and position of the window. Used
by GUI builders only.
a #GtkWindow
Resizes the window as if the user had done so, obeying geometry
constraints. The default geometry constraint is that windows may
not be smaller than their size request; to override this
constraint, call gtk_widget_set_size_request() to set the window's
request to a smaller value.
If gtk_window_resize() is called before showing a window for the
first time, it overrides any default size set with
gtk_window_set_default_size().
Windows may not be resized smaller than 1 by 1 pixels.
a #GtkWindow
width in pixels to resize the window to
height in pixels to resize the window to
Windows may set a hint asking the desktop environment not to receive
the input focus. This function sets this hint.
a #GtkWindow
%TRUE to let this window receive input focus
By default, windows are decorated with a title bar, resize
controls, etc. Some <link linkend="gtk-X11-arch">window
managers</link> allow GTK+ to disable these decorations, creating a
borderless window. If you set the decorated property to %FALSE
using this function, GTK+ will do its best to convince the window
manager not to decorate the window. Depending on the system, this
function may not have any effect when called on a window that is
already visible, so you should call it before calling gtk_window_show().
On Windows, this function always works, since there's no window manager
policy involved.
a #GtkWindow
%TRUE to decorate the window
The default widget is the widget that's activated when the user
presses Enter in a dialog (for example). This function sets or
unsets the default widget for a #GtkWindow about. When setting
(rather than unsetting) the default widget it's generally easier to
call gtk_widget_grab_focus() on the widget. Before making a widget
the default widget, you must set the #GTK_CAN_DEFAULT flag on the
widget you'd like to make the default using GTK_WIDGET_SET_FLAGS().
a #GtkWindow
widget to be the default, or %NULL to unset the
default widget for the toplevel.
Sets the default size of a window. If the window's "natural" size
(its size request) is larger than the default, the default will be
ignored. More generally, if the default size does not obey the
geometry hints for the window (gtk_window_set_geometry_hints() can
be used to set these explicitly), the default size will be clamped
to the nearest permitted size.
Unlike gtk_widget_set_size_request(), which sets a size request for
a widget and thus would keep users from shrinking the window, this
function only sets the initial size, just as if the user had
resized the window themselves. Users can still shrink the window
again as they normally would. Setting a default size of -1 means to
use the "natural" default size (the size request of the window).
For more control over a window's initial size and how resizing works,
investigate gtk_window_set_geometry_hints().
For some uses, gtk_window_resize() is a more appropriate function.
gtk_window_resize() changes the current size of the window, rather
than the size to be used on initial display. gtk_window_resize() always
affects the window itself, not the geometry widget.
The default size of a window only affects the first time a window is
shown; if a window is hidden and re-shown, it will remember the size
it had prior to hiding, rather than using the default size.
Windows can't actually be 0x0 in size, they must be at least 1x1, but
passing 0 for @width and @height is OK, resulting in a 1x1 default size.
a #GtkWindow
width in pixels, or -1 to unset the default width
height in pixels, or -1 to unset the default height
By default, windows have a close button in the window frame. Some
<link linkend="gtk-X11-arch">window managers</link> allow GTK+ to
disable this button. If you set the deletable property to %FALSE
using this function, GTK+ will do its best to convince the window
manager not to show a close button. Depending on the system, this
function may not have any effect when called on a window that is
already visible, so you should call it before calling gtk_window_show().
On Windows, this function always works, since there's no window manager
policy involved.
a #GtkWindow
%TRUE to decorate the window as deletable
If @setting is %TRUE, then destroying the transient parent of @window
will also destroy @window itself. This is useful for dialogs that
shouldn't persist beyond the lifetime of the main window they're
associated with, for example.
a #GtkWindow
whether to destroy @window with its transient parent
If @focus is not the current focus widget, and is focusable, sets
it as the focus widget for the window. If @focus is %NULL, unsets
the focus widget for this window. To set the focus to a particular
widget in the toplevel, it is usually more convenient to use
gtk_widget_grab_focus() instead of this function.
a #GtkWindow
widget to be the new focus widget, or %NULL to unset
any focus widget for the toplevel window.
Windows may set a hint asking the desktop environment not to receive
the input focus when the window is mapped. This function sets this
hint.
a #GtkWindow
%TRUE to let this window receive input focus on map
(Note: this is a special-purpose function intended for the framebuffer
port; see gtk_window_set_has_frame(). It will have no effect on the
window border drawn by the window manager, which is the normal
case when using the X Window system.)
For windows with frames (see gtk_window_set_has_frame()) this function
can be used to change the size of the frame border.
This function will be removed in GTK+ 3
a #GtkWindow that has a frame
The width of the left border
The height of the top border
The width of the right border
The height of the bottom border
This function sets up hints about how a window can be resized by
the user. You can set a minimum and maximum size; allowed resize
increments (e.g. for xterm, you can only resize by the size of a
character); aspect ratios; and more. See the #GdkGeometry struct.
a #GtkWindow
widget the geometry hints will be applied to
struct containing geometry information
mask indicating which struct fields should be paid attention to
Window gravity defines the meaning of coordinates passed to
gtk_window_move(). See gtk_window_move() and #GdkGravity for
more details.
The default window gravity is #GDK_GRAVITY_NORTH_WEST which will
typically "do what you mean."
a #GtkWindow
window gravity
(Note: this is a special-purpose function for the framebuffer port,
that causes GTK+ to draw its own window border. For most applications,
you want gtk_window_set_decorated() instead, which tells the window
manager whether to draw the window border.)
If this function is called on a window with setting of %TRUE, before
it is realized or showed, it will have a "frame" window around
@window->window, accessible in @window->frame. Using the signal
frame_event you can receive all events targeted at the frame.
This function is used by the linux-fb port to implement managed
windows, but it could conceivably be used by X-programs that
want to do their own window decorations.
This function will be removed in GTK+ 3
a #GtkWindow
a boolean
Sets up the icon representing a #GtkWindow. This icon is used when
the window is minimized (also known as iconified). Some window
managers or desktop environments may also place it in the window
frame, or display it in other contexts.
The icon should be provided in whatever size it was naturally
drawn; that is, don't scale the image before passing it to
GTK+. Scaling is postponed until the last minute, when the desired
final size is known, to allow best quality.
If you have your icon hand-drawn in multiple sizes, use
gtk_window_set_icon_list(). Then the best size will be used.
This function is equivalent to calling gtk_window_set_icon_list()
with a 1-element list.
See also gtk_window_set_default_icon_list() to set the icon
for all windows in your application in one go.
a #GtkWindow
icon image, or %NULL
Sets the icon for @window.
Warns on failure if @err is %NULL.
This function is equivalent to calling gtk_window_set_icon()
with a pixbuf created by loading the image from @filename.
%TRUE if setting the icon succeeded.
a #GtkWindow
location of icon file
Sets up the icon representing a #GtkWindow. The icon is used when
the window is minimized (also known as iconified). Some window
managers or desktop environments may also place it in the window
frame, or display it in other contexts.
gtk_window_set_icon_list() allows you to pass in the same icon in
several hand-drawn sizes. The list should contain the natural sizes
your icon is available in; that is, don't scale the image before
passing it to GTK+. Scaling is postponed until the last minute,
when the desired final size is known, to allow best quality.
By passing several sizes, you may improve the final image quality
of the icon, by reducing or eliminating automatic image scaling.
Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and
larger images (64x64, 128x128) if you have them.
See also gtk_window_set_default_icon_list() to set the icon
for all windows in your application in one go.
Note that transient windows (those who have been set transient for another
window using gtk_window_set_transient_for()) will inherit their
icon from their transient parent. So there's no need to explicitly
set the icon on transient windows.
a #GtkWindow
list of #GdkPixbuf
Sets the icon for the window from a named themed icon. See
the docs for #GtkIconTheme for more details.
Note that this has nothing to do with the WM_ICON_NAME
property which is mentioned in the ICCCM.
a #GtkWindow
the name of the themed icon
Asks to keep @window above, so that it stays on top. Note that
you shouldn't assume the window is definitely above afterward,
because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could not keep it above,
and not all window managers support keeping windows above. But
normally the window will end kept above. Just don't write code
that crashes if not.
It's permitted to call this function before showing a window,
in which case the window will be kept above when it appears onscreen
initially.
You can track the above state via the "window-state-event" signal
on #GtkWidget.
Note that, according to the <ulink
url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
Manager Hints</ulink> specification, the above state is mainly meant
for user preferences and should not be used by applications e.g. for
drawing attention to their dialogs.
a #GtkWindow
whether to keep @window above other windows
Asks to keep @window below, so that it stays in bottom. Note that
you shouldn't assume the window is definitely below afterward,
because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could not keep it below,
and not all window managers support putting windows below. But
normally the window will be kept below. Just don't write code
that crashes if not.
It's permitted to call this function before showing a window,
in which case the window will be kept below when it appears onscreen
initially.
You can track the below state via the "window-state-event" signal
on #GtkWidget.
Note that, according to the <ulink
url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
Manager Hints</ulink> specification, the above state is mainly meant
for user preferences and should not be used by applications e.g. for
drawing attention to their dialogs.
a #GtkWindow
whether to keep @window below other windows
Sets the mnemonic modifier for this window.
a #GtkWindow
the modifier mask used to activate
mnemonics on this window.
Sets the #GtkWindow:mnemonics-visible property.
a #GtkWindow
the new value
Sets a window modal or non-modal. Modal windows prevent interaction
with other windows in the same application. To keep modal dialogs
on top of main application windows, use
gtk_window_set_transient_for() to make the dialog transient for the
parent; most <link linkend="gtk-X11-arch">window managers</link>
will then disallow lowering the dialog below the parent.
a #GtkWindow
whether the window is modal
Request the windowing system to make @window partially transparent,
with opacity 0 being fully transparent and 1 fully opaque. (Values
of the opacity parameter are clamped to the [0,1] range.) On X11
this has any effect only on X screens with a compositing manager
running. See gtk_widget_is_composited(). On Windows it should work
always.
Note that setting a window's opacity after the window has been
shown causes it to flicker once on Windows.
a #GtkWindow
desired opacity, between 0 and 1
Sets a position constraint for this window. If the old or new
constraint is %GTK_WIN_POS_CENTER_ALWAYS, this will also cause
the window to be repositioned to satisfy the new constraint.
a #GtkWindow.
a position constraint.
Sets whether the user can resize a window. Windows are user resizable
by default.
a #GtkWindow
%TRUE if the user can resize this window
This function is only useful on X11, not with other GTK+ targets.
In combination with the window title, the window role allows a
<link linkend="gtk-X11-arch">window manager</link> to identify "the
same" window when an application is restarted. So for example you
might set the "toolbox" role on your app's toolbox window, so that
when the user restarts their session, the window manager can put
the toolbox back in the same place.
If a window already has a unique title, you don't need to set the
role, since the WM can use the title to identify the window when
restoring the session.
a #GtkWindow
unique identifier for the window to be used when restoring a session
Sets the #GdkScreen where the @window is displayed; if
the window is already mapped, it will be unmapped, and
then remapped on the new screen.
a #GtkWindow.
a #GdkScreen.
Windows may set a hint asking the desktop environment not to display
the window in the pager. This function sets this hint.
(A "pager" is any desktop navigation tool such as a workspace
switcher that displays a thumbnail representation of the windows
on the screen.)
a #GtkWindow
%TRUE to keep this window from appearing in the pager
Windows may set a hint asking the desktop environment not to display
the window in the task bar. This function sets this hint.
a #GtkWindow
%TRUE to keep this window from appearing in the task bar
Startup notification identifiers are used by desktop environment to
track application startup, to provide user feedback and other
features. This function changes the corresponding property on the
underlying GdkWindow. Normally, startup identifier is managed
automatically and you should only use this function in special cases
like transferring focus from other processes. You should use this
function before calling gtk_window_present() or any equivalent
function generating a window map event.
This function is only useful on X11, not with other GTK+ targets.
a #GtkWindow
a string with startup-notification identifier
Sets the title of the #GtkWindow. The title of a window will be
displayed in its title bar; on the X Window System, the title bar
is rendered by the <link linkend="gtk-X11-arch">window
manager</link>, so exactly how the title appears to users may vary
according to a user's exact configuration. The title should help a
user distinguish this window from other windows they may have
open. A good title might include the application name and current
document filename, for example.
a #GtkWindow
title of the window
Dialog windows should be set transient for the main application
window they were spawned from. This allows <link
linkend="gtk-X11-arch">window managers</link> to e.g. keep the
dialog on top of the main window, or center the dialog over the
main window. gtk_dialog_new_with_buttons() and other convenience
functions in GTK+ will sometimes call
gtk_window_set_transient_for() on your behalf.
Passing %NULL for @parent unsets the current transient window.
On Windows, this function puts the child window on top of the parent,
much as the window manager would have done on X.
a #GtkWindow
parent window, or %NULL
By setting the type hint for the window, you allow the window
manager to decorate and handle the window in a way which is
suitable to the function of the window in your application.
This function should be called before the window becomes visible.
gtk_dialog_new_with_buttons() and other convenience functions in GTK+
will sometimes call gtk_window_set_type_hint() on your behalf.
a #GtkWindow
the window type
Windows may set a hint asking the desktop environment to draw
the users attention to the window. This function sets this hint.
a #GtkWindow
%TRUE to mark this window as urgent
Don't use this function. It sets the X Window System "class" and
"name" hints for a window. According to the ICCCM, you should
always set these to the same value for all windows in an
application, and GTK+ sets them to that value by default, so calling
this function is sort of pointless. However, you may want to call
gtk_window_set_role() on each window in your application, for the
benefit of the session manager. Setting the role allows the window
manager to restore window positions when loading a saved session.
a #GtkWindow
window name hint
window class hint
Asks to stick @window, which means that it will appear on all user
desktops. Note that you shouldn't assume the window is definitely
stuck afterward, because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could unstick it
again, and some window managers do not support sticking
windows. But normally the window will end up stuck. Just don't
write code that crashes if not.
It's permitted to call this function before showing a window.
You can track stickiness via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Asks to toggle off the fullscreen state for @window. Note that you
shouldn't assume the window is definitely not full screen
afterward, because other entities (e.g. the user or <link
linkend="gtk-X11-arch">window manager</link>) could fullscreen it
again, and not all window managers honor requests to unfullscreen
windows. But normally the window will end up restored to its normal
state. Just don't write code that crashes if not.
You can track the fullscreen state via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Asks to unmaximize @window. Note that you shouldn't assume the
window is definitely unmaximized afterward, because other entities
(e.g. the user or <link linkend="gtk-X11-arch">window
manager</link>) could maximize it again, and not all window
managers honor requests to unmaximize. But normally the window will
end up unmaximized. Just don't write code that crashes if not.
You can track maximization via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Asks to unstick @window, which means that it will appear on only
one of the user's desktops. Note that you shouldn't assume the
window is definitely unstuck afterward, because other entities
(e.g. the user or <link linkend="gtk-X11-arch">window
manager</link>) could stick it again. But normally the window will
end up stuck. Just don't write code that crashes if not.
You can track stickiness via the "window-state-event" signal
on #GtkWidget.
a #GtkWindow
Whether the window should receive the input focus.
If %TRUE, users can expand the window beyond its minimum size.
Use GtkWindow:resizable property instead.
If %TRUE, the window has no mimimum size. Setting this to %TRUE is
99% of the time a bad idea.
Use GtkWindow:resizable property instead.
Whether the window should be decorated by the window manager.
Whether the window frame should have a close button.
Whether the window should receive the input focus when mapped.
The window gravity of the window. See gtk_window_move() and #GdkGravity for
more details about window gravity.
The :icon-name property specifies the name of the themed icon to
use as the window icon. See #GtkIconTheme for more details.
The requested opacity of the window. See gtk_window_set_opacity() for
more details about window opacity.
The :startup-id is a write-only property for setting window's
startup notification identifier. See gtk_window_set_startup_id()
for more details.
The transient parent of the window. See gtk_window_set_transient_for() for
more details about transient windows.
The ::activate-default signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user activates the default widget
of @window.
The ::activate-focus signal is a
<link linkend="keybinding-signals">keybinding signal</link>
which gets emitted when the user activates the currently
focused widget of @window.
The ::keys-changed signal gets emitted when the set of accelerators
or mnemonics that are associated with @window changes.
a #GtkWindow
widget to be the new focus widget, or %NULL to unset
any focus widget for the toplevel window.
Creates a new #GtkWindowGroup object. Grabs added with
gtk_grab_add() only affect windows within the same #GtkWindowGroup.
a new #GtkWindowGroup.
Adds a window to a #GtkWindowGroup.
a #GtkWindowGroup
the #GtkWindow to add
Returns a list of the #GtkWindows that belong to @window_group.
A newly-allocated list of
windows inside the group.
a #GtkWindowGroup
Removes a window from a #GtkWindowGroup.
a #GtkWindowGroup
the #GtkWindow to remove
Finds the first accelerator in any #GtkAccelGroup attached
to @object that matches @accel_key and @accel_mods, and
activates that accelerator.
%TRUE if an accelerator was activated and handled this keypress
the #GObject, usually a #GtkWindow, on which
to activate the accelerator.
accelerator keyval from a key event
keyboard state mask from a key event
Gets a list of all accel groups which are attached to @object.
a list of all accel groups which are attached to @object
a #GObject, usually a #GtkWindow
Gets the value set by gtk_accelerator_set_default_mod_mask().
the default accelerator modifier mask
Converts an accelerator keyval and modifier mask into a string
which can be used to represent the accelerator to the user.
a newly-allocated string representing the accelerator.
accelerator keyval
accelerator modifier mask
Converts an accelerator keyval and modifier mask
into a string parseable by gtk_accelerator_parse().
For example, if you pass in #GDK_q and #GDK_CONTROL_MASK,
this function returns "<Control>q".
If you need to display accelerators in the user interface,
see gtk_accelerator_get_label().
a newly-allocated accelerator name
accelerator keyval
accelerator modifier mask
Parses a string representing an accelerator. The
format looks like "<Control>a" or "<Shift><Alt>F1" or
"<Release>z" (the last one is for key release).
The parser is fairly liberal and allows lower or upper case,
and also abbreviations such as "<Ctl>" and "<Ctrl>".
Key names are parsed using gdk_keyval_from_name(). For character keys the
name is not the symbol, but the lowercase name, e.g. one would use
"<Ctrl>minus" instead of "<Ctrl>-".
If the parse fails, @accelerator_key and @accelerator_mods will
be set to 0 (zero).
string representing an accelerator
return location for accelerator keyval
return location for accelerator modifier mask
Sets the modifiers that will be considered significant for keyboard
accelerators. The default mod mask is #GDK_CONTROL_MASK |
#GDK_SHIFT_MASK | #GDK_MOD1_MASK | #GDK_SUPER_MASK |
#GDK_HYPER_MASK | #GDK_META_MASK, that is, Control, Shift, Alt,
Super, Hyper and Meta. Other modifiers will by default be ignored
by #GtkAccelGroup.
You must include at least the three modifiers Control, Shift
and Alt in any value you pass to this function.
The default mod mask should be changed on application startup,
before using any accelerator groups.
accelerator modifier mask
Determines whether a given keyval and modifier mask constitute
a valid keyboard accelerator. For example, the #GDK_a keyval
plus #GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator.
But, you can't, for instance, use the #GDK_Control_L keyval
as an accelerator.
%TRUE if the accelerator is valid
a GDK keyval
modifier mask
Returns %TRUE if dialogs are expected to use an alternative
button order on the screen @screen. See
gtk_dialog_set_alternative_button_order() for more details
about alternative button order.
If you need to use this function, you should probably connect
to the ::notify:gtk-alternative-button-order signal on the
#GtkSettings object associated to @screen, in order to be
notified if the button order setting changes.
Whether the alternative button order should be used
a #GdkScreen, or %NULL to use the default screen
Override or install a new key binding for @keyval with @modifiers on
@binding_set.
a #GtkBindingSet to add a signal to
key value
key modifier
signal name to be bound
list of #GtkBindingArg signal arguments
Clears a binding entry.
Use gtk_binding_entry_remove() instead.
binding set to clear an entry of
key value of binding to clear
key modifier of binding to clear
Remove a binding previously installed via
gtk_binding_entry_add_signal() on @binding_set.
a #GtkBindingSet to remove an entry of
key value of binding to remove
key modifier of binding to remove
Install a binding on @binding_set which causes key lookups
to be aborted, to prevent bindings from lower priority sets
to be activated.
a #GtkBindingSet to skip an entry of
key value of binding to skip
key modifier of binding to skip
Parse a binding entry from a gtkrc file.
There should be no need to call this function outside GTK+.
expected token upon errors, %G_TOKEN_NONE on success.
GtkRC scanner
Find a binding set by its globally unique name. The @set_name can
either be a name used for gtk_binding_set_new() or the type name of
a class used in gtk_binding_set_by_class().
%NULL or the specified binding set
unique binding set name
Find a key binding matching @keyval and @modifiers and activate the
binding on @object.
%TRUE if a binding was found and activated
object to activate when binding found
key value of the binding
key modifier of the binding
Looks up key bindings for @object to find one matching
@event, and if one was found, activate it.
%TRUE if a matching key binding was found
a #GtkObject (generally must be a widget)
a #GdkEventKey
Checks that the GTK+ library in use is compatible with the
given version. Generally you would pass in the constants
#GTK_MAJOR_VERSION, #GTK_MINOR_VERSION, #GTK_MICRO_VERSION
as the three arguments to this function; that produces
a check that the library in use is compatible with
the version of GTK+ the application or module was compiled
against.
Compatibility is defined by two things: first the version
of the running library is newer than the version
@required_major.required_minor.@required_micro. Second
the running library must be binary compatible with the
version @required_major.required_minor.@required_micro
(same major version.)
This function is primarily for GTK+ modules; the module
can call this function to check that it wasn't loaded
into an incompatible version of GTK+. However, such a
a check isn't completely reliable, since the module may be
linked against an old version of GTK+ and calling the
old version of gtk_check_version(), but still get loaded
into an application using a newer version of GTK+.
%NULL if the GTK+ library is compatible with the
given version, or a string describing the version mismatch.
The returned string is owned by GTK+ and should not be modified
or freed.
the required major version.
the required minor version.
the required micro version.
Prevents gtk_init(), gtk_init_check(), gtk_init_with_args() and
gtk_parse_args() from automatically
calling <literal>setlocale (LC_ALL, "")</literal>. You would
want to use this function if you wanted to set the locale for
your program to something other than the user's locale, or if
you wanted to set different values for different locale categories.
Most programs should not need to call this function.
Initiates a drag on the source side. The function
only needs to be used when the application is
starting drags itself, and is not needed when
gtk_drag_source_set() is used.
The @event is used to retrieve the timestamp that will be used internally to
grab the pointer. If @event is #NULL, then GDK_CURRENT_TIME will be used.
However, you should try to pass a real event in all cases, since that can be
used by GTK+ to get information about the start position of the drag, for
example if the @event is a GDK_MOTION_NOTIFY.
Generally there are three cases when you want to start a drag by hand by calling
this function:
1. During a button-press-event handler, if you want to start a drag immediately
when the user presses the mouse button. Pass the @event that you have in your
button-press-event handler.
2. During a motion-notify-event handler, if you want to start a drag when the mouse
moves past a certain threshold distance after a button-press. Pass the @event that you
have in your motion-notify-event handler.
3. During a timeout handler, if you want to start a drag after the mouse
button is held down for some time. Try to save the last event that you got
from the mouse, using gdk_event_copy(), and pass it to this function
(remember to free the event with gdk_event_free() when you are done). If you
can really not pass a real event, pass #NULL instead.
the context for this drag.
the source widget.
The targets (data formats) in which the
source can provide the data.
A bitmask of the allowed drag actions for this drag.
The button the user clicked to start the drag.
The event that triggered the start of the drag.
Checks to see if a mouse drag starting at (@start_x, @start_y) and ending
at (@current_x, @current_y) has passed the GTK+ drag threshold, and thus
should trigger the beginning of a drag-and-drop operation.
%TRUE if the drag threshold has been passed.
a #GtkWidget
X coordinate of start of drag
Y coordinate of start of drag
current X coordinate
current Y coordinate
Add the image targets supported by #GtkSelection to
the target list of the drag destination. The targets
are added with @info = 0. If you need another value,
use gtk_target_list_add_image_targets() and
gtk_drag_dest_set_target_list().
a #GtkWidget that's a drag destination
Add the text targets supported by #GtkSelection to
the target list of the drag destination. The targets
are added with @info = 0. If you need another value,
use gtk_target_list_add_text_targets() and
gtk_drag_dest_set_target_list().
a #GtkWidget that's a drag destination
Add the URI targets supported by #GtkSelection to
the target list of the drag destination. The targets
are added with @info = 0. If you need another value,
use gtk_target_list_add_uri_targets() and
gtk_drag_dest_set_target_list().
a #GtkWidget that's a drag destination
first target that the source offers
and the dest can accept, or %GDK_NONE
drag destination widget
drag context
list of droppable targets, or %NULL to use
gtk_drag_dest_get_target_list (@widget).
Looks for a match between the supported targets of @context and the
@dest_target_list, returning the first matching target, otherwise
returning %GDK_NONE. @dest_target_list should usually be the return
value from gtk_drag_dest_get_target_list(), but some widgets may
have different valid targets for different parts of the widget; in
that case, they will have to implement a drag_motion handler that
passes the correct target list to this function.
Returns the list of targets this widget can accept from
drag-and-drop.
the #GtkTargetList, or %NULL if none
a #GtkWidget
Returns whether the widget has been configured to always
emit ::drag-motion signals.
%TRUE if the widget always emits ::drag-motion events
a #GtkWidget that's a drag destination
Sets a widget as a potential drop destination, and adds default behaviors.
The default behaviors listed in @flags have an effect similar
to installing default handlers for the widget's drag-and-drop signals
(#GtkWidget:drag-motion, #GtkWidget:drag-drop, ...). They all exist
for convenience. When passing #GTK_DEST_DEFAULT_ALL for instance it is
sufficient to connect to the widget's #GtkWidget::drag-data-received
signal to get primitive, but consistent drag-and-drop support.
Things become more complicated when you try to preview the dragged data,
as described in the documentation for #GtkWidget:drag-motion. The default
behaviors described by @flags make some assumptions, that can conflict
with your own signal handlers. For instance #GTK_DEST_DEFAULT_DROP causes
invokations of gdk_drag_status() in the context of #GtkWidget:drag-motion,
and invokations of gtk_drag_finish() in #GtkWidget:drag-data-received.
Especially the later is dramatic, when your own #GtkWidget:drag-motion
handler calls gtk_drag_get_data() to inspect the dragged data.
There's no way to set a default action here, you can use the
#GtkWidget:drag-motion callback for that. Here's an example which selects
the action to use depending on whether the control key is pressed or not:
|[
static void
drag_motion (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time)
{
GdkModifierType mask;
gdk_window_get_pointer (gtk_widget_get_window (widget),
NULL, NULL, &mask);
if (mask & GDK_CONTROL_MASK)
gdk_drag_status (context, GDK_ACTION_COPY, time);
else
gdk_drag_status (context, GDK_ACTION_MOVE, time);
}
]|
a #GtkWidget
which types of default drag behavior to use
a pointer to an array of #GtkTargetEntry<!-- -->s
indicating the drop types that this @widget will accept, or %NULL.
Later you can access the list with gtk_drag_dest_get_target_list()
and gtk_drag_dest_find_target().
the number of entries in @targets
a bitmask of possible actions for a drop onto this @widget.
Sets the target types that this widget can accept from drag-and-drop.
The widget must first be made into a drag destination with
gtk_drag_dest_set().
a #GtkWidget that's a drag destination
list of droppable targets, or %NULL for none
Tells the widget to emit ::drag-motion and ::drag-leave
events regardless of the targets and the %GTK_DEST_DEFAULT_MOTION
flag.
This may be used when a widget wants to do generic
actions regardless of the targets that the source offers.
a #GtkWidget that's a drag destination
whether to accept all targets
Determines the source widget for a drag.
if the drag is occurring
within a single application, a pointer to the source widget.
Otherwise, %NULL.
a (destination side) drag context
Changes the default drag icon. GTK+ retains references for the
arguments, and will release them when they are no longer needed.
Change the default drag icon via the stock system by
changing the stock pixbuf for #GTK_STOCK_DND instead.
the colormap of the icon
the image data for the icon
the transparency mask for an image, or %NULL
The X offset within @widget of the hotspot.
The Y offset within @widget of the hotspot.
Sets the icon for a particular drag to the default
icon.
the context for a drag. (This must be called
with a context for the source side of a drag)
Sets the icon for a given drag from a named themed icon. See
the docs for #GtkIconTheme for more details. Note that the
size of the icon depends on the icon theme (the icon is
loaded at the symbolic size #GTK_ICON_SIZE_DND), thus
@hot_x and @hot_y have to be used with care.
the context for a drag. (This must be called
with a context for the source side of a drag)
name of icon to use
the X offset of the hotspot within the icon
the Y offset of the hotspot within the icon
Sets @pixbuf as the icon for a given drag.
the context for a drag. (This must be called
with a context for the source side of a drag)
the #GdkPixbuf to use as the drag icon.
the X offset within @widget of the hotspot.
the Y offset within @widget of the hotspot.
Sets @pixmap as the icon for a given drag. GTK+ retains
references for the arguments, and will release them when
they are no longer needed. In general, gtk_drag_set_icon_pixbuf()
will be more convenient to use.
the context for a drag. (This must be called
with a context for the source side of a drag)
the colormap of the icon
the image data for the icon
the transparency mask for the icon or %NULL for none.
the X offset within @pixmap of the hotspot.
the Y offset within @pixmap of the hotspot.
Sets the icon for a given drag from a stock ID.
the context for a drag. (This must be called
with a context for the source side of a drag)
the ID of the stock icon to use for the drag.
the X offset within the icon of the hotspot.
the Y offset within the icon of the hotspot.
Changes the icon for a widget to a given widget. GTK+
will not destroy the icon, so if you don't want
it to persist, you should connect to the "drag-end"
signal and destroy it yourself.
the context for a drag. (This must be called
with a context for the source side of a drag)
a toplevel window to use as an icon.
the X offset within @widget of the hotspot.
the Y offset within @widget of the hotspot.
Add the writable image targets supported by #GtkSelection to
the target list of the drag source. The targets
are added with @info = 0. If you need another value,
use gtk_target_list_add_image_targets() and
gtk_drag_source_set_target_list().
a #GtkWidget that's is a drag source
Add the text targets supported by #GtkSelection to
the target list of the drag source. The targets
are added with @info = 0. If you need another value,
use gtk_target_list_add_text_targets() and
gtk_drag_source_set_target_list().
a #GtkWidget that's is a drag source
Add the URI targets supported by #GtkSelection to
the target list of the drag source. The targets
are added with @info = 0. If you need another value,
use gtk_target_list_add_uri_targets() and
gtk_drag_source_set_target_list().
a #GtkWidget that's is a drag source
Gets the list of targets this widget can provide for
drag-and-drop.
the #GtkTargetList, or %NULL if none
a #GtkWidget
Sets up a widget so that GTK+ will start a drag operation when the user
clicks and drags on the widget. The widget must have a window.
a #GtkWidget
the bitmask of buttons that can start the drag
the table of targets that the drag will support,
may be %NULL
the number of items in @targets
the bitmask of possible actions for a drag from this widget
Sets the icon that will be used for drags from a particular widget
from a pixmap/mask. GTK+ retains references for the arguments, and
will release them when they are no longer needed.
Use gtk_drag_source_set_icon_pixbuf() instead.
a #GtkWidget
the colormap of the icon
the image data for the icon
the transparency mask for an image.
Sets the icon that will be used for drags from a particular source
to a themed icon. See the docs for #GtkIconTheme for more details.
a #GtkWidget
name of icon to use
Sets the icon that will be used for drags from a particular widget
from a #GdkPixbuf. GTK+ retains a reference for @pixbuf and will
release it when it is no longer needed.
a #GtkWidget
the #GdkPixbuf for the drag icon
Sets the icon that will be used for drags from a particular source
to a stock icon.
a #GtkWidget
the ID of the stock icon to use
Changes the target types that this widget offers for drag-and-drop.
The widget must first be made into a drag source with
gtk_drag_source_set().
a #GtkWidget that's a drag source
list of draggable targets, or %NULL for none
Draws an arrow in the given rectangle on @window using the given
parameters. @arrow_type determines the direction of the arrow.
Use gtk_paint_arrow() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
the type of arrow to draw
%TRUE if the arrow tip should be filled
x origin of the rectangle to draw the arrow in
y origin of the rectangle to draw the arrow in
width of the rectangle to draw the arrow in
height of the rectangle to draw the arrow in
Draws a box on @window with the given parameters.
Use gtk_paint_box() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
x origin of the box
y origin of the box
the width of the box
the height of the box
Draws a box in @window using the given style and state and shadow type,
leaving a gap in one side.
Use gtk_paint_box_gap() instead.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
side in which to leave the gap
starting position of the gap
width of the gap
Draws a check button indicator in the given rectangle on @window with
the given parameters.
Use gtk_paint_check() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
x origin of the rectangle to draw the check in
y origin of the rectangle to draw the check in
the width of the rectangle to draw the check in
the height of the rectangle to draw the check in
Draws a diamond in the given rectangle on @window using the given
parameters.
Use gtk_paint_diamond() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
x origin of the rectangle to draw the diamond in
y origin of the rectangle to draw the diamond in
width of the rectangle to draw the diamond in
height of the rectangle to draw the diamond in
Draws an expander as used in #GtkTreeView.
Use gtk_paint_expander() instead.
a #GtkStyle
a #GdkWindow
a state
the x position to draw the expander at
the y position to draw the expander at
the style to draw the expander in
Draws an extension, i.e. a notebook tab.
Use gtk_paint_extension() instead.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
x origin of the extension
y origin of the extension
width of the extension
width of the extension
the side on to which the extension is attached
Draws a flat box on @window with the given parameters.
Use gtk_paint_flat_box() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
x origin of the box
y origin of the box
the width of the box
the height of the box
Draws a focus indicator around the given rectangle on @window using the
given style.
Use gtk_paint_focus() instead.
a #GtkStyle
a #GdkWindow
the x origin of the rectangle around which to draw a focus indicator
the y origin of the rectangle around which to draw a focus indicator
the width of the rectangle around which to draw a focus indicator
the height of the rectangle around which to draw a focus indicator
Draws a handle as used in #GtkHandleBox and #GtkPaned.
Use gtk_paint_handle() instead.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
x origin of the handle
y origin of the handle
with of the handle
height of the handle
the orientation of the handle
Draws a horizontal line from (@x1, @y) to (@x2, @y) in @window
using the given style and state.
Use gtk_paint_hline() instead.
a #GtkStyle
a #GdkWindow
a state
the starting x coordinate
the ending x coordinate
the y coordinate
Draws a text caret on @drawable at @location. This is not a style function
but merely a convenience function for drawing the standard cursor shape.
a #GtkWidget
a #GdkDrawable
rectangle to which the output is clipped, or %NULL if the
output should not be clipped
location where to draw the cursor (@location->width is ignored)
if the cursor should be the primary cursor color.
whether the cursor is left-to-right or
right-to-left. Should never be #GTK_TEXT_DIR_NONE
%TRUE to draw a directional arrow on the
cursor. Should be %FALSE unless the cursor is split.
Draws a layout on @window using the given parameters.
a #GtkStyle
a #GdkWindow
a state
whether to use the text or foreground
graphics context of @style
x origin
y origin
the layout to draw
Draws a radio button indicator in the given rectangle on @window with
the given parameters.
Use gtk_paint_option() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
x origin of the rectangle to draw the option in
y origin of the rectangle to draw the option in
the width of the rectangle to draw the option in
the height of the rectangle to draw the option in
Draws a polygon on @window with the given parameters.
Use gtk_paint_polygon() instead.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
an array of #GdkPoint<!-- -->s
length of @points
%TRUE if the polygon should be filled
Draws a resize grip in the given rectangle on @window using the given
parameters.
Use gtk_paint_resize_grip() instead.
a #GtkStyle
a #GdkWindow
a state
the edge in which to draw the resize grip
the x origin of the rectangle in which to draw the resize grip
the y origin of the rectangle in which to draw the resize grip
the width of the rectangle in which to draw the resize grip
the height of the rectangle in which to draw the resize grip
Draws a shadow around the given rectangle in @window
using the given style and state and shadow type.
Use gtk_paint_shadow() instead.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
Draws a shadow around the given rectangle in @window
using the given style and state and shadow type, leaving a
gap in one side.
Use gtk_paint_shadow_gap() instead.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
side in which to leave the gap
starting position of the gap
width of the gap
Draws a slider in the given rectangle on @window using the
given style and orientation.
a #GtkStyle
a #GdkWindow
a state
a shadow
the x origin of the rectangle in which to draw a slider
the y origin of the rectangle in which to draw a slider
the width of the rectangle in which to draw a slider
the height of the rectangle in which to draw a slider
the orientation to be used
Draws a text string on @window with the given parameters.
Use gtk_paint_layout() instead.
a #GtkStyle
a #GdkWindow
a state
x origin
y origin
the string to draw
Draws an option menu tab (i.e. the up and down pointing arrows)
in the given rectangle on @window using the given parameters.
Use gtk_paint_tab() instead.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
x origin of the rectangle to draw the tab in
y origin of the rectangle to draw the tab in
the width of the rectangle to draw the tab in
the height of the rectangle to draw the tab in
Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @window
using the given style and state.
Use gtk_paint_vline() instead.
a #GtkStyle
a #GdkWindow
a state
the starting y coordinate
the ending y coordinate
the x coordinate
Registers an error quark for #GtkFileChooser if necessary.
The error quark used for #GtkFileChooser errors.
The functions and objects described here make working with GTK+ and
GIO more convenient.
#GtkMountOperation is needed when mounting volumes:
It is an implementation of #GMountOperation that can be used with
GIO functions for mounting volumes such as
g_file_mount_enclosing_volume(), g_file_mount_mountable(),
g_volume_mount(), g_mount_unmount_with_operation() and others.
When necessary, #GtkMountOperation shows dialogs to ask for
passwords, questions or show processes blocking unmount.
gtk_show_uri() is a convenient way to launch applications for URIs.
Another object that is worth mentioning in this context is
#GdkAppLaunchContext, which provides visual feedback when lauching
applications.
Obtains a copy of the event currently being processed by GTK+. For
example, if you get a "clicked" signal from #GtkButton, the current
event will be the #GdkEventButton that triggered the "clicked"
signal. The returned event must be freed with gdk_event_free().
If there is no current event, the function returns %NULL.
a copy of the current event, or %NULL if no
current event.
If there is a current event and it has a state field, place
that state field in @state and return %TRUE, otherwise return
%FALSE.
%TRUE if there was a current event and it had a state field
a location to store the state of the current event
If there is a current event and it has a timestamp, return that
timestamp, otherwise return %GDK_CURRENT_TIME.
the timestamp from the current event, or %GDK_CURRENT_TIME.
Returns the #PangoLanguage for the default language currently in
effect. (Note that this can change over the life of an
application.) The default language is derived from the current
locale. It determines, for example, whether GTK+ uses the
right-to-left or left-to-right text direction.
This function is equivalent to pango_language_get_default(). See
that function for details.
the default language as a #PangoLanguage, must not be
freed
If @event is %NULL or the event was not associated with any widget,
returns %NULL, otherwise returns the widget that received the event
originally.
the widget that originally
received @event, or %NULL
a #GdkEvent
Returns a #GOptionGroup for the commandline arguments recognized
by GTK+ and GDK. You should add this group to your #GOptionContext
with g_option_context_add_group(), if you are using
g_option_context_parse() to parse your commandline arguments.
a #GOptionGroup for the commandline arguments recognized
by GTK+
whether to open the default display
when parsing the commandline arguments
Queries the current grab of the default window group.
The widget which currently
has the grab or %NULL if no grab is active
Stock items represent commonly-used menu or toolbar items such as
"Open" or "Exit". Each stock item is identified by a stock ID;
stock IDs are just strings, but macros such as #GTK_STOCK_OPEN are
provided to avoid typing mistakes in the strings.
Applications can register their own stock items in addition to those
built-in to GTK+.
Each stock ID can be associated with a #GtkStockItem, which contains
the user-visible label, keyboard accelerator, and translation domain
of the menu or toolbar item; and/or with an icon stored in a
#GtkIconFactory. See <link
linkend="gtk-Themeable-Stock-Images">GtkIconFactory</link> for
more information on stock icons. The connection between a
#GtkStockItem and stock icons is purely conventional (by virtue of
using the same stock ID); it's possible to register a stock item but
no icon, and vice versa. Stock icons may have a RTL variant which gets
used for right-to-left locales.
A button box should be used to provide a consistent layout of buttons
throughout your application. The layout/spacing can be altered by the
programmer, or if desired, by the user to alter the 'feel' of a
program to a small degree.
A #GtkVButtonBox is created with gtk_vbutton_box_new(). Buttons are
packed into a button box the same way widgets are added to any other
container, using gtk_container_add(). You can also use
gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both
these functions work just like gtk_container_add(), ie., they pack the
button in a way that depends on the current layout style and on
whether the button has had gtk_button_box_set_child_secondary() called
on it.
The spacing between buttons can be set with gtk_box_set_spacing(). The
arrangement and layout of the buttons can be changed with
gtk_button_box_set_layout().
Looks up the icon size associated with @name.
the icon size
the name to look up.
Gets the canonical name of the given icon size. The returned string
is statically allocated and should not be freed.
the name of the given icon size.
a #GtkIconSize.
Obtains the pixel size of a semantic icon size, possibly
modified by user preferences for the default #GtkSettings.
(See gtk_icon_size_lookup_for_settings().)
Normally @size would be
#GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
isn't normally needed, gtk_widget_render_icon() is the usual
way to get an icon for rendering, then just look at the size of
the rendered pixbuf. The rendered pixbuf may not even correspond to
the width/height returned by gtk_icon_size_lookup(), because themes
are free to render the pixbuf however they like, including changing
the usual size.
%TRUE if @size was a valid size
an icon size
location to store icon width
location to store icon height
Obtains the pixel size of a semantic icon size, possibly
modified by user preferences for a particular
#GtkSettings. Normally @size would be
#GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
isn't normally needed, gtk_widget_render_icon() is the usual
way to get an icon for rendering, then just look at the size of
the rendered pixbuf. The rendered pixbuf may not even correspond to
the width/height returned by gtk_icon_size_lookup(), because themes
are free to render the pixbuf however they like, including changing
the usual size.
%TRUE if @size was a valid size
a #GtkSettings object, used to determine
which set of user preferences to used.
an icon size
location to store icon width
location to store icon height
Registers a new icon size, along the same lines as #GTK_ICON_SIZE_MENU,
etc. Returns the integer value for the size.
integer value representing the size
name of the icon size
the icon width
the icon height
Registers @alias as another name for @target.
So calling gtk_icon_size_from_name() with @alias as argument
will return @target.
an alias for @target
an existing icon size
Call this function before using any other GTK+ functions in your GUI
applications. It will initialize everything needed to operate the
toolkit and parses some standard command line options.
@argc and @argv are adjusted accordingly so your own code will
never see those standard arguments.
Note that there are some alternative ways to initialize GTK+:
if you are calling gtk_parse_args(), gtk_init_check(),
gtk_init_with_args() or g_option_context_parse() with
the option group returned by gtk_get_option_group(),
you <emphasis>don't</emphasis> have to call gtk_init().
<note><para>
This function will terminate your program if it was unable to
initialize the windowing system for some reason. If you want
your program to fall back to a textual interface you want to
call gtk_init_check() instead.
</para></note>
<note><para>
Since 2.18, GTK+ calls <literal>signal (SIGPIPE, SIG_IGN)</literal>
during initialization, to ignore SIGPIPE signals, since these are
almost never wanted in graphical applications. If you do need to
handle SIGPIPE for some reason, reset the handler after gtk_init(),
but notice that other libraries (e.g. libdbus or gvfs) might do
similar things.
</para></note>
Address of the <parameter>argc</parameter> parameter of
your main() function. Changed if any arguments were handled
Address of the
<parameter>argv</parameter> parameter of main(). Any options
understood by GTK+ are stripped before return.
This function does the same work as gtk_init() with only
a single change: It does not terminate the program if the GUI can't be
initialized. Instead it returns %FALSE on failure.
This way the application can fall back to some other means of communication
with the user - for example a curses or command line interface.
%TRUE if the GUI has been successfully initialized,
%FALSE otherwise.
Address of the <parameter>argc</parameter> parameter of your
main() function. Changed if any arguments were handled.
Address of the <parameter>argv</parameter> parameter of main().
Any parameters understood by gtk_init() are stripped before return.
This function does the same work as gtk_init_check().
Additionally, it allows you to add your own commandline options,
and it automatically generates nicely formatted
<option>--help</option> output. Note that your program will
be terminated after writing out the help output.
%TRUE if the GUI has been successfully initialized,
%FALSE otherwise.
a pointer to the number of command line arguments.
a pointer to the array of
command line arguments.
a string which is displayed in
the first line of <option>--help</option> output, after
<literal><replaceable>programname</replaceable> [OPTION...]</literal>
a %NULL-terminated array
of #GOptionEntry<!-- -->s describing the options of your program
a translation domain to use for translating
the <option>--help</option> output for the options in @entries
and the @parameter_string with gettext(), or %NULL
Draws an arrow in the given rectangle on @window using the given
parameters. @arrow_type determines the direction of the arrow.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
the type of arrow to draw
%TRUE if the arrow tip should be filled
x origin of the rectangle to draw the arrow in
y origin of the rectangle to draw the arrow in
width of the rectangle to draw the arrow in
height of the rectangle to draw the arrow in
Draws a box on @window with the given parameters.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the box
y origin of the box
the width of the box
the height of the box
Draws a box in @window using the given style and state and shadow type,
leaving a gap in one side.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
side in which to leave the gap
starting position of the gap
width of the gap
Draws a check button indicator in the given rectangle on @window with
the given parameters.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle to draw the check in
y origin of the rectangle to draw the check in
the width of the rectangle to draw the check in
the height of the rectangle to draw the check in
Draws a diamond in the given rectangle on @window using the given
parameters.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle to draw the diamond in
y origin of the rectangle to draw the diamond in
width of the rectangle to draw the diamond in
height of the rectangle to draw the diamond in
Draws an expander as used in #GtkTreeView. @x and @y specify the
center the expander. The size of the expander is determined by the
"expander-size" style property of @widget. (If widget is not
specified or doesn't have an "expander-size" property, an
unspecified default size will be used, since the caller doesn't
have sufficient information to position the expander, this is
likely not useful.) The expander is expander_size pixels tall
in the collapsed position and expander_size pixels wide in the
expanded position.
a #GtkStyle
a #GdkWindow
a state
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
the x position to draw the expander at
the y position to draw the expander at
the style to draw the expander in; determines
whether the expander is collapsed, expanded, or in an
intermediate state.
Draws an extension, i.e. a notebook tab.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the extension
y origin of the extension
width of the extension
width of the extension
the side on to which the extension is attached
Draws a flat box on @window with the given parameters.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the box
y origin of the box
the width of the box
the height of the box
Draws a focus indicator around the given rectangle on @window using the
given style.
a #GtkStyle
a #GdkWindow
a state
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
the x origin of the rectangle around which to draw a focus indicator
the y origin of the rectangle around which to draw a focus indicator
the width of the rectangle around which to draw a focus indicator
the height of the rectangle around which to draw a focus indicator
Draws a handle as used in #GtkHandleBox and #GtkPaned.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the handle
y origin of the handle
with of the handle
height of the handle
the orientation of the handle
Draws a horizontal line from (@x1, @y) to (@x2, @y) in @window
using the given style and state.
a #GtkStyle
a #GdkWindow
a state
rectangle to which the output is clipped, or %NULL if the
output should not be clipped
the widget
a style detail
the starting x coordinate
the ending x coordinate
the y coordinate
Draws a layout on @window using the given parameters.
a #GtkStyle
a #GdkWindow
a state
whether to use the text or foreground
graphics context of @style
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin
y origin
the layout to draw
Draws a radio button indicator in the given rectangle on @window with
the given parameters.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle to draw the option in
y origin of the rectangle to draw the option in
the width of the rectangle to draw the option in
the height of the rectangle to draw the option in
Draws a polygon on @window with the given parameters.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
an array of #GdkPoint<!-- -->s
length of @points
%TRUE if the polygon should be filled
Draws a resize grip in the given rectangle on @window using the given
parameters.
a #GtkStyle
a #GdkWindow
a state
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
the edge in which to draw the resize grip
the x origin of the rectangle in which to draw the resize grip
the y origin of the rectangle in which to draw the resize grip
the width of the rectangle in which to draw the resize grip
the height of the rectangle in which to draw the resize grip
Draws a shadow around the given rectangle in @window
using the given style and state and shadow type.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
clip rectangle or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
Draws a shadow around the given rectangle in @window
using the given style and state and shadow type, leaving a
gap in one side.
a #GtkStyle
a #GdkWindow
a state
type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle
y origin of the rectangle
width of the rectangle
width of the rectangle
side in which to leave the gap
starting position of the gap
width of the gap
Draws a slider in the given rectangle on @window using the
given style and orientation.
a #GtkStyle
a #GdkWindow
a state
a shadow
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
the x origin of the rectangle in which to draw a slider
the y origin of the rectangle in which to draw a slider
the width of the rectangle in which to draw a slider
the height of the rectangle in which to draw a slider
the orientation to be used
Draws a spinner on @window using the given parameters.
a #GtkStyle
a #GdkWindow
a state
clip rectangle, or %NULL if the
output should not be clipped
the widget (may be %NULL)
a style detail (may be %NULL)
the nth step, a value between 0 and #GtkSpinner:num-steps
the x origin of the rectangle in which to draw the spinner
the y origin of the rectangle in which to draw the spinner
the width of the rectangle in which to draw the spinner
the height of the rectangle in which to draw the spinner
Draws a text string on @window with the given parameters.
Use gtk_paint_layout() instead.
a #GtkStyle
a #GdkWindow
a state
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin
y origin
the string to draw
Draws an option menu tab (i.e. the up and down pointing arrows)
in the given rectangle on @window using the given parameters.
a #GtkStyle
a #GdkWindow
a state
the type of shadow to draw
clip rectangle, or %NULL if the
output should not be clipped
the widget
a style detail
x origin of the rectangle to draw the tab in
y origin of the rectangle to draw the tab in
the width of the rectangle to draw the tab in
the height of the rectangle to draw the tab in
Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @window
using the given style and state.
a #GtkStyle
a #GdkWindow
a state
rectangle to which the output is clipped, or %NULL if the
output should not be clipped
the widget
a style detail
the starting y coordinate
the ending y coordinate
the x coordinate
Returns the name of the default paper size, which
depends on the current locale.
the name of the default paper size. The string
is owned by GTK+ and should not be modified.
Creates a list of known paper sizes.
a newly allocated list of newly
allocated #GtkPaperSize objects
whether to include custom paper sizes
as defined in the page setup dialog
Parses command line arguments, and initializes global
attributes of GTK+, but does not actually open a connection
to a display. (See gdk_display_open(), gdk_get_display_arg_name())
Any arguments used by GTK+ or GDK are removed from the array and
@argc and @argv are updated accordingly.
There is no need to call this function explicitely if you are using
gtk_init(), or gtk_init_check().
%TRUE if initialization succeeded, otherwise %FALSE.
a pointer to the number of command line arguments
a pointer to the array of
command line arguments
Registers an error quark for #GtkPrintOperation if necessary.
The error quark used for #GtkPrintOperation errors.
Runs a page setup dialog, letting the user modify the values from
@page_setup. If the user cancels the dialog, the returned #GtkPageSetup
is identical to the passed in @page_setup, otherwise it contains the
modifications done in the dialog.
Note that this function may use a recursive mainloop to show the page
setup dialog. See gtk_print_run_page_setup_dialog_async() if this is
a problem.
a new #GtkPageSetup
transient parent
an existing #GtkPageSetup
a #GtkPrintSettings
Runs a page setup dialog, letting the user modify the values from @page_setup.
In contrast to gtk_print_run_page_setup_dialog(), this function returns after
showing the page setup dialog on platforms that support this, and calls @done_cb
from a signal handler for the ::response signal of the dialog.
transient parent, or %NULL
an existing #GtkPageSetup, or %NULL
a #GtkPrintSettings
a function to call when the user saves the modified page setup
user data to pass to @done_cb
Sends an event to a widget, propagating the event to parent widgets
if the event remains unhandled. Events received by GTK+ from GDK
normally begin in gtk_main_do_event(). Depending on the type of
event, existence of modal dialogs, grabs, etc., the event may be
propagated; if so, this function is used. gtk_propagate_event()
calls gtk_widget_event() on each widget it decides to send the
event to. So gtk_widget_event() is the lowest-level function; it
simply emits the "event" and possibly an event-specific signal on a
widget. gtk_propagate_event() is a bit higher-level, and
gtk_main_do_event() is the highest level.
All that said, you most likely don't want to use any of these
functions; synthesizing events is rarely needed. Consider asking on
the mailing list for better ways to achieve your goals. For
example, use gdk_window_invalidate_rect() or
gtk_widget_queue_draw() instead of making up expose events.
a #GtkWidget
an event
Adds a file to the list of files to be parsed at the
end of gtk_init().
the pathname to the file. If @filename is not absolute, it
is searched in the current directory.
Searches for a theme engine in the GTK+ search path. This function
is not useful for applications and should not be used.
The filename, if found (must be freed with g_free()),
otherwise %NULL.
name of a theme engine
Looks up a file in pixmap path for the specified #GtkSettings.
If the file is not found, it outputs a warning message using
g_warning() and returns %NULL.
the filename.
a #GtkSettings
Scanner used to get line number information for the
warning message, or %NULL
name of the pixmap file to locate.
Retrieves the current list of RC files that will be parsed
at the end of gtk_init().
A %NULL-terminated array of filenames.
This memory is owned by GTK+ and must not be freed by the application.
If you want to store this information, you should make a copy.
Obtains the path to the IM modules file. See the documentation
of the <link linkend="im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link>
environment variable for more details.
a newly-allocated string containing the name of the file
listing the IM modules available for loading
Obtains the path in which to look for IM modules. See the documentation
of the <link linkend="im-module-path"><envar>GTK_PATH</envar></link>
environment variable for more details about looking up modules. This
function is useful solely for utilities supplied with GTK+ and should
not be used by applications under normal circumstances.
a newly-allocated string containing the path in which to
look for IM modules.
Returns a directory in which GTK+ looks for theme engines.
For full information about the search for theme engines,
see the docs for <envar>GTK_PATH</envar> in
<xref linkend="gtk-running"/>.
the directory. (Must be freed with g_free())
Finds all matching RC styles for a given widget,
composites them together, and then creates a
#GtkStyle representing the composite appearance.
(GTK+ actually keeps a cache of previously
created styles, so a new style may not be
created.)
the resulting style. No refcount is added
to the returned style, so if you want to save this
style around, you should add a reference yourself.
a #GtkWidget
Creates up a #GtkStyle from styles defined in a RC file by providing
the raw components used in matching. This function may be useful
when creating pseudo-widgets that should be themed like widgets but
don't actually have corresponding GTK+ widgets. An example of this
would be items inside a GNOME canvas widget.
The action of gtk_rc_get_style() is similar to:
|[
gtk_widget_path (widget, NULL, &path, NULL);
gtk_widget_class_path (widget, NULL, &class_path, NULL);
gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
path, class_path,
G_OBJECT_TYPE (widget));
]|
A style created by matching with the
supplied paths, or %NULL if nothing matching was specified and the
default style should be used. The returned value is owned by GTK+
as part of an internal cache, so you must call g_object_ref() on
the returned value if you want to keep a reference to it.
a #GtkSettings object
the widget path to use when looking up the
style, or %NULL if no matching against the widget path should be done
the class path to use when looking up the style,
or %NULL if no matching against the class path should be done.
a type that will be used along with parent types of this type
when matching against class styles, or #G_TYPE_NONE
Parses a color in the <link linkend="color=format">format</link> expected
in a RC file.
Note that theme engines should use gtk_rc_parse_color_full() in
order to support symbolic colors.
%G_TOKEN_NONE if parsing succeeded, otherwise the token
that was expected but not found
a #GScanner
a pointer to a #GdkColor structure in which to store
the result
Parses a color in the <link linkend="color=format">format</link> expected
in a RC file. If @style is not %NULL, it will be consulted to resolve
references to symbolic colors.
%G_TOKEN_NONE if parsing succeeded, otherwise the token
that was expected but not found
a #GScanner
a #GtkRcStyle, or %NULL
a pointer to a #GdkColor structure in which to store
the result
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses
borders in the form
<literal>"{ left, right, top, bottom }"</literal> for integers
%left, %right, %top and %bottom.
%TRUE if @gstring could be parsed and @property_value
has been set to the resulting #GtkBorder.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold boxed values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a
color given either by its name or in the form
<literal>{ red, green, blue }</literal> where %red, %green and
%blue are integers between 0 and 65535 or floating-point numbers
between 0 and 1.
%TRUE if @gstring could be parsed and @property_value
has been set to the resulting #GdkColor.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold #GdkColor values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a single
enumeration value.
The enumeration value can be specified by its name, its nickname or
its numeric value. For consistency with flags parsing, the value
may be surrounded by parentheses.
%TRUE if @gstring could be parsed and @property_value
has been set to the resulting #GEnumValue.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold enum values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses flags.
Flags can be specified by their name, their nickname or
numerically. Multiple flags can be specified in the form
<literal>"( flag1 | flag2 | ... )"</literal>.
%TRUE if @gstring could be parsed and @property_value
has been set to the resulting flags value.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold flags values.
A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a
requisition in the form
<literal>"{ width, height }"</literal> for integers %width and %height.
%TRUE if @gstring could be parsed and @property_value
has been set to the resulting #GtkRequisition.
a #GParamSpec
the #GString to be parsed
a #GValue which must hold boxed values.
If the modification time on any previously read file for the
default #GtkSettings has changed, discard all style information
and then reread all previously read RC files.
%TRUE if the files were reread.
If the modification time on any previously read file
for the given #GtkSettings has changed, discard all style information
and then reread all previously read RC files.
%TRUE if the files were reread.
a #GtkSettings
load whether or not anything changed
This function recomputes the styles for all widgets that use a
particular #GtkSettings object. (There is one #GtkSettings object
per #GdkScreen, see gtk_settings_get_for_screen()); It is useful
when some global parameter has changed that affects the appearance
of all widgets, because when a widget gets a new style, it will
both redraw and recompute any cached information about its
appearance. As an example, it is used when the default font size
set by the operating system changes. Note that this function
doesn't affect widgets that have a style set explicitely on them
with gtk_widget_set_style().
a #GtkSettings
Sets the list of files that GTK+ will read at the
end of gtk_init().
A %NULL-terminated list of filenames.
Converts a color from RGB space to HSV.
Input values must be in the [0.0, 1.0] range;
output values will be in the same range.
Red
Green
Blue
Return value for the hue component
Return value for the saturation component
Return value for the value component
Appends a specified target to the list of supported targets for a
given widget and selection.
a #GtkTarget
the selection
target to add.
A unsigned integer which will be passed back to the application.
Prepends a table of targets to the list of supported targets
for a given widget and selection.
a #GtkWidget
the selection
a table of targets to add
number of entries in @targets
The default handler for the #GtkWidget::selection-clear-event
signal.
Instead of calling this function, chain up from
your selection-clear-event handler. Calling this function
from any other context is illegal.
%TRUE if the event was handled, otherwise false
a #GtkWidget
the event
Remove all targets registered for the given selection for the
widget.
a #GtkWidget
an atom representing a selection
Requests the contents of a selection. When received,
a "selection-received" signal will be generated.
%TRUE if requested succeeded. %FALSE if we could not process
request. (e.g., there was already a request in process for
this widget).
The widget which acts as requestor
Which selection to get
Form of information desired (e.g., STRING)
Time of request (usually of triggering event)
In emergency, you could use #GDK_CURRENT_TIME
Claims ownership of a given selection for a particular widget,
or, if @widget is %NULL, release ownership of the selection.
%TRUE if the operation succeeded
a #GtkWidget, or %NULL.
an interned atom representing the selection to claim
timestamp with which to claim the selection
Claim ownership of a given selection for a particular widget, or,
if @widget is %NULL, release ownership of the selection.
TRUE if the operation succeeded
the #Gdkdisplay where the selection is set
new selection owner (a #GdkWidget), or %NULL.
an interned atom representing the selection to claim.
timestamp with which to claim the selection
Removes all handlers and unsets ownership of all
selections for a widget. Called when widget is being
destroyed. This function will not generally be
called by applications.
a #GtkWidget
Initializes internationalization support for GTK+. gtk_init()
automatically does this, so there is typically no point
in calling this function.
If you are calling this function because you changed the locale
after GTK+ is was initialized, then calling this function
may help a bit. (Note, however, that changing the locale
after GTK+ is initialized may produce inconsistent results and
is not really supported.)
In detail - sets the current locale according to the
program environment. This is the same as calling the C library function
<literal>setlocale (LC_ALL, "")</literal> but also takes care of the
locale specific setup of the windowing system used by GDK.
Use setlocale() directly
a string corresponding to the locale set, typically in the
form lang_COUNTRY, where lang is an ISO-639 language code, and
COUNTRY is an ISO-3166 country code. On Unix, this form matches the
result of the setlocale(); it is also used on other machines, such as
Windows, where the C library returns a different result. The string is
owned by GTK+ and should not be modified or freed.
This is a convenience function for showing an application's about box.
The constructed dialog is associated with the parent window and
reused for future invocations of this function.
transient parent, or %NULL for none
the name of the first property
value of first property, followed by more properties, %NULL-terminated
This is a convenience function for launching the default application
to show the uri. The uri must be of a form understood by GIO (i.e. you
need to install gvfs to get support for uri schemes such as http://
or ftp://, as only local files are handled by GIO itself).
Typical examples are
<simplelist>
<member><filename>file:///home/gnome/pict.jpg</filename></member>
<member><filename>http://www.gnome.org</filename></member>
<member><filename>mailto:me@gnome.org</filename></member>
</simplelist>
Ideally the timestamp is taken from the event triggering
the gtk_show_uri() call. If timestamp is not known you can take
%GDK_CURRENT_TIME.
This function can be used as a replacement for gnome_vfs_url_show()
and gnome_url_show().
%TRUE on success, %FALSE on error.
screen to show the uri on or %NULL for the default screen
the uri to show
a timestamp to prevent focus stealing.
Registers each of the stock items in @items. If an item already
exists with the same stock ID as one of the @items, the old item
gets replaced. The stock items are copied, so GTK+ does not hold
any pointer into @items and @items can be freed. Use
gtk_stock_add_static() if @items is persistent and GTK+ need not
copy the array.
a #GtkStockItem or array of items
number of #GtkStockItem in @items
Same as gtk_stock_add(), but doesn't copy @items, so
@items must persist until application exit.
a #GtkStockItem or array of #GtkStockItem
number of items
Retrieves a list of all known stock IDs added to a #GtkIconFactory
or registered with gtk_stock_add(). The list must be freed with g_slist_free(),
and each string in the list must be freed with g_free().
a list of known stock IDs
Fills @item with the registered values for @stock_id, returning %TRUE
if @stock_id was known.
%TRUE if @item was initialized
a stock item name
stock item to initialize with values
Sets a function to be used for translating the @label of
a stock item.
If no function is registered for a translation domain,
g_dgettext() is used.
The function is used for all stock items whose
@translation_domain matches @domain. Note that it is possible
to use strings different from the actual gettext translation domain
of your application for this, as long as your #GtkTranslateFunc uses
the correct domain when calling dgettext(). This can be useful, e.g.
when dealing with message contexts:
|[
GtkStockItem items[] = {
{ MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" },
{ MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" },
};
gchar *
my_translate_func (const gchar *msgid,
gpointer data)
{
gchar *msgctxt = data;
return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid);
}
/* ... */
gtk_stock_add (items, G_N_ELEMENTS (items));
gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items");
gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items");
]|
the translation domain for which @func shall be used
a #GtkTranslateFunc
data to pass to @func
a #GDestroyNotify that is called when @data is
no longer needed
This function frees a target table as returned by
gtk_target_table_new_from_list()
a #GtkTargetEntry array
the number of entries in the array
This function creates an #GtkTargetEntry array that contains the
same targets as the passed %list. The returned table is newly
allocated and should be freed using gtk_target_table_free() when no
longer needed.
the new table.
a #GtkTargetList
return location for the number ot targets in the table
Determines if any of the targets in @targets can be used to
provide a #GdkPixbuf.
%TRUE if @targets include a suitable target for images,
otherwise %FALSE.
an array of #GdkAtom<!-- -->s
the length of @targets
whether to accept only targets for which GTK+ knows
how to convert a pixbuf into the format
Determines if any of the targets in @targets can be used to
provide rich text.
%TRUE if @targets include a suitable target for rich text,
otherwise %FALSE.
an array of #GdkAtom<!-- -->s
the length of @targets
a #GtkTextBuffer
Determines if any of the targets in @targets can be used to
provide text.
%TRUE if @targets include a suitable target for text,
otherwise %FALSE.
an array of #GdkAtom<!-- -->s
the length of @targets
Determines if any of the targets in @targets can be used to
provide an uri list.
%TRUE if @targets include a suitable target for uri lists,
otherwise %FALSE.
an array of #GdkAtom<!-- -->s
the length of @targets
Create a simple window with window title @window_title and
text contents @dialog_text.
The window will quit any running gtk_main()-loop when destroyed, and it
will automatically be destroyed upon test function teardown.
a widget pointer to the newly created GtkWindow.
Title of the window to be displayed.
Text inside the window to be displayed.
This function wraps g_object_new() for widget types.
It'll automatically show all created non window widgets, also
g_object_ref_sink() them (to keep them alive across a running test)
and set them up for destruction during the next test teardown phase.
a newly created widget.
a valid widget type.
Name of first property to set or %NULL
value to set the first property to, followed by more
name-value pairs, terminated by %NULL
Create a window with window title @window_title, text contents @dialog_text,
and a number of buttons, according to the paired argument list given
as @... parameters.
Each button is created with a @label and a ::clicked signal handler that
incremrents the integer stored in @nump.
The window will be automatically shown with gtk_widget_show_now() after
creation, so when this function returns it has already been mapped,
resized and positioned on screen.
The window will quit any running gtk_main()-loop when destroyed, and it
will automatically be destroyed upon test function teardown.
a widget pointer to the newly created GtkWindow.
Title of the window to be displayed.
Text inside the window to be displayed.
%NULL terminated list of (const char *label, int *nump) pairs.
This function will search @widget and all its descendants for a GtkLabel
widget with a text string matching @label_pattern.
The @label_pattern may contain asterisks '*' and question marks '?' as
placeholders, g_pattern_match() is used for the matching.
Note that locales other than "C" tend to alter (translate" label strings,
so this function is genrally only useful in test programs with
predetermined locales, see gtk_test_init() for more details.
a GtkLabel widget if any is found.
Valid label or container widget.
Shell-glob pattern to match a label string.
This function will search siblings of @base_widget and siblings of its
ancestors for all widgets matching @widget_type.
Of the matching widgets, the one that is geometrically closest to
@base_widget will be returned.
The general purpose of this function is to find the most likely "action"
widget, relative to another labeling widget. Such as finding a
button or text entry widget, given it's corresponding label widget.
a widget of type @widget_type if any is found.
Valid widget, part of a widget hierarchy
Type of a aearched for sibling widget
This function will search the descendants of @widget for a widget
of type @widget_type that has a label matching @label_pattern next
to it. This is most useful for automated GUI testing, e.g. to find
the "OK" button in a dialog and synthesize clicks on it.
However see gtk_test_find_label(), gtk_test_find_sibling() and
gtk_test_widget_click() for possible caveats involving the search of
such widgets and synthesizing widget events.
a valid widget if any is found or %NULL.
Container widget, usually a GtkWindow.
Shell-glob pattern to match a label string.
Type of a aearched for label sibling widget.
This function is used to initialize a GTK+ test program.
It will in turn call g_test_init() and gtk_init() to properly
initialize the testing framework and graphical toolkit. It'll
also set the program's locale to "C" and prevent loading of rc
files and Gtk+ modules. This is done to make tets program
environments as deterministic as possible.
Like gtk_init() and g_test_init(), any known arguments will be
processed and stripped from @argc and @argv.
Address of the <parameter>argc</parameter> parameter of the
main() function. Changed if any arguments were handled.
Address of the
<parameter>argv</parameter> parameter of main().
Any parameters understood by g_test_init() or gtk_init() are
stripped before return.
currently unused
Return the type ids that have been registered after
calling gtk_test_register_all_types().
0-terminated array of type ids
location to store number of types
Force registration of all core Gtk+ and Gdk object types.
This allowes to refer to any of those object types via
g_type_from_name() after calling this function.
Retrive the literal adjustment value for GtkRange based
widgets and spin buttons. Note that the value returned by
this function is anything between the lower and upper bounds
of the adjustment belonging to @widget, and is not a percentage
as passed in to gtk_test_slider_set_perc().
adjustment->value for an adjustment belonging to @widget.
valid widget pointer.
This function will adjust the slider position of all GtkRange
based widgets, such as scrollbars or scales, it'll also adjust
spin buttons. The adjustment value of these widgets is set to
a value between the lower and upper limits, according to the
@percentage argument.
valid widget pointer.
value between 0 and 100.
This function will generate a @button click in the upwards or downwards
spin button arrow areas, usually leading to an increase or decrease of
spin button's value.
wether all actions neccessary for the button click simulation were carried out successfully.
valid GtkSpinButton widget.
Number of the pointer button for the event, usually 1, 2 or 3.
%TRUE for upwards arrow click, %FALSE for downwards arrow click.
Retrive the text string of @widget if it is a GtkLabel,
GtkEditable (entry and text widgets) or GtkTextView.
new 0-terminated C string, needs to be released with g_free().
valid widget pointer.
Set the text string of @widget to @string if it is a GtkLabel,
GtkEditable (entry and text widgets) or GtkTextView.
valid widget pointer.
a 0-terminated C string
This function will generate a @button click (button press and button
release event) in the middle of the first GdkWindow found that belongs
to @widget.
For %GTK_NO_WINDOW widgets like GtkButton, this will often be an
input-only event window. For other widgets, this is usually widget->window.
Certain caveats should be considered when using this function, in
particular because the mouse pointer is warped to the button click
location, see gdk_test_simulate_button() for details.
wether all actions neccessary for the button click simulation were carried out successfully.
Widget to generate a button click on.
Number of the pointer button for the event, usually 1, 2 or 3.
Keyboard modifiers the event is setup with.
This function will generate keyboard press and release events in
the middle of the first GdkWindow found that belongs to @widget.
For %GTK_NO_WINDOW widgets like GtkButton, this will often be an
input-only event window. For other widgets, this is usually widget->window.
Certain caveats should be considered when using this function, in
particular because the mouse pointer is warped to the key press
location, see gdk_test_simulate_key() for details.
wether all actions neccessary for the key event simulation were carried out successfully.
Widget to generate a key press and release on.
A Gdk keyboard value.
Keyboard modifiers the event is setup with.
Obtains a @tree_model and @path from selection data of target type
%GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.
This function can only be used if @selection_data originates from the same
process that's calling this function, because a pointer to the tree model
is being passed around. If you aren't in the same process, then you'll
get memory corruption. In the #GtkTreeDragDest drag_data_received handler,
you can assume that selection data of type %GTK_TREE_MODEL_ROW is
in from the current process. The returned path must be freed with
gtk_tree_path_free().
%TRUE if @selection_data had target type %GTK_TREE_MODEL_ROW and
is otherwise valid
a #GtkSelectionData
a #GtkTreeModel
row in @tree_model
Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
know that the model emitted the "row_deleted" signal.
A #GObject
The path position that was deleted
Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
know that the model emitted the "row_inserted" signal.
A #GObject
The row position that was inserted
Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
know that the model emitted the "rows_reordered" signal.
A #GObject
The parent path of the reordered signal
The iter pointing to the parent of the reordered
The new order of rows
Sets selection data of target type %GTK_TREE_MODEL_ROW. Normally used
in a drag_data_get handler.
%TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row
some #GtkSelectionData
a #GtkTreeModel
a row in @tree_model
Returns a pointer pointing to the class of @type or %NULL if there
was any trouble identifying @type. Initializes the class if
necessary.
Use g_type_class_peek() or g_type_class_ref() instead.
pointer to the class.
a #GtkType.
This function is deprecated; it does nothing.
This function is deprecated; it does nothing.
a visual
Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
Use gtk_widget_set_style() with a %NULL @style argument instead.
a #GtkWidget.
This function is deprecated; it does nothing.
a visual
Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
Use gtk_widget_set_style() with a %NULL @style argument instead.
a #GtkWidget.
This function is deprecated; it does nothing.
a #GtkWidget
a visual