GTK gossip: gtkassistant

Source: Internet
Author: User
Tags gtk

During application security or user authentication and configuration, you can provide the user's "Wizard" for selection, configuration, and information filling, in the step by step process, the user is prompted to complete all the necessary options for setting or filling in information. The refined parameters can be provided by using gtkassistant.
This function.


Gtkassistant
In each step, you need to upload a gtkwidget.
Yes
You can design a gtkwidget in advance. When you move the component placement, layout management, configuration sheet, and topic, you can use gtk_assistant_append_page.
() A plane attached to gtkassistant, and then use gtk_assistant_set_page_type () to set the plane type:

  • Gtk_assistant_page_content: general content plane
  • Gtk_assistant_page_intro: Specifies the starting point of the refined interface.
  • Gtk_assistant_page_confirm: confirm the plane, usually the end of the refined line
  • Gtk_assistant_page_summary: indicates the user's change information
  • Gtk_assistant_page_progress: Progress plane. It is usually a step in the refined environment.

"Next" (for example, gtk_assistant_page_intro or gtk_assistant_page_progress) or "Set
"(For example, gtk_assistant_page_confirm) cannot be used.
Gtk_assistant_set_page_complete () and set the complete value to true. Click "Next" or "Apply" to apply.

The following program is a simple example. The program will use gtkassistant to create an excellent example:

  • Gtkassistant_demo.c


# Include <GTK/GTK. h>

Gtkwidget * gtk_assistant_page_new (gtkwidget * assistant,
Gtkwidget * widget,
Gchar * title,
Gchar * image,
Gtkassistantpagetype type ){
Gtk_assistant_append_page (gtk_assistant (Assistant), widget );
Gtk_assistant_set_page_title (gtk_assistant (Assistant), widget, title );
Gtk_assistant_set_page_side_image (gtk_assistant ),
Widget, gdk_pixbuf_new_from_file (image, null ));
Gtk_assistant_set_page_type (gtk_assistant (Assistant), widget, type );
Gtk_assistant_set_page_complete (gtk_assistant (Assistant), widget, true );

Return Assistant;
}

Int main (INT argc, char * argv []) {
Gtkwidget * Assistant;
Gtkwidget * label;

Gtk_init (& argc, & argv );

Assistant = gtk_assistant_new ();
Gtk_window_set_title (gtk_window (Assistant), "gtkassistant ");
Gtk_window_set_default_size (gtk_window (Assistant), 300,180 );

Gtk_assistant_page_new (Assistant, gtk_label_new (" "),
"Starting from", "caterpillar.jpg", gtk_assistant_page_intro );
Gtk_assistant_page_new (Assistant, gtk_label_new ("express content or component "),
"Refined second region", "caterpillar.jpg", gtk_assistant_page_progress );
Gtk_assistant_page_new (Assistant, gtk_label_new ("express content or component "),
"Refined Third Region", "caterpillar.jpg", gtk_assistant_page_progress );
Gtk_assistant_page_new (Assistant, gtk_label_new ("express content or component "),
"Refined links", "caterpillar.jpg", gtk_assistant_page_confirm );

G_signal_connect (gtk_object (Assistant), "cancel ",
G_callback (gtk_main_quit), null );

Gtk_widget_show_all (Assistant );

Gtk_main ();

Return 0;
}


The results of a line are as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.