[pygtk] set_use_markup and gtk.SpinButton

Art Hunkins abhunkin at uncg.edu
Mon Aug 10 08:07:32 WST 2009


I've a somewhat related problem with gtk.SpinButton: I need to make the 
numeric display (i.e., the digits) larger in size. The basic code I'm using 
is this:

       adj = gtk.Adjustment(init,start,end,step,page,0)
       spin = gtk.SpinButton(adj,accel)
       if label == "": name = title
       else: name = label
       label = gtk.Label(name)
       box.pack_start(spin, False, False, 5)
       box.pack_start(label, False, False, 2)
       self.spins.append([spin,title,init])
       adj.connect("value_changed", self.spincallback, spin)
       spin.show()
       label.show()
       self.set_channel(title, init)

I assume that I must convert "spin" to a string, looking something like: 
("<big><big> + spin + </big></big>")
followed by: spin.set_use_markup(True)

Perhaps gtk.Entry is involved as well? (In which case, I'd like characters 
restricted to numeric, and a maximum of 3 digits.)

I'd very much appreciate any suggestions.

Art Hunkins 



More information about the pygtk mailing list