新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::Assistant

Gtk::Assistant クラス

A Gtk::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. Microsoft Windowsでは、このスタイルのウィンドウを使用したプログラムはウィサードと 呼ばれます。 <URL:https://developer.gnome.org/gtk3/stable/assistant.png>

Since 2.10

インクルードされているモジュール

  • Gtk::Buildable?
  • Atk::Implementor
  • GLib::Interface?

クラスメソッド

Gtk::Assistant.new()
Creates a new Gtk::Assistant. Since 2.10

インスタンスメソッド

current_page
Returns the page number of the current page. Since 2.10
  • Returns: The index (starting from 0) of the current page in the assistant, if the assistant has no pages, -1 will be returned.
current_page=(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 Gtk::Assistant#set_forward_page_func. Since 2.10
  • 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.
  • Returns: page_num
set_current_page()
要編集
n_pages()
要編集
get_n_pages

存在しない?

Returns the number of pages in the assistant. Since 2.10

  • Returns: The number of pages in the assistant.
get_nth_page(page_num)
Returns the child widget contained in page number page_num. Since 2.10
  • page_num: The index of a page in the assistant, or -1 to get the last page;
  • Returns: The child widget, or nil if page_num is out of bounds.
prepend_page(page)
Prepends a page to the assistant. Since 2.10
  • page: a Gtk::Widget
  • Returns: the index (starting at 0) of the inserted page
append_page(page)
Appends a page to the assistant. Since 2.10
  • page: a Gtk::Widget
  • Returns: the index (starting at 0) of the inserted page
insert_page(page, position)
Inserts a page in the assistant at a given position. Since 2.10
  • 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
set_forward_page_func(&block)
Sets the page forwarding function to be block, 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. Since 2.10
  • page_func: the block to use; passed argument is the page number used to calculate the next page, from which it must return the next page number
  • Returns: self
set_page_type(page, type)
Sets the page type for the specified page. The page type determines the page behavior in the assistant. Since 2.10
get_page_type(page)
Gets the page type of the specified page. Since 2.10
set_page_title(page, title)
Sets a title for the specified page. The title is displayed in the header area of the assistant when page is the current page. Since 2.10
  • page: a page of assistant
  • title: the new title for page
  • Returns: self
get_page_title(page)
Gets the title for the specified page. Since 2.10
  • page: a page of assistant
  • Returns: the title for page
set_page_header_image(page, pixbuf)
Sets a header image for the specified page. This image is displayed in the header area of the assistant when page is the current page. Since 2.10
  • page: a page of assistant
  • pixbuf: the new header image page (Gdk::Pixbuf)
  • Returns: self
get_page_header_image(page)
Gets the header image for the specified page. Since 2.10
  • page: a page of assistant
  • Returns: the header image for page, or nil if there's no header image for the page.
set_page_side_image(page, pixbuf)
Sets a header image for the specified page. This image is displayed in the side area of the assistant when page is the current page. Since 2.10
  • page: a page of assistant
  • pixbuf: the new header image page (Gdk::Pixbuf)
  • Returns: self
get_page_side_image(page)
Gets the header image for the specified page. Since 2.10
  • page: a page of assistant
  • Returns: the side image for page, or nil if there's no side image for the page.
set_page_complete(page, complete)
Sets whether specified page contents are complete. This will make assistant update the buttons state to be able to continue the task. Since 2.10
  • page: a page of assistant
  • complete: the completeness status of the page (true or false)
  • Returns: self
get_page_complete(page)
Gets whether page is complete. Since 2.10
  • page: a page of assistant
  • Returns: true if page is complete, otherwise false
add_action_widget(child)
Adds a widget to the action area of the assistant. Since 2.10
remove_action_widget(child)
Removes a widget from the action area of the assistant. Since 2.10
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 2.10

  • Returns: self
commit()
要編集

定数

GtkAssistantPageType

A value determining the page role inside the assistant. It's used to handle buttons sensitivity and visibility.

Note that an assistant needs to end its page flow with a page of type Gtk::Assistant::PAGE_CONFIRM or Gtk::Assistant::PAGE_SUMMARY to be correct.

PAGE_CONTENT
The page has regular contents. Since 2.10
PAGE_INTRO
The page contains an introduction to the assistant task. Since 2.10
PAGE_CONFIRM
The page lets the user confirm or deny the changes. Since 2.10
PAGE_SUMMARY
The page informs the user of the changes done. Since 2.10
PAGE_PROGRESS
Used for tasks that take a long time to complete, blocks the assistant until the page is marked as complete. Since 2.10

シグナル

apply: self (run last)

The "apply" signal is emitted when the apply button is clicked. The default behavior of the assistant is to switch to the page after the current page, unless the current page is the last one.

A handler for the "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 to put a page of type Gtk::Assistant::PAGE_PROGRESS after the confirmation page and handle this operation within the "prepare" signal of the progress page. Since 2.10

cancel: self (run last)
The "cancel" signal is emitted when then the cancel button is clicked. Since 2.10
close: self (run last)
The "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 2.10
prepare: self, page (run last)
The "prepared" 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 preparation which are necessary before showing page. Since 2.10
  • page: the current page

更新履歴

  • 2014-08-24 クラスのメンバ項目の存在チェック。リストから漏れているものを追加。 - きたがわ
  • 2006-07-16: new widget binded and documented for 2.10. - gc?

- gc?

更新日時:2014/08/24 11:30:09
キーワード:
参照:[Ruby/GTK] [Gtk::Assistant]