Assistant


Object Hierarchy:

Gtk.Assistant Gtk.Assistant Gtk.Assistant Gtk.Window Gtk.Window Gtk.Window->Gtk.Assistant Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.Window Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Container GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.Assistant Atk.Implementor->Gtk.Window Atk.Implementor->Gtk.Bin Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.Assistant Gtk.Buildable->Gtk.Window Gtk.Buildable->Gtk.Bin Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget

Description:

[ CCode ( type_id = "gtk_assistant_get_type ()" ) ]
public class Assistant : Window, Implementor, Buildable

A Assistant is a widget used to represent a generally complex operation splitted in several steps, guiding the user through its pages and controlling the page flow to collect the necessary data.

The design of GtkAssistant is that it controls what buttons to show and to make sensitive, based on what it knows about the page sequence and the type of each page, in addition to state information like the page completion and committed status.

If you have a case that doesn’t quite fit in Assistants way of handling buttons, you can use the CUSTOM page type and handle buttons yourself.

GtkAssistant as GtkBuildable

The GtkAssistant implementation of the Buildable interface exposes the action_area as internal children with the name “action_area”.

To add pages to an assistant in Builder, simply add it as a child to the GtkAssistant object, and set its child properties as necessary.

CSS nodes

GtkAssistant has a single CSS node with the name assistant.

GtkAssistant

Example: Assistant:

public static int main (string[] args) {
Gtk.init (ref args);

Gtk.Assistant assistant = new Gtk.Assistant ();
assistant.apply.connect (Gtk.main_quit);
assistant.cancel.connect (Gtk.main_quit);
assistant.set_default_size (500, 500);

Gtk.Label label1 = new Gtk.Label ("My first page");
int page_num = assistant.append_page (label1);
assistant.set_page_title (label1, "Page %d: My Intro".printf (page_num));
assistant.set_page_type (label1, Gtk.AssistantPageType.INTRO);
assistant.set_page_complete (label1, true);

Gtk.Label label2 = new Gtk.Label ("My second page");
page_num = assistant.append_page (label2);
assistant.set_page_title (label2, "Page %d: My Content".printf (page_num));
assistant.set_page_type (label2, Gtk.AssistantPageType.CONTENT);
assistant.set_page_complete (label2, true);

Gtk.Label label3 = new Gtk.Label ("My third page");
page_num = assistant.append_page (label3);
assistant.set_page_title (label3, "Page %d: Confirm".printf (page_num));
assistant.set_page_type (label3, Gtk.AssistantPageType.CONFIRM);
assistant.set_page_complete (label3, true);

assistant.show_all ();
Gtk.main ();
return 0;
}

valac --pkg gtk+-3.0 Gtk.Assistant.vala

Namespace: Gtk
Package: gtk+-3.0

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Window
All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Atk.Implementor



2022 vala-language.org