Re: help with "about" and "help" in gtk-app



Le 10/06/2013 17:53, Rudra Banerjee a écrit :
Dear friends,
I am writing a code with gtk+3.
I am facing problems with linking the icons and help files with the
code.

[...]

GtkWidget *window;
void help_about (GtkMenuItem *helpabout, GtkWidget *window)
{
  [...]
  gchar *hstr=g_strdup_printf("%s/mkbib.svg", PIXMAP);
   g_print("%s",hstr);
  g_return_if_fail (GTK_IS_WIDGET (window));
  
  gtk_show_about_dialog (GTK_IS_WINDOW (window) ? GTK_WINDOW (window) : NULL,
 [...]
                       "logo-icon-name",hstr,
 [...]

The problem is:
1) while the icon is shown in the topbar, as any gnome3 application, in
"About" window, the icon is missing. but the pathe shown by 

g_print("%s",hstr);
does exist.

You set the icon-name property.  This expects an icon *name*, not path,
to be automatically searched in configured the icon directories.

If you want to manually load the icon, you need to set the "logo"
property of type GdkPixbuf, so you need to load it manually.

The other (recommended) solution is to install your application icon in
a standard directory, or add your application's specific icon directory
to the icon search path, and set the "logo-icon-name" property to the
basename of the icon (e.g. without path or extension).

See https://developer.gnome.org/gtk3/stable/checklist-named-icons.html
and more specifically
https://developer.gnome.org/gtk3/stable/GtkIconTheme.html


Regards,
Colomban


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]