Hello Gary,
I used something like this once:
#--------------------------------------
label = gtk.GtkLabel("Old Text")
label.show()
button = gtk.GtkButton()
button.add(label)
button.show()
# [...]
label.set_text("New Text")
#--------------------------------------
Regards,
Felix
On Sat, 21 Feb 2004 16:30:39 -0500
Gary Jaffe <[EMAIL PROTECTED]> wrote:
> On Sat, 21 Feb 2004 20:47:31 +0000
> "Gustavo J. A. M. Carneiro" <[EMAIL PROTECTED]> wrote:
>
> > A S�b, 2004-02-21 �s 19:52, Gary Jaffe escreveu:
> > > I have a server running pygtk-0.6.9 and gtk-1.2.9 on Redhat 7.1 with
> > > python-1.5. I am trying to change the text and background color of
> > > a label on a button. But when I do
> > >
> > > button = gtk.GtkButton("Old Text")
> > > button.set_label("New Text")
> > >
> > > I get 'AttributeError: set_label'.
> > >
> > > This works on my Libranet system at home which has pygtk-2.0.0 and
> > > gtk-2.2.4. Is there some way I can do this with my old version of
> > > pygtk, or am I stuck trying to upgrade everything on my server?
> >
> > Gtk 1.2 is so old I don't even remember the API very well. :)
> > Anyway, I think this workaround should work:
> > button.child.set_text("New Text")
> > If button.child doesn't work, try button.get_child().
>
> Unfortunately, I got AttributeErrors on button.child and
> button.get_child.
[snip]
> Any other thoughts?
>
> Thanks,
> Gary
>
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/