473,786 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1918
On Mar 26, 10:51 am, "jp" <johnpe...@yaho o.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...@yaho o.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...@yaho o.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...@yaho o.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.Entry Field(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row= 1)
#entry.componen t('entry').take focus = 1
entry.component ('entry').takef ocus = 0

Mar 26 '07 #5
On Mar 26, 11:35 am, "jp" <johnpe...@yaho o.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...@yaho o.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.Entry Field(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row= 1)
#entry.componen t('entry').take focus = 1
entry.component ('entry').takef ocus = 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...@yaho o.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...@yaho o.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.Entry Field(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row= 1)
#entry.componen t('entry').take focus = 1
entry.component ('entry').takef ocus = 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...@yaho o.comwrote:
On Mar 26, 12:34 pm, kyoso...@gmail. com wrote:
On Mar 26, 11:35 am, "jp" <johnpe...@yaho o.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...@yaho o.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.Entry Field(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row= 1)
#entry.componen t('entry').take focus = 1
entry.component ('entry').takef ocus = 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...@yaho o.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.Entry Field(frame,
labelpos = 'w',
value = "",
label_text =
'Name:')
entry.grid(row= 1)
#entry.componen t('entry').take focus = 1
entry.component ('entry').takef ocus = 0
Are you sure you don't mean:

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

which is equivalent to

entry.component ('entry').confi g(takefocus=0)

James
Mar 26 '07 #9
jp wrote:
>>On Mar 26, 10:51 am, "jp" <johnpe...@yaho o.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='Nam e:')
entry.grid(row= 1)
entry.component ('entry').confi gure(takefocus= 0)

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

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

Regards,

John
Mar 26 '07 #10

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

Similar topics

3
4934
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 happens on loss of focus, not when pressing Esc. 2) TABbing between multiple entry fields does undesired things with the selection, and with cursor placement. Can anyone offer any suggestions for how to fix this? I'm attemting to
145
6381
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 unecessary? Here is an example of a Python class with all three types of methods (instance, static, and class methods). # Example from Ch.23, p.381-2 of Learning Python, 2nd ed. class Multi:
4
6233
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
10306
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 convert the name to a reference using nametowidget(). self.nametowidget(event.widget.winfo_parent()).hasChanged= True It works, but I can't help but think I'm missing a more direct route. Am I? Bill
13
2624
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 colors that becomes visible when in hover or active state using css) is the best approach. Is there any place on the net where this is addressed? Thanks in advance.
1
1407
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 HTML tables, ASP text boxes, drop downs, data grids, etc)... and no matter how I set the TAB indexes, it never seems to work the way I want it to - sometimes tabbing all over the place! What am I doing wrong? Thanks for any input...
1
6040
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
2246
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 Tabbing to get to the desired column but it works fine stopping correctly on the ComboBox column. I have built a routine to test whether the use is Tabbing forward or back (Shift Tab) by looking at the last location, not by trapping the Keys. If
3
2624
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 tabbing? Thanks, Ty
0
9492
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9960
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.