Upgrade or not ??
Greg McFarlane
gregm at iname.com
Mon Jul 5 00:22:52 EDT 1999
Since Tkinter is just a wrapper around Tk, I find the best
documentation to be the Tk manual pages, which comes with the
Tk source distribution.
On 4 Jul, pierrette wrote:
> Thanks, exactly what i needed.
> Is there a way to find out what events a widget support ?
> I browsed documentation on python.org but didn't find anything on FocusIn en
> FocusOut. I there somewhere documentation on that ??
>
> Pierrette
>
> Greg McFarlane wrote:
>
> > Depending on exactly what you want to do, it may be possible in
> > Tkinter. You can use something like this to find out when a widget
> > gets and loses focus:
> >
> > import Tkinter
> >
> > def gotFocus(event):
> > print 'Focus in'
> > def lostFocus(event):
> > print 'Focus out'
> >
> > root = Tkinter.Tk()
> >
> > e = Tkinter.Entry()
> > e.bind('<FocusIn>', gotFocus)
> > e.bind('<FocusOut>', lostFocus)
> > e.pack()
> >
> > root.mainloop()
> >
> > Also, you can use this to set the focus to a widget.
> >
> > e.focus_set()
> >
> > On 3 Jul, pierrette wrote:
> > > First a general question :
> > > Actually we're working with Python 1.5.1 and we're satisfied with it.
> > > Should we upgrade to 1.5.2 and if yes WHY?
> > >
> > > No a Tkinter guestion :
> > > We developped a prototype of an application with python an tkinter, now
> > > we have to
> > > decide if we're gonna write the real app in python or something else !
> > > We now allready that in principle we could do it with python, the thing
> > > we're missing
> > > in tk is a 'on get focus' ,a 'on lost focus' event and a 'set focus to'
> > > command
> > > Pe: on lost focus of inputfield 1:
> > > if inputfield1 = A:
> > > set focus to field2
> > > elif inputfield1 = B:
> > > set focus to field 3
> > >
> > > If those things are not available in tkinter what alternatives do we
> > > have ?
> > > - Changing the GUI (would be a shame but feasable), knowing that is has
> > > to be multi-platform WIN-LINUX? If so to what ?
> > > - Not write in python ? In this case we lose the work done for the
> > > prototype
> > >
> > > Thanks for comments and remarks
> > >
> > > Pierrette Serrand
> > > pserrand at worldnet.fr
> > >
> > >
> > >
> > >
> > >
> >
> > --
> > Greg McFarlane: INMS Telstra Australia (gregm at iname.com)
> > Today's forecast: Sunny, with occasional cloudy periods and a chance
> > of precipitation in some areas.
>
>
>
--
Greg McFarlane: INMS Telstra Australia (gregm at iname.com)
Today's forecast: Sunny, with occasional cloudy periods and a chance
of precipitation in some areas.
More information about the Python-list
mailing list