Re: [pygtk] How to use help

1999-03-08 Thread James Henstridge

The argument to UIINFO_HELP is just a single word.  So to add gnumeric's
help to your help menu, you would use UIINFO_HELP.  The gnome libraries
will handle the actual file locations for you.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Mon, 8 Mar 1999 [EMAIL PROTECTED] wrote:

 Hi James I'm trying to get my help to run but I can' t.
 You gave mea VERY GOOD explenation of how It worked but It seems I just
 can't get the hang of it.
 
 Below is an example of what should display gnumeric help on my computer
 but it gives a WARNIG before starting:
 
 GnomeUI-WARNING **: Could not open help topics file NULL
 
 Could you signal what I'm doing wrong ?
 
 Thanks
 
 #Begin Help_me---
 
 #!/usr/bin/env python
 from gtk import *
 from gnome.ui import *
 
 class Help_me(GnomeApp):
 
 def __init__(self):
   GnomeApp.__init__(self,'help_me', 'help_me')
   self.connect('destroy', mainquit)
   self.help_menu = [
   UIINFO_ITEM_STOCK( 'About', None, self.about,  STOCK_MENU_ABOUT),
   UIINFO_SEPARATOR,
   UIINFO_HELP('/usr/share/gnome/help/gnumeric'),
   UIINFO_END]
   self.menu = [UIINFO_SUBTREE('Help', self.help_menu)]
   self.create_menus(self.menu)
 
 def about(self,*args):
   win = GnomeAbout('help_me', 
'2001', 'GPL', ['A lost pygtk programmer'],
"""
An example for getting help 
(there is two semantic meanings in this phrase :-)"""
)
   win.show()
   
 if __name__ == '__main__':
 help_me = Help_me()
 help_me.show()
 mainloop()
 
 #---End Help_me-
 
 To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] How to use help

1999-03-02 Thread James Henstridge

Usually you wouldn't use those gnome.help.* functions.  This is how the
GNOME help system is used.

First generate your help files in HTML (maybe translated from SGML or
latex, maybe hand coded).  You should put this documentation in
$(gnome_prefix)/share/gnome/help/$(package)/$(lang)/.  You should also
have some documentation in a directory for lang=C.

In the directory, along with the HTML, put a file called topic.dat.  It
contains lines of the form
relative-url title

So for instance, gnumeric's topic.dat file looks like this:
gnumeric.html   Gnumeric manual 
function-reference.html Gnumeric Functions reference

And my program gnorpm's looks like this:
gnorpm.html#Top Introduction
gnorpm.html#MainWin The main window
gnorpm.html#InstallWin  The install window
gnorpm.html#QueryWinThe query window
gnorpm.html#FindWin The find window
gnorpm.html#RpmFind The web find window


Next, in your program, it is good if you have used UIInfo structures to
build the menus (like in the examples in pygnome/examples).  The help menu
uiinfo structure will probably look like this:
  [ UIINFO_ITEM_STOCK('About...', None, about_cb, STOCK_MENU_ABOUT),
UIINFO_SEPARATOR,
UIINFO_HELP('package-name'),
UIINFO_END ]

Where package-name matches the help directory you created.  This will add
an entry to the help menu for each line in topic.dat, which display the
help file associated with the entry.

With this system, it is pretty easy to setup localised help for your
program.

James Henstridge.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Tue, 2 Mar 1999 [EMAIL PROTECTED] wrote:

 
 Does somebody has a simple of how to use help in gnome. 
 I see all the function are in help.py but I can't figure out how to call
 them.
 
   Thanks
 
 
   Daniel Kornhauser
 
 To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]