Gnome2::DruidPages contained within Gnome2::Druid. This section will look at the properties and methods available to Gnome2::DruidPageEdge and Gnome2::DruidPageStandard. These widgets are subclasses of Gnome2::DruidPage.
Gnome2::DruidPageEdgeThis widget serves as a start and end page of a Druid. It is a simple page that will only contain text. The properties of various elements of the page can be adjusted or changed. The above screen shot shows the various elements within the page. Not all of them need to be specified, and the defaults is more than sufficient.
To manipulate the properties of Gnome2::DruidPageEdge, consult the man page to view the available methods. These method names should be easy to follow.
Gnome2::DruidPageStandard This widget should be used for the inside pages of the Druid. It contains a Gtk2::VBox. This Gtk2::VBox is used to house other widgets. These widgets is then used to collect information from the user. They will typically be Gtk2::Entry, Gtk2::ComboBox or Gtk2::CheckButton widgets.
The Gnome2::DruidPageStandard has a convenience method to add widgets.
$druid_page_standard->append_item ($question, $item, $additional_info) * $question (string) * $item (Gtk2::Widget) * $additional_info (string)The value of
$question will be in a larger font, than $additional_info. Typically you will use $additional_info to supply a more guiding type of text for those persons not familiar with the question or procedure. A default value can also be mentioned here. $item does not have to be a simple widget, but may include Gtk2::Table's or Gtk2::VBox widgets.
Should you prefer to use the Gtk2::VBox without making use of the convenience method, you can extract it out of the Gnome2::DruidPageStandard object by using the following method:
widget = $druid_page_standard->vboxThis will return a blessed reference to the
Gtk2::VBox contained inside the Gnome2::DruidPageStandard.
To manipulate the properties of Gnome2::DruidPageStandard, consult the man page to view the available methods. These method names should be easy to follow.
Gnome2::Druid If you have a look at the man page of Gnome2::DruidPage you will find a list of signals. These signals gets triggered by Gnome2::Druid when a user click on the navigation buttons.
You should make use of these signals to implement error checking. This can prevent the user from going further, forcing them to supply required or correct information.
In this snippet we show such an implementation on the 'next' signal of a page.
$druid_page_start->signal_connect('next' => sub {
my $retval = &show_message_dialog($window,'question',"This does a check, continue?",'yes-no');
warn $retval."\n";
#If the return value is boolean TRUE, the event signal will be stopped from propagating,
# but if it is boolean FALSE, it will continue with the propagation of the signal
return FALSE if $retval =~ /yes/i;
return TRUE if $retval =~ /no/i;
});