manpagez: man pages & more
html files: gtk2
Home | html | info | man

Setting the page flow

Here is the area where GtkAssistant and GnomeDruid differ the most. While GnomeDruid used the "next" and "back" signals from the GnomeDruidPage, GtkAssistant uses the following techniques:

  • gtk_assistant_set_forward_page_func(): Allows to define a GtkAssistantPageFunc to let the assistant know which will be the following page given the current page.

  • gtk_assistant_set_page_complete(): Lets the assistant know whether the specified page is complete or not, updating buttons state accordingly.

  • gtk_assistant_set_page_type(): Lets the assistant know the page role and update the buttons state accordingly. Pages can have the following roles:

    Intro
    Content
    Progress
    Confirmation
    Summary

A sample GtkAssistantPageFunc could look like this:

static gint
forward_page_function (gint     current_page,
                       gpointer data)
{
  switch (current_page)
    {
    case 0:
      return 1;
    case 1:
      if (check_page1_data ())
	   return 2;
	 else
	   return 3;
    case 2:
      return 3;
    default:
      return -1;
    }
}
    
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.