John, On Nov 10, 2007 2:41 AM, John Hunter <[EMAIL PROTECTED]> wrote: > > Now that is a well focused question.
Thank you for your teaching. ^_^. > > A little googling revealed that > > when a gtk drawing area (eg an matplotlib canvas) is placed in a gtk > > notebook, it needs to have the focus to receive key press events. Thank you for the information. It's really the point. > I had hoped it would be enough to do > canvas.grab_focus() > but apparently it is not (upon testing). But the suggestion from the > link above to use TAB to grab the focus worked in my tests. > With a little more testing, I find if I grab the focus after showing > the window that the notebook is in, it works as expected: Thank you for your patient test. Just for information, it is also workable to set current page for notebook firstly and then grab focus for the drawing area, such as notebook.set_current_page(pageno) canvas.grab_focus() #canvas is the view embedded in page $pageno Thanks again for your help. -- sunzen <<freedom & enjoyment>> ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users