gtkmm 3.3.18

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Related Functions
Gtk::Assistant Class Reference
Dialogs

A widget used to guide users through multi-step operations. More...

Inheritance diagram for Gtk::Assistant:
[legend]

List of all members.

## Public Types
typedef sigc::slot< int, int > | SlotForwardPage
## Public Member Functions
virtual | ~Assistant ()
GtkAssistant* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkAssistant* | gobj () const
| Provides access to the underlying C GtkObject.
| Assistant ()
void | next_page ()
| Navigate to the next page.
void | previous_page ()
| Navigate to the previous visited page.
int | get_current_page () const
| Returns the page number of the current page.
void | set_current_page (int page_num)
| Switches the page to page_num.
int | get_n_pages () const
| Returns the number of pages in the assistant.
Widget* | get_nth_page (int page_num)
| Returns the child widget contained in page number page_num.
const Widget* | get_nth_page (int page_num) const
| Returns the child widget contained in page number page_num.
int | prepend_page (Widget& page)
| Prepends a page to the assistant.
int | append_page (Widget& page)
| Appends a page to the assistant.
int | insert_page (Widget& page, int position)
| Inserts a page in the assistant at a given position.
void | remove_page (int page_num)
| Removes the page_num's page from assistant.
void | set_forward_page_func (const SlotForwardPage& slot)
void | set_page_type (const Widget& page, AssistantPageType type)
| Sets the page type for page.
AssistantPageType | get_page_type (const Widget& page) const
| Gets the page type of page.
void | set_page_title (const Widget& page, const Glib::ustring& title)
| Sets a title for page.
Glib::ustring | get_page_title (const Widget& page) const
| Gets the title for page.
void | set_page_header_image (const Widget& page, const Glib::RefPtr< Gdk::Pixbuf >& pixbuf)
| Sets a header image for page.
Glib::RefPtr< Gdk::Pixbuf > | get_page_header_image (const Widget& page)
| Gets the header image for page.
Glib::RefPtr< const Gdk::Pixbuf > | get_page_header_image (const Widget& page) const
| Gets the header image for page.
void | set_page_side_image (const Widget& page, const Glib::RefPtr< Gdk::Pixbuf >& pixbuf)
| Sets a side image for page.
Glib::RefPtr< Gdk::Pixbuf > | get_page_side_image (const Widget& page)
| Gets the side image for page.
Glib::RefPtr< const Gdk::Pixbuf > | get_page_side_image (const Widget& page) const
| Gets the side image for page.
void | set_page_complete (const Widget& page, bool complete=true)
| Sets whether page contents are complete.
bool | get_page_complete (const Widget& page) const
| Gets whether page is complete.
void | add_action_widget (Widget& child)
| Adds a widget to the action area of a Gtk::Assistant.
void | remove_action_widget (Widget& child)
| Removes a widget from the action area of a Gtk::Assistant.
void | update_buttons_state ()
| Forces assistant to recompute the buttons state.
void | commit ()
| Erases the visited page history so the back button is not shown on the current page, and removes the cancel button from subsequent pages.
Glib::SignalProxy1< void, Gtk::Widget* > | signal_prepare ()
Glib::SignalProxy0< void > | signal_apply ()
Glib::SignalProxy0< void > | signal_close ()
Glib::SignalProxy0< void > | signal_cancel ()
## Protected Member Functions
virtual void | on_prepare (Gtk::Widget* page)
| This is a default handler for the signal signal_prepare().
virtual void | on_apply ()
| This is a default handler for the signal signal_apply().
virtual void | on_close ()
| This is a default handler for the signal signal_close().
virtual void | on_cancel ()
| This is a default handler for the signal signal_cancel().
## Related Functions
(Note that these are not member functions.)
Gtk::Assistant* | wrap (GtkAssistant* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A widget used to guide users through multi-step operations.

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

Since gtkmm 2.10:

## Member Typedef Documentation

typedef sigc::slot<int, int > Gtk::Assistant::SlotForwardPage

## Constructor & Destructor Documentation

virtual Gtk::Assistant::~Assistant | ( |  | ) | `[virtual]`

Gtk::Assistant::Assistant | ( |  | ) |

## Member Function Documentation

void Gtk::Assistant::add_action_widget | ( | Widget& | child | ) |

Adds a widget to the action area of a Gtk::Assistant.

Since gtkmm 2.10:

Parameters:

  child | A Gtk::Widget.

int Gtk::Assistant::append_page | ( | Widget& | page | ) |

Appends a page to the assistant.

Since gtkmm 2.10:

Parameters:

  page | A Gtk::Widget.

Returns:
  The index (starting at 0) of the inserted page.

void Gtk::Assistant::commit | ( |  | ) |

Erases the visited page history so the back button is not shown 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.

Since gtkmm 2.22:

int Gtk::Assistant::get_current_page | ( |  | ) | const

Returns the page number of the current page.

Since gtkmm 2.10:

Returns:
  The index (starting from 0) of the current page in the assistant, or -1 if the assistant has no pages, or no current page.

int Gtk::Assistant::get_n_pages | ( |  | ) | const

Returns the number of pages in the assistant.

Since gtkmm 2.10:

Returns:
  The number of pages in the assistant.

const Widget* Gtk::Assistant::get_nth_page | ( | int | page_num | ) | const

Returns the child widget contained in page number page_num.

Since gtkmm 2.10:

Parameters:

  page_num | The index of a page in the assistant, or -1 to get the last page.

Returns:
  The child widget, or `0` if page_num is out of bounds.

Widget* Gtk::Assistant::get_nth_page | ( | int | page_num | ) |

Returns the child widget contained in page number page_num.

Since gtkmm 2.10:

Parameters:

  page_num | The index of a page in the assistant, or -1 to get the last page.

Returns:
  The child widget, or `0` if page_num is out of bounds.

bool Gtk::Assistant::get_page_complete | ( | const Widget& | page | ) | const

Gets whether page is complete.

Since gtkmm 2.10:

Parameters:

  page | A page of assistant.

Returns:
  `true` if page is complete.

Glib::RefPtr<Gdk::Pixbuf> Gtk::Assistant::get_page_header_image | ( | const Widget& | page | ) |

Gets the header image for page.

Since gtkmm 2.10:

Deprecated: 3.2: Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.

Deprecated:
  A header is no longer shown. Add your header decoration to the page content instead.

Parameters:

  page | A page of assistant.

Returns:
  The header image for page, or `0` if there's no header image for the page.

Glib::RefPtr<const Gdk::Pixbuf> Gtk::Assistant::get_page_header_image | ( | const Widget& | page | ) | const

Gets the header image for page.

Since gtkmm 2.10:

Deprecated: 3.2: Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.

Deprecated:
  A header is no longer shown. Aadd your header decoration to the page content instead.

Parameters:

  page | A page of assistant.

Returns:
  The header image for page, or `0` if there's no header image for the page.

Glib::RefPtr<Gdk::Pixbuf> Gtk::Assistant::get_page_side_image | ( | const Widget& | page | ) |

Gets the side image for page.

Since gtkmm 2.10:

Deprecated: 3.2: Since GTK+ 3.2, sidebar images are not shown anymore.

Deprecated:
  Sidebar images are not shown anymore..

Parameters:

  page | A page of assistant.

Returns:
  The side image for page, or `0` if there's no side image for the page.

Glib::RefPtr<const Gdk::Pixbuf> Gtk::Assistant::get_page_side_image | ( | const Widget& | page | ) | const

Gets the side image for page.

Since gtkmm 2.10:

Deprecated: 3.2: Since GTK+ 3.2, sidebar images are not shown anymore.

Deprecated:
  Sidebar images are not shown anymore.

Parameters:

  page | A page of assistant.

Returns:
  The side image for page, or `0` if there's no side image for the page.

Glib::ustring Gtk::Assistant::get_page_title | ( | const Widget& | page | ) | const

Gets the title for page.

Since gtkmm 2.10:

Parameters:

  page | A page of assistant.

Returns:
  The title for page.

AssistantPageType Gtk::Assistant::get_page_type | ( | const Widget& | page | ) | const

Gets the page type of page.

Since gtkmm 2.10:

Parameters:

  page | A page of assistant.

Returns:
  The page type of page.

const GtkAssistant* Gtk::Assistant::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Window.

GtkAssistant* Gtk::Assistant::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Window.

int Gtk::Assistant::insert_page | ( | Widget& | page,
|  | int | position
| ) |  |

Inserts a page in the assistant at a given position.

Since gtkmm 2.10:

Parameters:

  page | A Gtk::Widget.
  position | The index (starting at 0) at which to insert the page, or -1 to append the page to the assistant.

Returns:
  The index (starting from 0) of the inserted page.

void Gtk::Assistant::next_page | ( |  | ) |

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.

Since gtkmm 3.0:

virtual void Gtk::Assistant::on_apply | ( |  | ) | `[protected, virtual]`

This is a default handler for the signal signal_apply().

virtual void Gtk::Assistant::on_cancel | ( |  | ) | `[protected, virtual]`

This is a default handler for the signal signal_cancel().

virtual void Gtk::Assistant::on_close | ( |  | ) | `[protected, virtual]`

This is a default handler for the signal signal_close().

virtual void Gtk::Assistant::on_prepare | ( | Gtk::Widget* | page | ) | `[protected, virtual]`

This is a default handler for the signal signal_prepare().

int Gtk::Assistant::prepend_page | ( | Widget& | page | ) |

Prepends a page to the assistant.

Since gtkmm 2.10:

Parameters:

  page | A Gtk::Widget.

Returns:
  The index (starting at 0) of the inserted page.

void Gtk::Assistant::previous_page | ( |  | ) |

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.

Since gtkmm 3.0:

void Gtk::Assistant::remove_action_widget | ( | Widget& | child | ) |

Removes a widget from the action area of a Gtk::Assistant.

Since gtkmm 2.10:

Parameters:

  child | A Gtk::Widget.

void Gtk::Assistant::remove_page | ( | int | page_num | ) |

Removes the page_num's page from assistant.

Since gtkmm 3.2:

Parameters:

  page_num | The index of a page in the assistant, or -1 to remove the last page.

void Gtk::Assistant::set_current_page | ( | int | page_num | ) |

Switches the page to page_num.

Note that this will only be necessary in custom buttons, as the assistant flow can be set with set_forward_page_func().

Since gtkmm 2.10:

Parameters:

  page_num | Index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the assistant, nothing will be done.

void Gtk::Assistant::set_forward_page_func | ( | const SlotForwardPage & | slot | ) |

void Gtk::Assistant::set_page_complete | ( | const Widget& | page,
|  | bool | complete = `true`
| ) |  |

Sets whether page contents are complete.

This will make assistant update the buttons state to be able to continue the task.

Since gtkmm 2.10:

Parameters:

  page | A page of assistant.
  complete | The completeness status of the page.

void Gtk::Assistant::set_page_header_image | ( | const Widget& | page,
|  | const Glib::RefPtr< Gdk::Pixbuf >& | pixbuf
| ) |  |

Sets a header image for page.

Since gtkmm 2.10:

Deprecated: 3.2: Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.

Deprecated:
  A header is no longer shown. Add your header decoration to the page content instead.

Parameters:

  page | A page of assistant.
  pixbuf | The new header image page.

void Gtk::Assistant::set_page_side_image | ( | const Widget& | page,
|  | const Glib::RefPtr< Gdk::Pixbuf >& | pixbuf
| ) |  |

Sets a side image for page.

This image used to be displayed in the side area of the assistant when page is the current page.

Since gtkmm 2.10:

Deprecated: 3.2: Since GTK+ 3.2, sidebar images are not shown anymore.

Deprecated:
  Sidebar images are not shown anymore..

Parameters:

  page | A page of assistant.
  pixbuf | The new side image page.

void Gtk::Assistant::set_page_title | ( | const Widget& | page,
|  | const Glib::ustring & | title
| ) |  |

Sets a title for page.

The title is displayed in the header area of the assistant when page is the current page.

Since gtkmm 2.10:

Parameters:

  page | A page of assistant.
  title | The new title for page.

void Gtk::Assistant::set_page_type | ( | const Widget& | page,
|  | AssistantPageType | type
| ) |  |

Sets the page type for page.

The page type determines the page behavior in the assistant.

Since gtkmm 2.10:

Parameters:

  page | A page of assistant.
  type | The new type for page.

Glib::SignalProxy0< void > Gtk::Assistant::signal_apply | ( |  | ) |

Slot Prototype:
  `void on_my_apply()`

The signal_apply() signal is emitted when the apply button is clicked.

The default behavior of the Gtk::Assistant is to switch to the page after the current page, unless the current page is the last one.

A handler for the signal_apply() signal should carry out the actions for which the wizard has collected data. If the action takes a long time to complete, you might consider putting a page of type Gtk::ASSISTANT_PAGE_PROGRESS after the confirmation page and handle this operation within the Gtk::Assistant::signal_prepare() signal of the progress page.

Since gtkmm 2.10:

Glib::SignalProxy0< void > Gtk::Assistant::signal_cancel | ( |  | ) |

Slot Prototype:
  `void on_my_cancel()`

The signal_cancel() signal is emitted when then the cancel button is clicked.

Since gtkmm 2.10:

Glib::SignalProxy0< void > Gtk::Assistant::signal_close | ( |  | ) |

Slot Prototype:
  `void on_my_close()`

The signal_close() signal is emitted either when the close button of a summary page is clicked, or when the apply button in the last page in the flow (of type Gtk::ASSISTANT_PAGE_CONFIRM) is clicked.

Since gtkmm 2.10:

Glib::SignalProxy1< void,Gtk::Widget* > Gtk::Assistant::signal_prepare | ( |  | ) |

Slot Prototype:
  `void on_my_prepare(Gtk::Widget* page)`

The signal_prepare() signal is emitted when a new page is set as the assistant's current page, before making the new page visible.

A handler for this signal can do any preparations which are necessary before showing page.

Since gtkmm 2.10:

Parameters:

  page | The current page.

void Gtk::Assistant::update_buttons_state | ( |  | ) |

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.

Since gtkmm 2.10:

## Friends And Related Function Documentation

Gtk::Assistant* wrap | ( | GtkAssistant * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/assistant.h