Hildon Reference Manual | ||||
---|---|---|---|---|
#include <hildon/hildon.h> HildonStackableWindow; GtkWidget* hildon_stackable_window_new (void); HildonWindowStack* hildon_stackable_window_get_stack (HildonStackableWindow *self); void hildon_stackable_window_set_main_menu (HildonStackableWindow *self, HildonAppMenu *menu);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkWindow +----HildonWindow +----HildonStackableWindow
HildonStackableWindow is a top-level window that can be stacked on top of others. It is derived from HildonWindow. Applications that use stackable windows are organized in a hierarchical way so users can go from any window back to the previous one or directly to the stack's root window.
The user can only see and interact with the window on top of the stack. Although all other windows are mapped and visible, they are obscured by the topmost one so in practice the user will see the whole stack as if it was a single window.
To add a window to the stack, just use gtk_widget_show()
. The
previous one will be obscured by the new one. When the new window
is destroyed, the previous one will appear again.
Alternatively, you can remove a window from the top of the stack
without destroying it by using gtk_widget_hide()
. The window will
be hidden and the previous one will appear automatically.
It is important to note that all HildonStackableWindows on a stack are always mapped and visible (from the Gtk point of view) and all visible HildonStackableWindows are always on a stack.
To see how to manage multiple stacks per application and for other advanced details on stack handling, see HildonWindowStack
Example 4. Basic HildonStackableWindow example
static void show_new_window (void) { GtkWidget *win; win = hildon_stackable_window_new (); // ... configure new window gtk_widget_show (win); } int main (int argc, char **argv) { GtkWidget *win; GtkWidget *button; gtk_init (&argc, &args); win = hildon_stackable_window_new (); gtk_window_set_title (GTK_WINDOW (win), "Main window); // ... add some widgets to the window g_signal_connect (button, "clicked", G_CALLBACK (show_new_window), NULL); g_signal_connect (win, "destroy", G_CALLBACK (gtk_main_quit), NULL); gtk_widget_show_all (win); gtk_main (); return 0; }
GtkWidget* hildon_stackable_window_new (void);
Creates a new HildonStackableWindow.
Returns : | A HildonStackableWindow |
Since 2.2
HildonWindowStack* hildon_stackable_window_get_stack (HildonStackableWindow *self);
Returns the stack where window self
is on, or NULL
if the window
is not stacked.
self : |
a HildonStackableWindow |
Returns : | a HildonWindowStack, or NULL
|
Since 2.2
void hildon_stackable_window_set_main_menu (HildonStackableWindow *self, HildonAppMenu *menu);
hildon_stackable_window_set_main_menu
is deprecated and should not be used in newly-written code. Hildon 2.2: use hildon_window_set_app_menu()
Sets the menu to be used for this window.
self : |
a HildonStackableWindow |
menu : |
a HildonAppMenu to be used for this window |