GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 22, 2014 9:14 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: help with "about" and "help" in gtk-app
PostPosted: Mon Jun 10, 2013 4:40 pm 
Offline
GTK+ Guru

Joined: Sun Jul 08, 2012 3:14 pm
Posts: 107
Location: Coventry, UK
Dear friends,
I am writing a code with gtk+3.
I am facing problems with linking the icons and help files with the code.
Code:
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib/gi18n.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
#include <string.h>

GtkWidget *window;
void help_about (GtkMenuItem *helpabout, GtkWidget *window)
{
    const gchar *authors[] = {
   "RudraB <mailme@example.com>",
    NULL
  };

  const gchar *copyright = "Copyright \xc2\xa9 2012-2013 Rudra  Banerjee";
  const gchar *comments = _("Manage and Create BibTeX File");
  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,
            "name", _("Dictionary"),
            "version", VERSION,
            "copyright", copyright,
            "comments", comments,
            "authors", authors,
            "logo-icon-name",hstr,
            "license-type", GTK_LICENSE_GPL_3_0,
          "screen", gtk_widget_get_screen (window),
            NULL);

}
void help_content(GtkWidget *widget, gpointer data)

{
  gchar *uri, *str;
  GError *Err=NULL;

  uri=g_strdup("help:mkbib");
  gtk_show_uri(NULL, uri, gtk_get_current_event_time(), &Err);
  g_free(uri);
  if (Err)
  {
    caution("File does not exist");
  }
}


I also have the pixbuff defined in the main.c as

Code:
GdkPixbuf *create_pixbuf(const gchar * iconname) {
  GdkPixbuf *pixbuf;
  GError *error = NULL;
  pixbuf = gdk_pixbuf_new_from_file(iconname, &error);
  if (!pixbuf) {
    fprintf(stderr, "%s\n", error->message);
    g_error_free(error);
  }

  return pixbuf;
}

int main(int argc,
    char *argv[]) {
............
............
  gchar *sicon=g_strdup_printf("%s/icon.svg",PIXMAP);
  gtk_window_set_icon(GTK_WINDOW(window),
      create_pixbuf(sicon));
  g_free(sicon);
............
............
}

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 path shown by
Code:
g_print("%s",hstr);

does exist.

2) the help files, in help/C/*.page is there, but Help->Help(i.e. F1) shows
Quote:
Quote:
The URI ‘help:mkbib/index’ does not point to a valid page.


What I am missing(or messing)? Kindly help.


Top
 Profile  
 
 Post subject: Re: help with "about" and "help" in gtk-app
PostPosted: Mon Jun 10, 2013 11:02 pm 
Offline
GTK+ Guru

Joined: Sun Jul 08, 2012 3:14 pm
Posts: 107
Location: Coventry, UK
I have solved the help_content problem (yelp only searches /usr/* files).
So, help with help_about is what I am looking for.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group