[pygtk] Is it possible to pass "markup" text to the inherent label of Gtk.LinkButton (or Gtk.Button) ?
Saeed Rasooli
saeed.gnu at gmail.com
Mon Dec 24 12:38:45 WST 2012
That's easy to understand if you check the class inheritance
Button is a Bin
Bin is a Container which can own only one child
then Button is a Container like VBox and HBox, but only has one child which
you can access via button.child, it's a Label by default (if you pass a
string while constructing), but can be any other widget (add it by
button.add)
On Mon, Dec 24, 2012 at 8:04 AM, Saeed Rasooli <saeed.gnu at gmail.com> wrote:
> About GtkButton, yes, and you have 2 options, which is show below as 2
> examples:
>
> ____________________________________________
>
> import gtk
>
> win = gtk.Dialog()
> button = gtk.Button('Hello <b>World</b>')
> button.child.set_use_markup(True) ## button.child is a Label
> win.vbox.pack_start(button, 1, 1)
> win.vbox.show_all()
> win.run()
>
> ____________________________________________
>
> import gtk
>
> win = gtk.Dialog()
> button = gtk.Button() ## don't add anything inside the button by now
> label = gtk.Label('Hello <b>World</b>')
> label.set_use_markup(True)
> button.add(label)
> win.vbox.pack_start(button, 1, 1)
> win.vbox.show_all()
> win.run()
>
>
> On Sun, Dec 23, 2012 at 3:59 PM, Ajay Garg <ajaygargnsit at gmail.com> wrote:
>
>> Will be grateful for any pointers.
>>
>>
>> Regards,
>> Ajay
>>
>> _______________________________________________
>> pygtk mailing list pygtk at daa.com.au
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> Read the PyGTK FAQ: http://faq.pygtk.org/
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20121224/7a2eacfc/attachment.html>
More information about the pygtk
mailing list