Sets our main struct and passes it to the parent class
Creates a new GtkSpinButton.
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 ::input signal can be used to influence the conversion of the users input into a double value. The signal handler is expected to use gtk_entry_get_text() to retrieve the text of the entry and set new_value to the new value. The default conversion uses g_strtod(). TRUE for a successful conversion, FALSE if the input was not handled, and GTK_INPUT_ERROR if the conversion failed.
The ::output signal can be used to change to formatting of the value that is displayed in the spin buttons entry. 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. Since 2.10 See Also GtkEntry
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.
Get the adjustment associated with a GtkSpinButton
Fetches the precision of spin_button. See gtk_spin_button_set_digits().
Gets the current step and page the increments used by spin_button. See gtk_spin_button_set_increments().
Returns whether non-numeric text can be typed into the spin button. See gtk_spin_button_set_numeric().
Gets the range allowed for spin_button. See gtk_spin_button_set_range().
Returns whether the values are corrected to the nearest step. See gtk_spin_button_set_snap_to_ticks().
the main Gtk struct as a void*
Gets the update behavior of a spin button. See gtk_spin_button_set_update_policy().
Get the value in the spin_button.
Get the value spin_button represented as an integer.
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().
Replaces the GtkAdjustment associated with spin_button.
Set the precision to be displayed by spin_button. Up to 20 digit precision is allowed.
Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button's arrows are activated.
Sets the flag that determines if non-numeric text can be typed into the spin button.
Sets the minimum and maximum allowable values for spin_button. If the current value is outside this range, it will be adjusted to fit within the range, otherwise it will remain unchanged.
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.
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.
Sets the value of spin_button.
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.
Increment or decrement a spin button's value in a specified direction by a specified amount.
Manually force an update of the spin button.
the main Gtk struct
the main Gtk struct
the main Gtk struct as a void*
Gets the stock id of action. Since 2.16
Sets the stock id on action Since 2.16
The ::activate signal is emitted when the user hits the Enter key. While this signal is used as a keybinding signal, it is also commonly used by applications to intercept activation of entries. The default bindings for this signal are all forms of the Enter key.
The ::backspace signal is a keybinding signal 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 keybinding signal 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 keybinding signal 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 keybinding signal 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 and Ctrl-Delete for deleting a word.
The ::icon-press signal is emitted when an activatable icon is clicked. Since 2.16
The ::icon-release signal is emitted on the button release from a mouse click over an activatable icon. Since 2.16
The ::insert-at-cursor signal is a keybinding signal which gets emitted when the user initiates the insertion of a fixed string at the cursor. This signal has no default bindings.
The ::move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement. If the cursor is not visible in entry, 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. Arrow keys move by individual characters/lines Ctrl-arrow key combinations move by words/paragraphs Home/End keys move to the ends of the buffer TRUE if the move should extend the selection
The ::paste-clipboard signal is a keybinding signal 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 entry. If you need to add items to the context menu, connect to this signal and append your items to the widget, which will be a GtkMenu in this case. If "populate-all" is TRUE, this signal will also be emitted to populate touch popups. In this case, widget will be a different container, e.g. a GtkToolbar. The signal handler should not make assumptions about the type of widget.
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. Since 2.20
The ::toggle-overwrite signal is a keybinding signal which gets emitted to toggle the overwrite mode of the entry. The default bindings for this signal is Insert. See Also GtkTextView, GtkEntryCompletion
Get the GtkEntryBuffer object which holds the text for this widget. Since 2.18
Set the GtkEntryBuffer object which holds the text for this widget. Since 2.18
Sets the text in the widget to the given value, replacing the current contents. See gtk_entry_buffer_set_text().
Retrieves the contents of the entry widget. See also gtk_editable_get_chars().
Retrieves the current length of the text in entry. Since 2.14
Gets the area where the entry's text is drawn. This function is useful when drawing something to the entry in a draw callback. If the entry is not realized, text_area is filled with zeros. See also gtk_entry_get_icon_area().
Sets whether the contents of the entry are visible or not. When visibility is set to FALSE, characters are displayed as the invisible char, and will also appear that way when the text in the entry widget is copied elsewhere. By default, GTK+ picks the best invisible character available in the current font, but it can be changed with gtk_entry_set_invisible_char(). Note that you probably want to set "input-purpose" to GTK_INPUT_PURPOSE_PASSWORD or GTK_INPUT_PURPOSE_PIN to inform input methods about the purpose of this entry, in addition to setting visibility to FALSE.
Sets the character to use in place of the actual text when gtk_entry_set_visibility() has been called to set text visibility to FALSE. i.e. this is the character used in "password mode" to show the user how many characters have been typed. By default, GTK+ picks the best invisible char available in the current font. If you set the invisible char to 0, then the user will get no feedback at all; there will be no text on the screen as they type.
Unsets the invisible char previously set with gtk_entry_set_invisible_char(). So that the default invisible char is used again. Since 2.16
Sets the maximum allowed length of the contents of the widget. If the current contents are longer than the given length, then they will be truncated to fit.
Retrieves the value set by gtk_entry_set_activates_default().
Gets the value set by gtk_entry_set_has_frame().
Warning gtk_entry_get_inner_border has been deprecated since version 3.4 and should not be used in newly-written code. Use the standard border and padding CSS properties (through objects like GtkStyleContext and GtkCssProvider); the value returned by this function is ignored by GtkEntry. This function returns the entry's "inner-border" property. See gtk_entry_set_inner_border() for more information. Since 2.10
Gets the value set by gtk_entry_set_width_chars().
If setting is TRUE, pressing Enter in the entry will activate the default widget for the window containing the entry. This usually means that the dialog box containing the entry will be closed, since the default widget is usually one of the dialog buttons. (For experts: if setting is TRUE, the entry calls gtk_window_activate_default() on the window containing the entry, in the default handler for the "activate" signal.)
Sets whether the entry has a beveled frame around it.
Warning gtk_entry_set_inner_border has been deprecated since version 3.4 and should not be used in newly-written code. Use the standard border and padding CSS properties (through objects like GtkStyleContext and GtkCssProvider); the value set with this function is ignored by GtkEntry. Sets entry's inner-border property to border, or clears it if NULL is passed. The inner-border is the area around the entry's text, but inside its frame. If set, this property overrides the inner-border style property. Overriding the style-provided border is useful when you want to do in-place editing of some text in a canvas or list widget, where pixel-exact positioning of the entry is important. Since 2.10
Changes the size request of the entry to be about the right size for n_chars characters. Note that it changes the size request, the size can still be affected by how you pack the widget into containers. If n_chars is -1, the size reverts to the default entry size.
Retrieves the character displayed in place of the real characters for entries with visibility set to false. See gtk_entry_set_invisible_char().
Sets the alignment for the contents of the entry. This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry. Since 2.4
Gets the value set by gtk_entry_set_alignment(). Since 2.4
Sets text to be displayed in entry when it is empty and unfocused. This can be used to give a visual hint of the expected contents of the GtkEntry. Note that since the placeholder text gets removed when the entry received focus, using this feature is a bit problematic if the entry is given the initial focus in a window. Sometimes this can be worked around by delaying the initial focus setting until the first key event arrives.
Retrieves the text that will be displayed when entry is empty and unfocused
Sets whether the text is overwritten when typing in the GtkEntry. Since 2.14
Gets the value set by gtk_entry_set_overwrite_mode(). Since 2.14
Gets the PangoLayout used to display the entry. The layout is useful to e.g. convert text positions to pixel positions, in combination with gtk_entry_get_layout_offsets(). The returned layout is owned by the entry and must not be modified or freed by the caller. Keep in mind that the layout text may contain a preedit string, so gtk_entry_layout_index_to_text_index() and gtk_entry_text_index_to_layout_index() are needed to convert byte indices in the layout to byte indices in the entry contents.
Obtains the position of the PangoLayout used to render text in the entry, in widget coordinates. Useful if you want to line up the text in an entry with some other text, e.g. when using the entry to implement editable cells in a sheet widget. Also useful to convert mouse events into coordinates inside the PangoLayout, e.g. to take some action if some part of the entry text is clicked. Note that as the user scrolls around in the entry the offsets will change; you'll need to connect to the "notify::scroll-offset" signal to track this. Remember when using the PangoLayout functions you need to convert to and from pixels using PANGO_PIXELS() or PANGO_SCALE. Keep in mind that the layout text may contain a preedit string, so gtk_entry_layout_index_to_text_index() and gtk_entry_text_index_to_layout_index() are needed to convert byte indices in the layout to byte indices in the entry contents.
Converts from a position in the entry contents (returned by gtk_entry_get_text()) to a position in the entry's PangoLayout (returned by gtk_entry_get_layout(), with text retrieved via pango_layout_get_text()).
Converts from a position in the entry's PangoLayout (returned by gtk_entry_get_layout()) to a position in the entry contents (returned by gtk_entry_get_text()).
Sets a PangoAttrList; the attributes in the list are applied to the entry text.
Gets the attribute list that was set on the entry using gtk_entry_set_attributes(), if any.
Retrieves the maximum allowed length of the text in entry. See gtk_entry_set_max_length().
Retrieves whether the text in entry is visible. See gtk_entry_set_visibility().
Sets completion to be the auxiliary completion object to use with entry. All further configuration of the completion mechanism is done on completion using the GtkEntryCompletion API. Completion is disabled if completion is set to NULL. Since 2.4
Returns the auxiliary completion object currently in use by entry. Since 2.4
Hooks up an adjustment to the cursor position in an entry, so that when the cursor is moved, the adjustment is scrolled to show that position. See gtk_scrolled_window_get_hadjustment() for a typical way of obtaining the adjustment. The adjustment has to be in pixel units and in the same coordinate system as the entry. Since 2.12
Retrieves the horizontal cursor adjustment for the entry. See gtk_entry_set_cursor_hadjustment(). Since 2.12
Causes the entry's progress indicator to "fill in" the given fraction of the bar. The fraction should be between 0.0 and 1.0, inclusive. Since 2.16
Returns the current fraction of the task that's been completed. See gtk_entry_set_progress_fraction(). Since 2.16
Sets the fraction of total entry width to move the progress bouncing block for each call to gtk_entry_progress_pulse(). Since 2.16
Retrieves the pulse step set with gtk_entry_set_progress_pulse_step(). Since 2.16
Indicates that some progress is made, but you don't know how much. Causes the entry's progress indicator to enter "activity mode," where a block bounces back and forth. Each call to gtk_entry_progress_pulse() causes the block to move by a little bit (the amount of movement per pulse is determined by gtk_entry_set_progress_pulse_step()). Since 2.16
Allow the GtkEntry 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 GtkEntry. See gtk_text_view_reset_im_context() for an example of use. Since 2.22
Reset the input method context of the entry if needed. This can be necessary in the case where modifying the buffer would confuse on-going input method behavior. Since 2.22
Gets the tabstops that were set on the entry using gtk_entry_set_tabs(), if any.
Sets a PangoTabArray; the tabstops in the array are applied to the entry text.
Sets the icon shown in the specified position using a pixbuf. If pixbuf is NULL, no icon will be shown in the specified position. Since 2.16
Warning gtk_entry_set_icon_from_stock has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_entry_set_icon_from_icon_name() instead. Sets the icon shown in the entry at the specified position from a stock image. If stock_id is NULL, no icon will be shown in the specified position. Since 2.16
Sets the icon shown in the entry at the specified position from the current icon theme. If the icon name isn't known, a "broken image" icon will be displayed instead. If icon_name is NULL, no icon will be shown in the specified position. Since 2.16
Sets the icon shown in the entry at the specified position from the current icon theme. If the icon isn't known, a "broken image" icon will be displayed instead. If icon is NULL, no icon will be shown in the specified position. Since 2.16
Gets the type of representation being used by the icon to store image data. If the icon has no image data, the return value will be GTK_IMAGE_EMPTY. Since 2.16
Retrieves the image used for the icon. Unlike the other methods of setting and getting icon data, this method will work regardless of whether the icon was set using a GdkPixbuf, a GIcon, a stock item, or an icon name. Since 2.16
Warning gtk_entry_get_icon_stock has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_entry_get_icon_name() instead. Retrieves the stock id used for the icon, or NULL if there is no icon or if the icon was set by some other method (e.g., by pixbuf, icon name or gicon). Since 2.16
Retrieves the icon name used for the icon, or NULL if there is no icon or if the icon was set by some other method (e.g., by pixbuf, stock or gicon). Since 2.16
Retrieves the GIcon used for the icon, or NULL if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name). Since 2.16
Sets whether the icon is activatable. Since 2.16
Returns whether the icon is activatable. Since 2.16
Sets the sensitivity for the specified icon. Since 2.16
Returns whether the icon appears sensitive or insensitive. Since 2.16
Finds the icon at the given position and return its index. The position's coordinates are relative to the entry's top left corner. If x, y doesn't lie inside an icon, -1 is returned. This function is intended for use in a "query-tooltip" signal handler. Since 2.16
Sets tooltip as the contents of the tooltip for the icon at the specified position. Use NULL for tooltip to remove an existing tooltip. See also gtk_widget_set_tooltip_text() and gtk_entry_set_icon_tooltip_markup(). Since 2.16
Gets the contents of the tooltip on the icon at the specified position in entry. Since 2.16
Sets tooltip as the contents of the tooltip for the icon at the specified position. tooltip is assumed to be marked up with the Pango text markup language. Use NULL for tooltip to remove an existing tooltip. See also gtk_widget_set_tooltip_markup() and gtk_entry_set_icon_tooltip_text(). Since 2.16
Gets the contents of the tooltip on the icon at the specified position in entry. Since 2.16
Sets up the icon at the given position so that GTK+ will start a drag operation when the user clicks and drags the icon. To handle the drag operation, you need to connect to the usual "drag-data-get" (or possibly "drag-data-delete") signal, and use gtk_entry_get_current_icon_drag_source() in your signal handler to find out if the drag was started from an icon. By default, GTK+ uses the icon as the drag icon. You can use the "drag-begin" signal to set a different icon. Note that you have to use g_signal_connect_after() to ensure that your signal handler gets executed after the default handler. Since 2.16
Returns the index of the icon which is the source of the current DND operation, or -1. This function is meant to be used in a "drag-data-get" callback. Since 2.16
Gets the area where entry's icon at icon_pos is drawn. This function is useful when drawing something to the entry in a draw callback. If the entry is not realized or has no icon at the given position, icon_area is filled with zeros. See also gtk_entry_get_text_area()
Sets the "input-purpose" property which can be used by on-screen keyboards and other input methods to adjust their behaviour.
Gets the value of the "input-purpose" property.
Sets the "input-hints" property, which allows input methods to fine-tune their behaviour.
Gets the value of the "input-hints" property.
A GtkSpinButton is an ideal way to allow the user to set the value of some attribute. Rather than having to directly type a number into a GtkEntry, GtkSpinButton allows the user to click on one of two arrows to increment or decrement the displayed value. A value can still be typed in, with the bonus that it can be checked to ensure it is in a given range.
The main properties of a GtkSpinButton are through an adjustment. See the GtkAdjustment section for more details about an adjustment's properties.