Hi,

Thanks for the answer. The intial code works indeed as soon as I put
out the lines:
hd.pack()
gf.pack()

I'm playing now with the Select buttons:

import Tix

def prtS():
    print fruits.cget('value')

def prtC(val):
    print val
    print sel.cget('value')

root = Tix.Tk()
fruits=Tix.Select(root,label="Fruits:", orientation='horizontal')
fruits.add('orange',text="Orange",width=6,command=prtS)
fruits.add('lemon',text="Lemon",width=6,command=prtS)
fruits.add('apple',text="Apple",width=6,command=prtS)
fruits.pack()

sel=Tix.Control(root, label="X Coordinates", max=10, min=3,
integer=True,command=prtC)
sel.pack()

root.mainloop()

First of all, the prt is supposed to take an argument to work, as it's
the case with Tix.Control. Then, the fruits.cget('value') is supposed
to return the name of the button pressed. But it returns each time
with an empty line!

I've readed the doc, and it seems to me an unusual behaviour, as the doc says:
""" The TixSelect widget supports same set of options as the
TixControl widget for you to access its value"""
http://tix.sourceforge.net/dist/current/docs/tix-book/intro.tex.html#1-11

Thanks,

G

On Tue, 21 Dec 2004 21:28:40 +0100, Michael Lange <[EMAIL PROTECTED]> wrote:
> On Tue, 21 Dec 2004 14:16:56 +0900
> Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote:
> 
> Hi Guille,
> 
> thats a classic case of geometry manager conflicts.
> You dont need to pack the notebook pages explicitely, tix does this
> automagically for you and *tix does not use pack()*, so when
> you try to pack() the pages with
> 
> > hd.pack()
> > gf.pack()
> 
> tix doesnt know what to do; by the way, instead of writing
> 
> > nb.add('hd',label="hard disk",underline=0)
> > hd = nb.subwidget('hd')
> 
> you can simply do:
> 
> hd = nb.add('hd',label="hard disk",underline=0)
> 
> I hope this helps
> 
> Michael
> _______________________________________________
> Tutor maillist  -  [EMAIL PROTECTED]
> http://mail.python.org/mailman/listinfo/tutor
>
_______________________________________________
Tutor maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to