tkinter and focus...

Uwe Schmitt schmitt at num.uni-sb.de
Tue May 29 08:05:48 EDT 2001


Matthew Dixon Cowles <matt at mondoinfo.com> wrote:
| On 28 May 2001 11:07:31 GMT, Uwe Schmitt <schmitt at num.uni-sb.de>
| wrote:

|>focus_force() works fine. now i've got other problems:
|>1) how can i change the order of widgets which are activated
|>   by TAB ?
|>2) my informationwindow (as described above) appears in the
|>   left upper corner of the screen, but it should appear
|>   near the main-window.

| Uwe,
| The best way I've found to change the tab order is to bind the tab key
| event of a widget to a routine that changes the focus with focus_set()
| or focus_force(). You might have a line like this in the routine that
| creates your widgets:

| myWidget.bind("<Key-Tab>",self.tabInMyWidgetCB)

| and then somewhere else in the class something like:

| def tabInMyWidgetCB(self,event):
|   self.otherWidget.focus_force()
|   return "break"

that was my first idea, but in my case it doesnt work...

thanks, uwe.


-- 
Uwe.Schmitt at num.uni-sb.de      Universität des Saarlandes
phone: +49 (0)681/302-2468     Geb. 36.1, Zi. 4.17, PF 151150
                               D-66041  Saarbrücken
http://www.rocksport.de        http://www.rocksport.de/first_ride.mp3




More information about the Python-list mailing list