The OpenNET Project
 
Поиск (ключи):    ПРОГРАММЫ СТАТЬИ СОВЕТЫ ФОРУМ
  WIKI НОВОСТИ (+) MAN'ы ДОКУМЕНТАЦИЯ

Каталог документации / Раздел "Программирование, языки" / Оглавление документа

Migrating from GnomeAbout to GtkAboutDialog

Since version 2.6, GTK+ provides the GtkAboutDialog widget as a replacement for the GnomeAbout dialog in the libgnomeui library.

GtkAboutDialog supports all features found in GnomeAbout. The GtkAboutDialog API is bigger, since it follows the GTK+ policy to have getters and setters for all widget properties, but it isn't much more complex than GnomeAbout.

To convert an application that uses GnomeAbout to GtkAboutDialog, as a first step, replace calls like

    const gchar *documentors[] = { 
      "Documenter 1", 
      "Documenter 2", 
      NULL 
    };

    const gchar *documentors[] = { 
      "Author 1", 
      "Author 2", 
      NULL 
    };

    GtkWidget *about = gnome_about_new ("GNOME Test Program", VERSION,
					"(C) 1998-2001 The Free Software Foundation",
					"Program to display GNOME functions.",
					authors,
					documenters,
					_("translator-credits"),
					"logo.png");
    

by something like

    GdkPixbuf *logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
    GtkWidget *about = g_object_new (GTK_TYPE_ABOUT_DIALOG,
                                     "name", "GNOME Test Program", 
                                     "version", VERSION,
			             "copyright", "(C) 1998-2001 The Free Software Foundation",
				     "comments", "Program to display GNOME functions.",
			             "authors", authors,
			             "documenters", documenters,
			             "translator-credits", _("translator-credits"),
				     "logo", logo,
                                     NULL);
    g_object_unref (pixbuf);
    

If the g_object_new() construction scares you, you can also use gtk_about_dialog_new() to construct the dialog and then use the setters for the individual properties.

Once you are done with the initial conversion, you may want to look into using some of the features of GtkAboutDialog which are not present in GnomeAbout.


ПОДПИШИСЬ НА ЖУРНАЛ Linux Format 2012!

Журнал "Linux Format" (Линукс Формат)- Единственный в России и странах СНГ журнал на русском языке, посвящённый Linux и свободному ПО. Журнал для IT-директоров, IT-менеджеров, программистов, системных администраторов, учителей школ и преподавателей ВУЗов и всех пользователей ПК. В каждом выпуске: Новости индустрии OpenSource, обзоры новинок свободного ПО, обучающие и методические статьи.

Каждый, кто оформит подписку, получает бонусы и подарки- объёмные наклейки на системный блок, диск с архивом номеров за 2005-2011 г.г. и ежемесячно электронную версию журнала в pdf-формате.

Оформить подписку на год


  Закладки на сайте
  Проследить за страницей
Created 1996-2012 by Maxim Chirkov  
ДобавитьРекламаВебмастеруГИД  
RUNNet TopList