[pygtk] Keyboard Focus Issues
Damien Moore
damienlmoore at gmail.com
Sun Mar 29 01:51:37 WST 2009
Hi List,
I'm working on an photo viewer app. The app contains an gtk.HBox that
displays a collection of images in a gtk.DrawingArea, which has a custom
scrollbar and takes keyboard input such as the arrow keys to scroll the
view. This works fine.
I have a problem when I put some additional widgets in the HBox: some
gtk.Entry and gtk.Button widgets in a gtk.ScrolledWindow (i.e a scrolled
window separate from the DrawingArea). Now when I press the keyboard arrow
keys I get scrolling behavior in my DrawingArea AND focus changes between
elements and scrolling in the gtk.ScrolledWindow. Is there an easy way I can
override the automated focus behavior so that the arrow keys only scroll the
DrawingArea. I guess one way would be to lock the focus on the DrawingArea
unless the user clicks in the ScolledWindow, but then I have make the
DrawingArea focusable and it might create confusion when the user want to
scroll the Drawing Area but it doesn't have the focus... Are there other
approaches to prevent the widgets in the ScrolledWindow from getting and
changing focus on keypresses?
cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090328/0a061654/attachment.htm
More information about the pygtk
mailing list