how to get selected filename in FileSelectBox

wilson wilson.t.thompson at gmail.com
Sat Jul 5 02:24:08 EDT 2008


hi
i am using tix FileSelectBox in my application .I want to get the
selected filename as a string

i do this as follows

fselectbox=FileSelectBox(someframe)
fselectbox.__setitem__("dir",join(fselectbox.cget("dir"),".."))
fselectbox.pack(side=LEFT)
...
selectedfile=fselectbox.selection.cget("value")
fselectbox.selection.selection_clear()
print "file=",selectedfile

i did these by going thru the docs in tix ,actually i couldn't find an
example  so i am not sure if this is the right way..it does print the
filename  but i want to know if this is the way..Can someone  comment?
Wilson



More information about the Python-list mailing list