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);
HildonWindowStack*  hildon_stackable_window_get_stack   (HildonStackableWindow *self);

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.

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 they appear as if they were hidden.

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 hildon_window_stack_pop(). The window will be automatically hidden and the previous one will appear.

For advanced details on stack handling, see HildonWindowStack

Example 2. 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;
}


Details

HildonStackableWindow

typedef struct _HildonStackableWindow HildonStackableWindow;


hildon_stackable_window_new ()

GtkWidget*          hildon_stackable_window_new         (void);

Creates a new HildonStackableWindow.

Returns : A HildonStackableWindow

Since 2.2


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

Since 2.2


hildon_stackable_window_get_stack ()

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

See Also

HildonWindowStack