[pygtk] Easy question: best way to add legend to gtk.Ruler
N. French
nbm_clan at yahoo.com
Sat Apr 14 00:46:36 WST 2007
I have a couple rulers around an image that I'm displaying (a graph of
some spectral analysis results). I'd like to be able to label the
axes. What's the best way to do this?
My GUI code looks something like this:
def init_ui(self):
self.area = gtk.DrawingArea()
self.area.set_size_request(self.blip_size*self.num_conv,
(1024/self.lambd)*self.blip_size)
self.area.connect("expose-event", self.expose_cb)
self.hrul = gtk.HRuler()
self.hrul.set_range(0, self.num_conv*self.alph, 0,
self.num_conv*self.alph) # number of symbols
self.vrul = gtk.VRuler()
self.vrul.set_range(0, 1024, 0, 1024) # number of subcarriers
self.table = gtk.Table(2, 2)
self.table.attach(self.hrul, 1, 2, 0, 1, yoptions=0)
self.table.attach(self.vrul, 0, 1, 1, 2, xoptions=0)
self.table.attach(self.area, 1, 2, 1, 2)
self.status = gtk.Statusbar()
self.status.push(0, "alpha = %d, lambda = %d" % (self.alph,
self.lambd))
self.dia = gtk.Dialog()
self.dia.set_title("SPAM Plot")
self.dia.connect('delete_event', self.hide)
self.dia.vbox.pack_start(self.table, True, True)
self.dia.vbox.pack_end(self.status, False, False)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the pygtk
mailing list