Hi all, In my program I have a main program object (QAReviewer) that currently has a gnome.Program object (created via gnome.program_init()). This has worked out well so far but I'm now running into several instances where one component of my program needs to access another component and wondered how I should implement it.
For instance:
I am creating a menu (QAReviewer.menu = class QAMenu(gtk.Menu))
dynamically based on what the data is that is being displayed. One of
my menu item callbacks needs to update a report shown in the
QAReviewer.ReviewerWindow widget
(ReviewerWindow = class Review(gtk.VBox)).
How should I get a reference to this?
My first thought was to use gnome.program_get() to get a reference to
the global program and then access my widget from that. I quickly
realized that this would entail changing my QAReviewer's has-a
relationship with gnome.Program to an is-a relationship. It seemed
logical, so I started testing the implementation:
>>> import gnome
>>> class TestProgram(gnome.Program):
... def __init__(self):
... gnome.Program.__init__(self)
...
>>> t = TestProgram()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<stdin>", line 3, in __init__
NotImplementedError: TestProgram is an abstract widget
So obviously I'm doing something wrong. My questions are:
1) Is my concept wrong? (ie: I shouldn't be attempting to subclass
gnome.Program)
If so, what is a better architecture to implement?
2) If subclassing gnome.Program makes sense, how do I go about making it
workable?
Thanks for your feedback,
Toshio
--
_______________ Life is about Loose Ends that never End __________________
t o s h i o @ t i k i - l o u n g e . c o m
GA->ME 1999
signature.asc
Description: This is a digitally signed message part
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
