Re: GtkTextView for help files?
- From: Brian <dol-sen telus net>
- To: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re: GtkTextView for help files?
- Date: Wed, 29 Sep 2004 07:18:53 -0700
On Tue, 2004-09-28 at 10:41, William Dest wrote:
I'm creating an external help file for my program,
invoked from the Help menu.
I'd like to keep the file simple so a tech writer can
update it from time to time, but I would also like it
to have bold headings, bookmarks, etc.
Is GtkTextView the right tool for this? It's not
going to be edited by the user, so I don't need all
the editing features, but I would like a viewer to
recognize tags - in fact html would be ideal.
Ideas?
Thanks,
William
In our python/pygtk program we just spawn a browser call in a threaded
function so it does not tie up the gui in the other windows. dprint()
is our internal debug enabled print statements to stderr.
# if using gnome, see if we can import it
try:
import gnome
import gnome.vfs
except ImportError:
# no gnome module, use the standard webbrowser module
try:
import webbrowser
except ImportError:
print >>stderr, ('Module "webbrowser" not found. '
'You will not be able to open web pages.')
def load_web_page(name):
"""Try to load a web page in the default browser"""
dprint("UTILS: load_web_page()")
browser = web_page(name)
browser.start()
return
class web_page(threading.Thread):
"""Try to load a web page in the default browser"""
def __init__(self, name):
dprint("UTILS: web_page.__init__()")
threading.Thread.__init__(self)
self.name = name
self.setDaemon(1) # quit even if this thread is still running
def run(self):
dprint("UTILS: web_page.run()")
if self.name == '' or self.name == None:
return
try:
gnome.url_show(self.name)
except:
dprint("Gnome failed trying to open: %s" %self.name)
try:
webbrowser.open(self.name)
except:
dprint("webbrowser failed trying to open: %s -- giving
up" %self.name)
pass
dprint("Browser call_completed for: %s" %self.name)
--
Brian <dol-sen telus net>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]