Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | eos_page_manager_new () |
GtkWidget * | eos_page_manager_get_page_left_topbar_widget () |
void | eos_page_manager_set_page_left_topbar_widget () |
GtkWidget * | eos_page_manager_get_page_center_topbar_widget () |
void | eos_page_manager_set_page_center_topbar_widget () |
const gchar * | eos_page_manager_get_page_background_uri () |
void | eos_page_manager_set_page_background_uri () |
const gchar * | eos_page_manager_get_page_background_size () |
void | eos_page_manager_set_page_background_size () |
const gchar * | eos_page_manager_get_page_background_position () |
void | eos_page_manager_set_page_background_position () |
gboolean | eos_page_manager_get_page_background_repeats () |
void | eos_page_manager_set_page_background_repeats () |
void | eos_page_manager_remove_page_by_name () |
gchar * | background-position | Read / Write |
gboolean | background-repeats | Read / Write |
gchar * | background-size | Read / Write |
gchar * | background-uri | Read / Write |
GtkWidget * | center-topbar-widget | Read / Write |
GtkWidget * | left-topbar-widget | Read / Write |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkStack ╰── EosPageManager
Your users experience your application as a series of pages — screens that present a small amount of information or show one feature before moving on to the next page or a previous page.
The page manager controls how these pages relate to each other. There are several different page managers available, each representing a different user interaction. The default page manager, described in this section of the manual, lets you add any number of pages and switch between them however you like, but there are also other, more specialized ones: for example, the EosSplashPageManager displays a splash screen and later turns control over to a different page or page manager when you signal it to; and the EosTabbedPageManager creates a tabbed interface in your window, much like the one in your browser.
Each window has a page manager; one is created by default when you create the window, but you can replace it by a different one. You can also nest page managers, one inside the other, in order to create more complex application flows.
A page can be any widget, most likely a container widget with other widgets inside it. To add a page to a page manager, call
1 |
gtk_container_add (GTK_CONTAINER (page_manager), page); |
If the added page is the only page, then the page manager will display it immediately. If the page manager was already displaying another page, then adding a new page will not change which page is displayed.
To get information about how to display the pages, for example the background image to use, the page manager reads the page's child properties. These are like regular properties, but instead of modifying the page, they modify the relationship between the page and the page manager that contains it. Most pages have at least a name and a background image as child properties. You can add a page with child properties as follows:
1 2 3 4 |
gtk_container_add_with_properties (GTK_CONTAINER (page_manager), page, "name", "front-page", "background_uri", "image.jpg", NULL); |
In Javascript, this has been simplified to use JSON:
1 2 3 4 |
page_manager.add(page, { name: 'front-page', background_uri: 'image.jpg' }); |
To remove a page, use gtk_container_remove()
or
eos_page_manager_remove_page_by_name()
.
If the removed page was the only page, then the page manager will display
nothing.
If there are multiple pages still in the page manager, you should never
remove the visible-child. Always set a new visible child before removing the
current one. A critical warning will be emitted if you remove the visible-
page when there are still other pages in the page manager.
In general, it is convenient to refer to a page by its name when dealing with the page manager, so you should make a point of giving all your pages names.
GtkWidget *
eos_page_manager_new (void
);
Creates a new default page manager.
GtkWidget * eos_page_manager_get_page_left_topbar_widget (EosPageManager *self
,GtkWidget *page
);
Retrieves page
's left topbar widget, if it has one.
See “left-topbar-widget” for more information.
void eos_page_manager_set_page_left_topbar_widget (EosPageManager *self
,GtkWidget *page
,GtkWidget *left_topbar_widget
);
Sets the left topbar widget to be displayed for this page
.
See “left-topbar-widget” for more information.
GtkWidget * eos_page_manager_get_page_center_topbar_widget (EosPageManager *self
,GtkWidget *page
);
Retrieves page
's center topbar widget, if it has one.
See “center-topbar-widget” for more information.
void eos_page_manager_set_page_center_topbar_widget (EosPageManager *self
,GtkWidget *page
,GtkWidget *center_topbar_widget
);
Sets the center topbar widget to be displayed for this page
.
See “center-topbar-widget” for more information.
const gchar * eos_page_manager_get_page_background_uri (EosPageManager *self
,GtkWidget *page
);
Gets the URI for the background image of page
, which must previously have
been added to the page manager.
See “background-uri” for more information.
void eos_page_manager_set_page_background_uri (EosPageManager *self
,GtkWidget *page
,const gchar *background
);
Changes the background of page
, which must previously have been added to the
page manager.
Setting NULL
removes the background, using the window's default background.
See “background-uri” for more information.
const gchar * eos_page_manager_get_page_background_size (EosPageManager *self
,GtkWidget *page
);
Gets the size of the background image of page
, which must previously have
been added to the page manager.
See “background-size” for more information.
void eos_page_manager_set_page_background_size (EosPageManager *self
,GtkWidget *page
,const gchar *size
);
Changes the size of the background of page
, which must previously have
been added to the page manager. See “background-size” for
more information.
const gchar * eos_page_manager_get_page_background_position (EosPageManager *self
,GtkWidget *page
);
Gets the position of the background image of page
, which must previously have
been added to the page manager.
See “background-position” for more information.
void eos_page_manager_set_page_background_position (EosPageManager *self
,GtkWidget *page
,const gchar *position
);
Changes the position of the background of page
, which must previously have
been added to the page manager. See “background-position” for
more information.
gboolean eos_page_manager_get_page_background_repeats (EosPageManager *self
,GtkWidget *page
);
Gets whether or not the background image of page
will tile when drawn.
page
must previously have been added to the page manager. See
“background-repeats” for more information.
void eos_page_manager_set_page_background_repeats (EosPageManager *self
,GtkWidget *page
,gboolean repeats
);
Sets whether or not the background image of page
will tile when drawn.
page
must previously have been added to the page manager. See
“background-repeats” for more information.
void eos_page_manager_remove_page_by_name (EosPageManager *self
,const gchar *name
);
Removes the page called name
from the page manager.
If that page was the only page, then the page manager will display nothing.
If that page was currently displaying but was not the only page, then the
page manager will display another page; which page is undefined.
To remove a page without looking it up by name, use gtk_container_remove()
.
“background-position”
child property “background-position” gchar *
The position of the page background, given as a css snippet string. This string can be set to any valid css position value. See https://developer.mozilla.org/en-US/docs/Web/CSS/position_value
Owner: EosPageManager
Flags: Read / Write
Default value: "0% 0%"
“background-repeats”
child property “background-repeats” gboolean
This child property controls whether or not the background of the page will tile when drawn. Defaults to TRUE.
Owner: EosPageManager
Flags: Read / Write
Default value: TRUE
“background-size”
child property “background-size” gchar *
The size of the page background, given as a css snippet string. This string can be set to any valid css value for the background-size property. See https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
Owner: EosPageManager
Flags: Read / Write
Default value: "100% 100%"
“background-uri”
child property “background-uri” gchar *
The URI for the image file for the background of this page. Setting this to
NULL
indicates that the window's default background should be used.
Owner: EosPageManager
Flags: Read / Write
Default value: NULL
“center-topbar-widget”
child property “center-topbar-widget” GtkWidget *
The center topbar widget belonging to this page, to be displayed on the
middle portion of the top bar when the page is displaying. Setting this to
NULL
indicates that there should be no center topbar widget.
Owner: EosPageManager
Flags: Read / Write
“left-topbar-widget”
child property “left-topbar-widget” GtkWidget *
The left topbar widget belonging to this page, to be displayed on the
left portion of the top bar when the page is displaying. Setting this to
NULL
indicates that there should be no left topbar widget.
Owner: EosPageManager
Flags: Read / Write