HildonWindow

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

Synopsis




#define     HILDON_WINDOW_LONG_PRESS_TIME
enum        HildonWindowClipboardOperation;
            HildonWindow;
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_main_menu     (HildonWindow *self,
                                             GtkMenu *menu);
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);

Object Hierarchy


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

Implemented Interfaces

HildonWindow implements GtkBuildable and AtkImplementorIface.

Properties


  "is-topmost"           gboolean              : Read
  "is-topmost"           gboolean              : Read

Style Properties


  "borders"              GtkBorder             : Read
  "toolbar-borders"      GtkBorder             : Read
  "borders"              GtkBorder             : Read
  "toolbar-borders"      GtkBorder             : Read

Signals


"clipboard-operation"
            void        user_function      (HildonWindow *hildonwindow,
                                            gint          arg1,
                                            gpointer      user_data)         : Run first
"clipboard-operation"
            void        user_function      (HildonWindow *hildonwindow,
                                            gint          arg1,
                                            gpointer      user_data)         : Run first

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()..

Example 1. Creating a HildonWindow

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 800 /* in ms */


enum HildonWindowClipboardOperation

typedef enum
{
    HILDON_WINDOW_CO_COPY,
    HILDON_WINDOW_CO_CUT,
    HILDON_WINDOW_CO_PASTE
}                                               HildonWindowClipboardOperation;


HildonWindow

typedef struct _HildonWindow HildonWindow;


hildon_window_new ()

GtkWidget*  hildon_window_new               (void);

Creates 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 for 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. Note that the window is still the owner of the menu.

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

hildon_window_set_main_menu ()

void        hildon_window_set_main_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. HildonWindow takes ownership of the passed menu and you're not supposed to free it yourself anymore.

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

Since Hildon 2.2


hildon_window_set_menu ()

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

Warning

hildon_window_set_menu is deprecated and should not be used in newly-written code. Hildon 2.2: use hildon_window_set_main_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. HildonWindow takes ownership of the passed menu and you're not supposed to free it yourself anymore.

Note: hildon_window_set_menu() calls gtk_widget_show_all() for the GtkMenu. To pass control about visibility to the application developer, hildon_window_set_main_menu() was introduced, which doesn't do this.

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. Note that the toolbar is not automatically shown. You need to call gtk_widget_show_all on it to make it visible. It's also possible to hide the toolbar (without removing it) by calling gtk_widget_hide.

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. Note that this decreases the refference count on the widget. If you want to keep the toolbar alive call g_object_ref before calling this function.

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.

Property Details

The "is-topmost" property

  "is-topmost"           gboolean              : Read

Whether the window is currently activated by the window manager.

Default value: FALSE


The "is-topmost" property

  "is-topmost"           gboolean              : Read

Whether the window is currently activated by the window manager.

Default value: FALSE

Style Property Details

The "borders" style property

  "borders"              GtkBorder             : Read

Size of graphical window borders.


The "toolbar-borders" style property

  "toolbar-borders"      GtkBorder             : Read

Size of graphical toolbar borders.


The "borders" style property

  "borders"              GtkBorder             : Read

Size of graphical window borders.


The "toolbar-borders" style property

  "toolbar-borders"      GtkBorder             : Read

Size of graphical toolbar borders.

Signal Details

The "clipboard-operation" signal

void        user_function                  (HildonWindow *hildonwindow,
                                            gint          arg1,
                                            gpointer      user_data)         : Run first

hildonwindow : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.

The "clipboard-operation" signal

void        user_function                  (HildonWindow *hildonwindow,
                                            gint          arg1,
                                            gpointer      user_data)         : Run first

hildonwindow : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.