Class: Gtk::Assistant
- Defined in:
- (unknown)
Overview
GtkAssistant is used to represent a complex as a series of steps.

Each step consists of one or more pages. GtkAssistant guides the user
through the pages, and controls the page flow to collect the data needed
for the operation.
GtkAssistant handles which buttons to show and to make sensitive based
on page sequence knowledge and the [enumGtk.AssistantPageType] of each
page in addition to state information like the completed and committed
page statuses.
If you have a case that doesn’t quite fit in GtkAssistants way of
handling buttons, you can use the %GTK_ASSISTANT_PAGE_CUSTOM page
type and handle buttons yourself.
GtkAssistant maintains a GtkAssistantPage object for each added
child, which holds additional per-child properties. You
obtain the GtkAssistantPage for a child with [methodGtk.Assistant.get_page].
GtkAssistant as GtkBuildable
The GtkAssistant implementation of the GtkBuildable interface
exposes the action_area as internal children with the name
“action_area”.
To add pages to an assistant in GtkBuilder, simply add it as a
child to the GtkAssistant object. If you need to set per-object
properties, create a GtkAssistantPage object explicitly, and
set the child widget as a property on it.
CSS nodes
GtkAssistant has a single CSS node with the name window and style
class .assistant.
Instance Method Summary collapse
-
#add_action_widget(child) ⇒ nil
Adds a widget to the action area of a
GtkAssistant. -
#append_page(page) ⇒ Integer
Appends a page to the assistant.
-
#commit ⇒ nil
Erases the visited page history.
-
#current_page ⇒ Integer
Returns the page number of the current page.
-
#current_page=(page_num) ⇒ nil
Switches the page to page_num.
-
#get_nth_page(page_num) ⇒ Gtk::Widget
Returns the child widget contained in page number page_num.
-
#get_page(child) ⇒ Gtk::AssistantPage
Returns the
GtkAssistantPageobject for child. -
#get_page_complete(page) ⇒ Boolean
Gets whether page is complete.
-
#get_page_title(page) ⇒ String
Gets the title for page.
-
#get_page_type(page) ⇒ Gtk::AssistantPageType
Gets the page type of page.
-
#initialize ⇒ Gtk::Widget
constructor
Creates a new
GtkAssistant. -
#insert_page(page, position) ⇒ Integer
Inserts a page in the assistant at a given position.
-
#n_pages ⇒ Integer
Returns the number of pages in the assistant.
-
#next_page ⇒ nil
Navigate to the next page.
-
#pages ⇒ Gio::ListModel
GListModelcontaining the pages. -
#pages=(pages) ⇒ Gio::ListModel
GListModelcontaining the pages. -
#prepend_page(page) ⇒ Integer
Prepends a page to the assistant.
-
#previous_page ⇒ nil
Navigate to the previous visited page.
-
#remove_action_widget(child) ⇒ nil
Removes a widget from the action area of a
GtkAssistant. -
#remove_page(page_num) ⇒ nil
Removes the page_num’s page from assistant.
-
#set_forward_page_func(page_func, data, destroy) ⇒ nil
Sets the page forwarding function to be page_func.
-
#set_page_complete(page, complete) ⇒ nil
Sets whether page contents are complete.
-
#set_page_title(page, title) ⇒ nil
Sets a title for page.
-
#set_page_type(page, type) ⇒ nil
Sets the page type for page.
-
#update_buttons_state ⇒ nil
Forces assistant to recompute the buttons state.
-
#use_header_bar ⇒ Integer
true if the assistant uses a
GtkHeaderBarfor action buttons instead of the action-area. -
#use_header_bar=(use_header_bar) ⇒ Integer
true if the assistant uses a
GtkHeaderBarfor action buttons instead of the action-area.
Methods inherited from Window
#application, #application=, auto_startup_notification=, #child, #child=, #close, #decorated, #decorated=, #decorated?, #default_height, #default_height=, default_icon_name, default_icon_name=, #default_widget, #default_widget=, #default_width, #default_width=, #deletable, #deletable=, #deletable?, #destroy, #destroy_with_parent, #destroy_with_parent=, #destroy_with_parent?, #display, #display=, #focus, #focus=, #focus_visible, #focus_visible=, #focus_visible?, #focus_widget, #focus_widget=, #fullscreen, #fullscreen_on_monitor, #fullscreened=, #fullscreened?, #get_default_size, #group, #handle_menubar_accel, #handle_menubar_accel=, #handle_menubar_accel?, #has_group, #hide_on_close, #hide_on_close=, #hide_on_close?, #icon_name, #icon_name=, interactive_debugging=, #is_active, #is_active=, #is_active?, #is_fullscreen, #is_maximized, #is_suspended, list_toplevels, #maximize, #maximized=, #maximized?, #minimize, #mnemonics_visible, #mnemonics_visible=, #mnemonics_visible?, #modal, #modal=, #modal?, #present, #present_with_time, #resizable, #resizable=, #resizable?, #set_default_size, #startup_id=, #suspended=, #suspended?, #title, #title=, #titlebar, #titlebar=, toplevels, #transient_for, #transient_for=, #unfullscreen, #unmaximize, #unminimize
Methods inherited from Widget
#accessible_role, #accessible_role=, #action_set_enabled, #activate, #activate_action, #activate_action_variant, #activate_default, #activate_signal, #activate_signal=, #activate_signal_from_name=, #add_binding, #add_binding_action, #add_binding_signal, #add_controller, #add_css_class, #add_mnemonic_label, #add_shortcut, #add_tick_callback, #allocate, #allocated_baseline, #allocated_height, #allocated_width, #baseline, #bind_template_callback_full, #bind_template_child_full, #can_focus, #can_focus=, #can_focus?, #can_target, #can_target=, #can_target?, #child_focus, #child_visible, #child_visible=, #clipboard, #compute_bounds, #compute_expand, #compute_point, #compute_transform, #contains, #create_pango_context, #create_pango_layout, #css_classes, #css_classes=, #css_name, #css_name=, #cursor, #cursor=, #cursor_from_name=, default_direction, default_direction=, #direction, #direction=, #display, #dispose_template, #drag_check_threshold, #error_bell, #first_child, #focus_child, #focus_child=, #focus_on_click, #focus_on_click=, #focus_on_click?, #focusable, #focusable=, #focusable?, #font_map, #font_map=, #font_options, #font_options=, #frame_clock, #get_allocation, #get_ancestor, #get_color, #get_preferred_size, #get_size, #get_size_request, #get_template_child, #grab_focus, #halign, #halign=, #has_css_class, #has_default, #has_default=, #has_default?, #has_focus, #has_focus=, #has_focus?, #has_tooltip, #has_tooltip=, #has_tooltip?, #has_visible_focus, #height, #height_request, #height_request=, #hexpand, #hexpand=, #hexpand?, #hexpand_set, #hexpand_set=, #hexpand_set?, #hide, #in_destruction, #init_template, #insert_action_group, #insert_after, #insert_before, #install_action, #install_property_action, #is_ancestor, #is_drawable, #is_focus, #is_sensitive, #is_visible, #keynav_failed, #last_child, #layout_manager, #layout_manager=, #layout_manager_type, #layout_manager_type=, #list_mnemonic_labels, #map, #mapped, #margin_bottom, #margin_bottom=, #margin_end, #margin_end=, #margin_start, #margin_start=, #margin_top, #margin_top=, #measure, #mnemonic_activate, #name, #name=, #native, #next_sibling, #observe_children, #observe_controllers, #opacity, #opacity=, #overflow, #overflow=, #pango_context, #parent, #parent=, #pick, #prev_sibling, #primary_clipboard, #query_action, #queue_allocate, #queue_draw, #queue_resize, #realize, #realized, #receives_default, #receives_default=, #receives_default?, #remove_controller, #remove_css_class, #remove_mnemonic_label, #remove_tick_callback, #request_mode, #root, #root=, #scale_factor, #scale_factor=, #sensitive, #sensitive=, #sensitive?, #set_size_request, #set_state_flags, #settings, #should_layout, #show, #size_allocate, #snapshot_child, #state_flags, #style_context, #template=, #template_from_resource=, #template_scope=, #tooltip_markup, #tooltip_markup=, #tooltip_text, #tooltip_text=, #translate_coordinates, #trigger_tooltip_query, #unmap, #unparent, #unrealize, #unset_state_flags, #valign, #valign=, #vexpand, #vexpand=, #vexpand?, #vexpand_set, #vexpand_set=, #vexpand_set?, #visible, #visible=, #visible?, #width, #width_request, #width_request=
Constructor Details
#initialize ⇒ Gtk::Widget
Creates a new GtkAssistant.
Instance Method Details
#add_action_widget(child) ⇒ nil
Adds a widget to the action area of a GtkAssistant.
#append_page(page) ⇒ Integer
Appends a page to the assistant.
#commit ⇒ nil
Erases the visited page history.
GTK will then hide the back button on the current page, and removes the cancel button from subsequent pages.
Use this when the information provided up to the current page is hereafter deemed permanent and cannot be modified or undone. For example, showing a progress page to track a long-running, unreversible operation after the user has clicked apply on a confirmation page.
#current_page ⇒ Integer
Returns the page number of the current page.
#current_page=(page_num) ⇒ nil
Switches the page to page_num.
Note that this will only be necessary in custom buttons, as the assistant flow can be set with gtk_assistant_set_forward_page_func().
#get_nth_page(page_num) ⇒ Gtk::Widget
Returns the child widget contained in page number page_num.
#get_page(child) ⇒ Gtk::AssistantPage
Returns the GtkAssistantPage object for child.
#get_page_complete(page) ⇒ Boolean
Gets whether page is complete.
#get_page_title(page) ⇒ String
Gets the title for page.
#get_page_type(page) ⇒ Gtk::AssistantPageType
Gets the page type of page.
#insert_page(page, position) ⇒ Integer
Inserts a page in the assistant at a given position.
#n_pages ⇒ Integer
Returns the number of pages in the assistant
#next_page ⇒ nil
Navigate to the next page.
It is a programming error to call this function when there is no next page.
This function is for use when creating pages of the %GTK_ASSISTANT_PAGE_CUSTOM type.
#pages ⇒ Gio::ListModel
GListModel containing the pages.
#pages=(pages) ⇒ Gio::ListModel
GListModel containing the pages.
#prepend_page(page) ⇒ Integer
Prepends a page to the assistant.
#previous_page ⇒ nil
Navigate to the previous visited page.
It is a programming error to call this function when no previous page is available.
This function is for use when creating pages of the %GTK_ASSISTANT_PAGE_CUSTOM type.
#remove_action_widget(child) ⇒ nil
Removes a widget from the action area of a GtkAssistant.
#remove_page(page_num) ⇒ nil
Removes the page_num’s page from assistant.
#set_forward_page_func(page_func, data, destroy) ⇒ nil
Sets the page forwarding function to be page_func.
This function will be used to determine what will be the next page when the user presses the forward button. Setting page_func to nil will make the assistant to use the default forward function, which just goes to the next visible page.
#set_page_complete(page, complete) ⇒ nil
Sets whether page contents are complete.
This will make assistant update the buttons state to be able to continue the task.
#set_page_title(page, title) ⇒ nil
Sets a title for page.
The title is displayed in the header area of the assistant when page is the current page.
#set_page_type(page, type) ⇒ nil
Sets the page type for page.
The page type determines the page behavior in the assistant.
#update_buttons_state ⇒ nil
Forces assistant to recompute the buttons state.
GTK automatically takes care of this in most situations, e.g. when the user goes to a different page, or when the visibility or completeness of a page changes.
One situation where it can be necessary to call this function is when changing a value on the current page affects the future page flow of the assistant.
#use_header_bar ⇒ Integer
true if the assistant uses a GtkHeaderBar for action buttons
instead of the action-area.
For technical reasons, this property is declared as an integer property, but you should only set it to true or false.
#use_header_bar=(use_header_bar) ⇒ Integer
true if the assistant uses a GtkHeaderBar for action buttons
instead of the action-area.
For technical reasons, this property is declared as an integer property, but you should only set it to true or false.