HildonWindow

HildonWindow — Widget representing a top-level window in the Hildon framework.

Synopsis




#define     HILDON_WINDOW_LONG_PRESS_TIME
            HildonWindowPrivate;
GtkWidget*  hildon_window_new               (void);
void        hildon_window_add_with_scrollbar
                                            (HildonWindow *self,
                                             GtkWidget *child);
GtkMenu*    hildon_window_get_menu          (HildonWindow *self);
void        hildon_window_set_menu          (HildonWindow *self,
                                             GtkMenu *menu);
void        hildon_window_add_toolbar       (HildonWindow *self,
                                             GtkToolbar *toolbar);
void        hildon_window_remove_toolbar    (HildonWindow *self,
                                             GtkToolbar *toolbar);
gboolean    hildon_window_get_is_topmost    (HildonWindow *self);

Description

The HildonWindow is a GTK widget which represents a top-level window in the Hildon framework. It is derived from the GtkWindow and provides additional commodities specific to the Hildon framework. Among these windows in the Hildon framework can have a single menu attached, which is toggled with a hardware key or by tapping a custom button in the window frame. This menu can be set by providing a GtkMenu to the hildon_window_set_menu() method. Similarly a window in the Hildon framework can have several toolbars attached. These can be added to the HildonWindow with hildon_window_add_toolbar().

HildonWindow *window;
GtkToolbar *toolbar;
GtkMenu *menu;
GdkPixbuf *icon_pixbuf;

window = HILDON_WINDOW (hildon_window_new());

toolbar = create_toolbar();

menu = create_menu();

icon_pixbuf = create_icon();

hildon_window_set_menu (window, menu);

hildon_window_add_toolbar (window, toolbar);

/* Can be used to set the window fullscreen */
gtk_window_fullscreen (GTK_WINDOW (window));

/* Used to trigger the blinking of the window's icon in the task navigator */
gtk_window_set_urgency_hint (GTK_WINDOW (window), TRUE);

/* Change the window's icon in the task navigator */
gtk_window_set_icon (GTK_WINDOW (window), icon_pixbuf);

Details

HILDON_WINDOW_LONG_PRESS_TIME

#define HILDON_WINDOW_LONG_PRESS_TIME 1500 /* in ms */


HildonWindowPrivate

typedef struct _HildonWindowPrivate HildonWindowPrivate;

This structure contains just internal data. It should not be accessed directly.


hildon_window_new ()

GtkWidget*  hildon_window_new               (void);

Use this function to create a new HildonWindow.

Returns : A HildonWindow.

hildon_window_add_with_scrollbar ()

void        hildon_window_add_with_scrollbar
                                            (HildonWindow *self,
                                             GtkWidget *child);

Adds the child to the HildonWindow and creates a scrollbar to it. Similar as adding first a GtkScrolledWindow and then the child to it.

self : A HildonWindow
child : A GtkWidget

hildon_window_get_menu ()

GtkMenu*    hildon_window_get_menu          (HildonWindow *self);

Gets the GtMenu assigned to the HildonAppview.

self : HildonWindow
Returns : The GtkMenu assigned to this application view.

hildon_window_set_menu ()

void        hildon_window_set_menu          (HildonWindow *self,
                                             GtkMenu *menu);

Sets the menu to be used for this window. This menu overrides a program-wide menu that may have been set with hildon_program_set_common_menu. Pass NULL to remove the current menu.

self : A HildonWindow
menu : The GtkMenu to be used for this HildonWindow

hildon_window_add_toolbar ()

void        hildon_window_add_toolbar       (HildonWindow *self,
                                             GtkToolbar *toolbar);

Adds a toolbar to the window.

self : A HildonWindow
toolbar : A GtkToolbar to add to the HildonWindow

hildon_window_remove_toolbar ()

void        hildon_window_remove_toolbar    (HildonWindow *self,
                                             GtkToolbar *toolbar);

Removes a toolbar from the window.

self : A HildonWindow
toolbar : A GtkToolbar to remove from the HildonWindow

hildon_window_get_is_topmost ()

gboolean    hildon_window_get_is_topmost    (HildonWindow *self);

self : A HildonWindow
Returns : Whether or not the HildonWindow is currenltly activated by the window manager.