wxPython Plot always comes to focus on redraw

Mike Driscoll kyosohma at gmail.com
Thu Feb 21 09:14:34 EST 2008


On Feb 21, 2:57 am, Jacob Davis <j.foster.da... at gmail.com> wrote:
> Hi.
>
> I am using wxPython, and I have a frame that has a notebook in it.
> there are 3 pages in the notebook, 2 of which are Panels and 1 of
> which is a PlotCanvas.  The data for the plot changes when I press a
> button that is in the frame, but not in the notebook (as designed).
> the button also makes the plot draw again, since the data has changed.
>
> The problem is that whenever I press my button, the focus of the
> notebook "view area" (as opposed to the tabs) changes focus to the
> plot.  if I have multiple plots, the focus goes to that plot which was
> drawn last in the code. however, if I click anywhere on the panel, the
> page of the notebook that is supposed to be in focus is now shown in
> the "view area" of the notebook.
>
> will try to make a sample .py if anybody needs a visual, let me know
> pls.
>
> Thanks for any help!
>
> Jake

Just a show in the dark, but is the plotcanvas object's parent a frame
or a panel? If it's the frame, than that's probably what the problem
is.

You may want to post to the wxPython list where you'll get wx geeks to
answer your question and you can learn a lot from them too. Here's a
link where you can sign up: http://wxpython.org/maillist.php

Mike




More information about the Python-list mailing list