473,395 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PMW widget - skip tabbing to it

jp
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?

Thank you,
John

Mar 26 '07 #1
10 1886
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?

Thank you,
John
I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next
widget of interest. Something like that should work.

Mike

Mar 26 '07 #2
On Mar 26, 11:17 am, kyoso...@gmail.com wrote:
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John

I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next
widget of interest. Something like that should work.

Mike
I looked in my Tkinter book, and it says that if the widget has the
"takefocus" option set to true, the widget is placed in the tab group
and will get focus when they are tabbed to. I assume that this means
if you set the PMW widgets' "takefocus" option to false, they will be
skipped over since they won't be in the tab group.

Mike

Mar 26 '07 #3
jp
On Mar 26, 11:17 am, kyoso...@gmail.com wrote:
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John

I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next
widget of interest. Something like that should work.

Mike

Isn't there just a simple configuration option to disable the tab
key? Like the takfocus option with Tkinter widgets?

Mar 26 '07 #4
jp
On Mar 26, 11:27 am, kyoso...@gmail.com wrote:
On Mar 26, 11:17 am, kyoso...@gmail.com wrote:
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John
I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next
# widget of interest. Something like that should work.
>
Mike

I looked in my Tkinter book, and it says that if the widget has the
"takefocus" option set to true, the widget is placed in the tab group
and will get focus when they are tabbed to. I assume that this means
if you set the PMW widgets' "takefocus" option to false, they will be
skipped over since they won't be in the tab group.

Mike
I've tried using the takefocus option set to 0 and 1 but either way,
the tab key still stops at my EntryField. Below is my snippet of
code. What am I doing wrong?

entry=Pmw.EntryField(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row=1)
#entry.component('entry').takefocus = 1
entry.component('entry').takefocus = 0

Mar 26 '07 #5
On Mar 26, 11:35 am, "jp" <johnpe...@yahoo.comwrote:
On Mar 26, 11:27 am, kyoso...@gmail.com wrote:On Mar 26, 11:17 am, kyoso...@gmail.com wrote:
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John
I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next

# widget of interest. Something like that should work.
Mike
I looked in my Tkinter book, and it says that if the widget has the
"takefocus" option set to true, the widget is placed in the tab group
and will get focus when they are tabbed to. I assume that this means
if you set the PMW widgets' "takefocus" option to false, they will be
skipped over since they won't be in the tab group.
Mike

I've tried using the takefocus option set to 0 and 1 but either way,
the tab key still stops at my EntryField. Below is my snippet of
code. What am I doing wrong?

entry=Pmw.EntryField(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row=1)
#entry.component('entry').takefocus = 1
entry.component('entry').takefocus = 0
According to the Tkinter book, setting takefocus to 0 (false) should
work. Are you putting th EntryField into a Grid? If so, that might be
the problem. I suppose the grid may override its children's settings.

I've never messed too much with skipping widgets in the tab order. You
could pack the PMW widgets last so that they won't get tabbed to until
the end.

There's also tk_focusNext & tk_focusPrev. See the following post for
more info and ideas:

http://www.dbforums.com/archive/inde...t-1377788.html

Mike

Mar 26 '07 #6
jp
On Mar 26, 12:34 pm, kyoso...@gmail.com wrote:
On Mar 26, 11:35 am, "jp" <johnpe...@yahoo.comwrote:
On Mar 26, 11:27 am, kyoso...@gmail.com wrote:On Mar 26, 11:17 am, kyoso...@gmail.com wrote:
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John
I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next
# widget of interest. Something like that should work.
Mike
I looked in my Tkinter book, and it says that if the widget has the
"takefocus" option set to true, the widget is placed in the tab group
and will get focus when they are tabbed to. I assume that this means
if you set the PMW widgets' "takefocus" option to false, they will be
skipped over since they won't be in the tab group.
Mike
I've tried using the takefocus option set to 0 and 1 but either way,
the tab key still stops at my EntryField. Below is my snippet of
code. What am I doing wrong?
entry=Pmw.EntryField(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row=1)
#entry.component('entry').takefocus = 1
entry.component('entry').takefocus = 0

According to the Tkinter book, setting takefocus to 0 (false) should
work. Are you putting th EntryField into a Grid? If so, that might be
the problem. I suppose the grid may override its children's settings.

I've never messed too much with skipping widgets in the tab order. You
could pack the PMW widgets last so that they won't get tabbed to until
the end.

There's also tk_focusNext & tk_focusPrev. See the following post for
more info and ideas:

http://www.dbforums.com/archive/inde...t-1377788.html

Mike

I am using a grid, but even using pack() the takefocus=0 doesn't
work. The tab key still moves to my EntryField.
I'll look into the focusNext and focusPrev that you suggested. Thanks!

Mar 26 '07 #7
On Mar 26, 1:17 pm, "jp" <johnpe...@yahoo.comwrote:
On Mar 26, 12:34 pm, kyoso...@gmail.com wrote:
On Mar 26, 11:35 am, "jp" <johnpe...@yahoo.comwrote:
On Mar 26, 11:27 am, kyoso...@gmail.com wrote:On Mar 26, 11:17 am, kyoso...@gmail.com wrote:
On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John
I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next
# widget of interest. Something like that should work.
Mike
I looked in my Tkinter book, and it says that if the widget has the
"takefocus" option set to true, the widget is placed in the tab group
and will get focus when they are tabbed to. I assume that this means
if you set the PMW widgets' "takefocus" option to false, they will be
skipped over since they won't be in the tab group.
Mike
I've tried using the takefocus option set to 0 and 1 but either way,
the tab key still stops at my EntryField. Below is my snippet of
code. What am I doing wrong?
entry=Pmw.EntryField(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row=1)
#entry.component('entry').takefocus = 1
entry.component('entry').takefocus = 0
According to the Tkinter book, setting takefocus to 0 (false) should
work. Are you putting th EntryField into a Grid? If so, that might be
the problem. I suppose the grid may override its children's settings.
I've never messed too much with skipping widgets in the tab order. You
could pack the PMW widgets last so that they won't get tabbed to until
the end.
There's also tk_focusNext & tk_focusPrev. See the following post for
more info and ideas:
http://www.dbforums.com/archive/inde...t-1377788.html
Mike

I am using a grid, but even using pack() the takefocus=0 doesn't
work. The tab key still moves to my EntryField.
I'll look into the focusNext and focusPrev that you suggested. Thanks!
Oops. Sorry. When I said grid, I was thinking that Tkinter had a grid
widget. I had forgotten they called one of there sizer/place
management options "grid". Sorry about that. I use wxPython as much as
possible.

Mike

Mar 26 '07 #8
jp wrote:
On Mar 26, 11:27 am, kyoso...@gmail.com wrote:
>>On Mar 26, 11:17 am, kyoso...@gmail.com wrote:

>>>On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
>>>>I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
>>>>Thank you,
John
>>>I would probably write some custom event handling. Something that
could tell it was a key-press event and not just an on-focus event.
Then it would be a simple, if key-press == tab, put focus on next

# widget of interest. Something like that should work.
>>>Mike

I looked in my Tkinter book, and it says that if the widget has the
"takefocus" option set to true, the widget is placed in the tab group
and will get focus when they are tabbed to. I assume that this means
if you set the PMW widgets' "takefocus" option to false, they will be
skipped over since they won't be in the tab group.

Mike


I've tried using the takefocus option set to 0 and 1 but either way,
the tab key still stops at my EntryField. Below is my snippet of
code. What am I doing wrong?

entry=Pmw.EntryField(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row=1)
#entry.component('entry').takefocus = 1
entry.component('entry').takefocus = 0
Are you sure you don't mean:

entry.component('entry')['takefocus'] = 0

which is equivalent to

entry.component('entry').config(takefocus=0)

James
Mar 26 '07 #9
jp wrote:
>>On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John
What version of Pmw are you using ? Tabbing between widgets works fine
on my system (Pmw 1.2, tk 8.4, KDE)

I can change the focus behaviour by using the takefocus option. You
were on the right track, you just did it wrong (see code below):

################################################## ######################
from Tkinter import *
import Pmw

root = Tk()
entry = Pmw.EntryField(root, labelpos=W, value="", label_text='Name:')
entry.grid(row=1)
entry.component('entry').configure(takefocus=0)

Button(root,text='test1').grid(row=2)
Button(root,text='test2').grid(row=3)
Button(root,text='test3').grid(row=4)

root.mainloop()
################################################## #######################

Regards,

John
Mar 26 '07 #10
jp
On Mar 26, 5:41 pm, John McMonagle <jmcmona...@velseis.com.auwrote:
jp wrote:
>On Mar 26, 10:51 am, "jp" <johnpe...@yahoo.comwrote:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can
I skip over these widgets when using the tab key?
Thank you,
John

What version of Pmw are you using ? Tabbing between widgets works fine
on my system (Pmw 1.2, tk 8.4, KDE)

I can change the focus behaviour by using the takefocus option. You
were on the right track, you just did it wrong (see code below):

################################################## ######################
from Tkinter import *
import Pmw

root = Tk()
entry = Pmw.EntryField(root, labelpos=W, value="", label_text='Name:')
entry.grid(row=1)
entry.component('entry').configure(takefocus=0)

Button(root,text='test1').grid(row=2)
Button(root,text='test2').grid(row=3)
Button(root,text='test3').grid(row=4)

root.mainloop()
################################################## #######################

Regards,

John

Thank you for pointing out my error, John and James. I had the syntax
of the command messed up. Using the following does cause the field to
be skipped when tabbing:
entry.component('entry').configure(takefocus=0)

John

Mar 27 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Phil Schmidt | last post by:
I'm trying to make a custom entry widget, as in the code that follows. There are two problems I'm trying to fix: 1) I would like the widget to behave as myEntry.Escape() does now, except that it...
145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
4
by: Michael Onfrek | last post by:
Hi, is copy, paste, cut of selection possible in entry widget? Docs say selection must be copied by default, in my programm it doesn't work. Regards, M.O.
6
by: William Gill | last post by:
I am trying to get & set the properties of a widget's parent widget. What I have works, but seems like a long way around the block. First I get the widget name using w.winfo_parent(), then i...
13
by: Monty | last post by:
I've been searching for guidance on which of the approaches used for skipping repetive links (e.g., link as normal text, link as alt text on invisible image, link with same forground and background...
1
by: Tom | last post by:
A dumb question: Exactly how does tabbing work in an ASP.NET form in the browser? Does it work the same was as a Windows Forms form does? I have a rather complicated ASP form (that consists of...
1
by: osmarjunior | last post by:
I have a DataGridView with some read-only cells. I want it skips these cells when the user press Tab or Shift+Tab keys. How can I do this? Thanks. Junior.
6
by: Doug Bell | last post by:
Hi I have a DataGrid with some hidden columns and also some read Only and some ComboBox Columns. Sandard Tabbing through the Datagrid sees the focus go to the hidden columns requiring further...
3
by: Ty | last post by:
I am creating a ASP.net project and I wanted to make it so that when the user tabs on on of my pages that they do not have to tab through some controls. Is there a way to skip controls while...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.