Meego Wiki
Views

MeeGo Netbook and GTK

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(The Close Button)
 
Line 1: Line 1:
-
== How to integrate you GTK application on MeeGo Netbook ==
+
== How to integrate your GTK application on MeeGo Netbook ==
 +
 
 +
This is useful if you're following the [[Netbook_Design_Guide|netbook design guide]].
=== The Window ===
=== The Window ===

Latest revision as of 19:21, 11 October 2011

Contents

How to integrate your GTK application on MeeGo Netbook

This is useful if you're following the netbook design guide.

The Window

Decoration

Remove the window decoration:

    GtkWidget *window = gtk_window_new ();
    gtk_window_set_decorated (GTK_WINDOW (window), FALSE);

Window Size

Find the size of the screen and then set your preferred window size to it:

    gtk_window_resize (GTK_WINDOW (window),
                       max_screen_width,
                       max_screen_height);
    gtk_window_maximize (GTK_WINDOW (window));

The Toolbar

Use a standard GtkToolbar along the top of the screen. Name this "MeeGoToolbar":

    GtkWidget *toolbar = gtk_toolbar_new ();
    gtk_widget_set_name (GTK_WIDGET (toolbar), "MeeGoToolbar");

The Close Button

Use a button in the far right hand corner of the toolbar for closing the window. Name this "MeeGoCloseButton":

    GtkWidget *close_button, *image;
    close_button = gtk_button_new ();
    gtk_widget_set_name (close_button, "MeeGoCloseButton");

Use "window-close-hover" as the icon name:

    image = gtk_image_new_from_icon_name ("window-close-hover",
                                          GTK_ICON_SIZE_DIALOG);
    gtk_container_add (GTK_CONTAINER (close_button), image);

The Settings Button

If your application has a settings area, add a GtkButton called "MeeGoSettingsButton":

    GtkWidget *close_button, *image;
    close_button = gtk_button_new ();
    gtk_widget_set_name (close_button, "MeeGoSettingsButton");


Use "preferences-other-hover" as the icon name:

    image = gtk_image_new_from_icon_name ("preferences-other-hover",
                                          GTK_ICON_SIZE_DIALOG);
    gtk_container_add (GTK_CONTAINER (close_button), image);
Personal tools