Re: gnome_program_init with Gnome::Main



Thanks Murray for your answer.

----------
This mail pretends to be a sum of what is needed to implement gnome help
(yelp) in a gtkmm/gnomemm program:

 - configure.ac/configure.in:

   GNOME_DOC_INIT


 - Makefile.am

   INCLUDES = \
        [...]
        -DDATADIR=\""$(datadir)"\" 

   
 - main(int argc, char *argv[])

        gnome_program_init (PACKAGE, VERSION,
                            LIBGNOMEUI_MODULE, argc, argv,
                            GNOME_PARAM_APP_DATADIR, DATADIR,
                            NULL);

        Gtk::Main kit(argc, argv);

        Gtk::Window window;

        Gtk::Main::run(window);

  ----------
  How to write a OMF[1] file and the help xml, create a "help" directory
with the help xml and .po for translation, can be done easily looking at
any GNOME program source code like epiphany browser or gedit.

  If you want yo can look at my source code at:

  http://svn.sourceforge.net/viewcvs.cgi/g4c/trunk/

 
  I hope this helps somebody.

[1] Writing OMF files
http://scrollkeeper.sourceforge.net/documentation/writing_scrollkeeper_omf_files/index.html
        

El vie, 02-06-2006 a las 09:34 +0200, Murray Cumming escribió:
> I have a note about this in my Makefile.am:
> http://cvs.gnome.org/viewcvs/glom/glom/Makefile.am?view=markup
> 
> And here is where I use gnome_program_init():
> http://cvs.gnome.org/viewcvs/glom/glom/main.cc?view=markup
> 
> Note that I don't use Gnome::Main. I use Gtk::Main, probably because
> Gnome::Main didn't support Glib::OptionContext at the time, and I wanted
> to call Gnome::Gda::init() with the same argc/argv.
> 
> I also use Bakery. I guess that initializes Gnome::Vfs for me.
> 
> I hope this helps. Gnome::Main is a bit odd.
> 
> > While I'm wating for the answer I'm searching the answer myself.
> >
> > I've found a message on gnomemm-list from 3 years ago and without
> > solution. I'm loosing the hope.
> >
> >   http://mail.gnome.org/archives/gnomemm-list/2003-January/msg00063.html
> >
> > I've the same problem:
> >
> > =========
> > Hi,
> >
> > I have a problem with the following code in gnomemm-2.1:
> >
> > --------------------------------------------------------------
> > Gnome::Main kit(PACKAGE, VERSION,
> >                 Gnome::UI::module_info_get (),
> >                 gtk_argc, gtk_argv);
> >
> > Glib::ustring ustr;
> > Glib::ustring file ("gwavmerger.xml");
> > Glib::RefPtr<Gnome::Program> prog = Gnome::Program::get ();
> >
> > ustr = prog->locate_file (Gnome::FILE_DOMAIN_APP_DATADIR, file);
> >
> > printf("location: %s", ustr.c_str ());
> > --------------------------------------------------------------
> >
> > In my Makefile.am, I include datadir as:
> >
> >
> > INCLUDES = \
> >         -DDATADIR=\""$(datadir)"\"
> >
> > Can someone verify that with his gnomemm-2.x application?
> >
> > People on Gnome mailing list recommended to pass
> > GNOME_PROGRAM_STANDARD_PROPERTIES to gnome_program_init(),
> > but gnomemm's API won't allow for property pairs.
> > What I ultimately want is a property pair:
> >
> > (GNOME_PARAM_APP_DATADIR, DATADIR)
> >
> > but there is no way of setting that. I hoped gnomemm API would have
> > a method to add/modify application property later, but it doesn't.
> >
> > The bottom line: I cannot get Yelp work with my application.
> >
> >
> > Any ideas?
> > Anybody else has gnomemm2 app with Help contents working via XML/Yelp?
> >
> > thanks,
> > -VLG
> > ============
> >
> > El jue, 01-06-2006 a las 21:03 +0200, Diego Fdez. Durán escribió:
> >> Hi:
> >>
> >>  I'm trying to show the help of my program using Yelp. I've looking at
> >> the source code of epiphany-browser and I've make some progress. But now
> >> when I call gnome_help_display_with_doc_id I get this error: "domain not
> >> found GNOME_FILE_DOMAIN_APP_HELP".
> >>
> >>  In C I must do the following: (from epiphany source)
> >>
> >> -----------------
> >>   gnome_program_init (PACKAGE, VERSION,
> >>                       LIBGNOMEUI_MODULE, argc, argv,
> >>                       GNOME_PARAM_GOPTION_CONTEXT, option_context,
> >>                       GNOME_PARAM_HUMAN_READABLE_NAME, _("Web
> >> Browser"    ),
> >>                       GNOME_PARAM_APP_DATADIR, DATADIR,
> >>                       NULL);
> >> -----------------
> >>
> >>  Note the "GNOME_PARAM_APP_DATADIR, DATADIR," line.
> >>
> >>  How can I pass params to my program that is done with gnomemm? Now this
> >> is my code:
> >>
> >> ----------------.
> >>   Gnome::Main gnomeMain(PACKAGE,
> >>                         VERSION,
> >>                         Gnome::UI::module_info_get(),
> >>                         argc,
> >>                         argv);
> >> ----------------
> >>
> >> Thanks in advance and sorry for my bad english.
> >>
> >> _______________________________________________
> >> gtkmm-list mailing list
> >> gtkmm-list gnome org
> >> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >
> 
> 
> Murray Cumming
> murrayc murrayc com
> www.murrayc.com
> www.openismus.com
> 
-- 
Diego Fdez. Durán <diego goedi net> | http://iota.goedi.net
GPG : 925C 9A21 7A11 3B13 6E43 50DB F579 D119 90D2 66BB


Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



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