HildonStackableWindow

HildonStackableWindow — Widget representing a stackable, top-level window in the Hildon framework.

Synopsis

                    HildonStackableWindow;
GtkWidget*          hildon_stackable_window_new         (void);
void                hildon_stackable_window_set_main_menu
                                                        (HildonStackableWindow *self,
                                                         HildonAppMenu *menu);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkWindow
                                       +----HildonWindow
                                             +----HildonStackableWindow

Implemented Interfaces

HildonStackableWindow implements AtkImplementorIface and GtkBuildable.

Description

The HildonStackableWindow is a GTK+ widget which represents a top-level window in the Hildon framework. 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 application's root window.

To add a window to the stack, just use gtk_widget_show(). The previous one will be automatically hidden. 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 hildon_program_pop_window_stack(). The window will be automatically hidden and the previous one will appear.

Example 2. Basic HildonStackableWindow example

static void
show_new_window (void)
{
    GtkWidget *win;

    win = hildon_stackable_window_new ();

    // ... configure new window

    // This automatically hides the previous 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;
}


Details

HildonStackableWindow

typedef struct _HildonStackableWindow HildonStackableWindow;


hildon_stackable_window_new ()

GtkWidget*          hildon_stackable_window_new         (void);

Creates a new HildonStackableWindow.

Returns : A HildonStackableWindow

hildon_stackable_window_set_main_menu ()

void                hildon_stackable_window_set_main_menu
                                                        (HildonStackableWindow *self,
                                                         HildonAppMenu *menu);

Sets the menu to be used for this window. Pass NULL to remove the current menu. Any reference to a previous menu will be dropped. HildonStackableWindow takes ownership of the passed menu and you're not supposed to free it yourself anymore.

Note that HildonStackableWindow widgets use HildonAppMenu rather than GtkMenu, so you're not supposed to use hildon_window_set_main_menu() with a HildonStackableWindow.

self : a HildonStackableWindow
menu : a HildonAppMenu to be used for this window