[Python-3000] PyGUI in Py3K stdlib, more details
Antoine Pitrou
solipsis at pitrou.net
Mon May 1 21:37:01 CEST 2006
Le lundi 01 mai 2006 à 11:44 -0700, Bill Janssen a écrit :
> > - list controls
>
> Not sure what you mean here.
A control which displays and allows to interact with several lines of
widgets (e.g. labels, images...).
For example a buddy list in an Instant Messaging client.
> > - menu hotkeys (e.g. Alt+F to open File menu)
>
> Menus already support "keyboard equivalents".
> http://www.cosc.canterbury.ac.nz/~greg/python_gui/version/Doc/Menu.html
Yes but it is not the same.
"keyboard equivalents" are global key shorcuts. You cannot assign a
global key shortcut to every command, while you can assign a local
hotkey to any menu item. It is critical for accessibility: people must
be able to navigate menus entirely with the keyboard.
(it can be practical for advanced users too ;-))
The traditional API for this is to use an ampersand in the command
label: "&File" means the "File" menu can be accessed with Alt+F, and
"&Save" means that, when in the "File" menu, you can access the "Save"
command by hitting S.
(as a side-effect, this makes local hotkeys i18n-dependent: the French
version of "&Save" is often "&Enregistrer").
> > - status bars
>
> Why isn't that a label?
> http://www.cosc.canterbury.ac.nz/~greg/python_gui/version/Doc/Label.html
>
> You must mean something other than what I'm thinking. Are you referring
> to an animated progress bar, perhaps?
Well, a status bar is a container which can contain many things and sits
at the bottom of the window. It may have support for a resizing handle
too.
Think about your Web browser: at the bottom, a text label for the
current URL (or "loading", whatever), a progress bar for when something
is being fetched over the network, an togglable indicator of
on-line/off-line status, and a clickable lock icon to view the security
dialog.
It can probably be implemented using a Container, though.
> I see that when I use "sticky" appropriately, the few small test cases
> I've tried seem to resize the way I think they should.
In wxWidgets, the GUI system is able to calculate the minimal size
needed by each and any widget, and to prevent the user from resizing the
window below the calculated minimal size.
Without this feature, widgets disappear or overlap (depending on their
"sticky" flag) when you make the window too small.
Two other things I just noticed:
- tab-key navigation (navigating among controls by using Tab and
Shift-Tab) should be handled automatically. Right now it seems you have
to manually define "groups" for tab-key navigation to work.
- context menus (e.g. on right click).
All that is not to say that "PyGUI s*cks" (it doesn't seem to ;-)), but
that there are a few important things lacking compared to more mature
(and possibly bloated!) GUI systems.
Regards
Antoine.
More information about the Python-3000
mailing list