Meego Wiki
Views

MeeGo Netbook and GTK

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '== How to integrate you GTK application on MeeGo Netbook == === The Window === ==== Decoration ==== Remove the window decoration: GtkWidget *window = gtk_window_new (); …')
(The Close Button)
Line 28: Line 28:
==== The Close Button ====
==== The Close Button ====
-
Use a button in the far right hand corner of the toolbar for closing the window, name this "MeeGoCloseButton":
+
Use a button in the far right hand corner of the toolbar for closing the window. Name this "MeeGoCloseButton":
     GtkWidget *close_button, *image;
     GtkWidget *close_button, *image;

Revision as of 21:10, 19 August 2010

Contents

How to integrate you GTK application on MeeGo Netbook

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