[Sugar-devel] XML markup capability for a gtk.Button label (PyGTK)?

Art Hunkins abhunkin at uncg.edu
Wed Aug 5 21:43:23 EDT 2009


Hello, Victor and Mike (et al.),

In reference to Victor's csndsugui.py (PyGTK):

With gtk.Label and gtk.Frame, I've been able to use the set_use_markup() 
property to get larger fonts, bold, italics, etc - by including XML markup 
in my text strings.

However, this property does not exist for gtk.Button, and I've got callback
buttons that need these features too.

Here is the relevent portion of a callback button that works fine (but no 
markup capability) - from csndsugui.py:

   def cbbutton(self,box,callback,title=""):
       butt = gtk.Button(" %s " % title)

I tried unsuccessfully to add markup capability to this title by modifying 
the code thus:

   def cbbutton(self,box,callback,title=""):
       label = gtk.Label(title)
       label.set_use_markup(True)
       butt = gtk.Button(" %s " % label)

Can this be made to work? (Sorry my PyGTK chops are so rudimentary.)

Art Hunkins



More information about the Sugar-devel mailing list