[Pipet Devel] Brad: I've got a little task for you
J.W. Bizzaro
bizzaro at geoserve.net
Mon Dec 20 13:36:49 EST 1999
Brad,
Since you're working on containers and getting into PyGTK, how about making a
prototype widget to go in the windowlet of a container: a list widget.
Just name the file 'container_list.py' or whatever. Look in the PyGTK
examples for a list widget. You can put some fake values in for now. As an
example of how Loci widgets are structured, look at 'testwidget1.py' (pasted
below) in loci-core. Basically, we're making a 'composite widget' (no
relation to composite locus), which is a widget that inherits the objects of a
standard GTK widget. So, WidgetMain inherits GtkVBox....
---------------------------------------------------
>from gtk import *
from gnome.ui import *
class WidgetMain(GtkVBox):
get_type = GtkVBox(spacing=5).get_type()
def __init__(self):
self._o = GtkVBox(spacing=5)._o
self.width = 150
self.height = 50
self.set_usize(self.width, self.height)
self.set_border_width(5)
w = GtkLabel('Label')
self.add(w)
w.show()
---------------------------------------------------
The actual widget I'm using here is a GtkLabel and is 'added' to self
(WidgetMain).
That's all that is really needed, and then I can get it to show up in the
windowlet.
Cheers.
Jeff
--
+----------------------------------+
| J.W. Bizzaro |
| |
| http://bioinformatics.org/~jeff/ |
| |
| THE OPEN LAB |
| Open Source Bioinformatics |
| |
| http://bioinformatics.org/ |
+----------------------------------+
More information about the Pipet-Devel
mailing list