Re: Notebook problem

40 views
Skip to first unread message

Mike Driscoll

unread,
Jul 18, 2012, 11:40:35 AM7/18/12
to wxpytho...@googlegroups.com
Hi,

On Wednesday, July 18, 2012 10:05:12 AM UTC-5, Brett Duncan wrote:
Hi!

I'm struggling with wxNotebook, specifically with switching between pages. I want to be able to trigger something on one page of a notebook and have my script switch to a different page, but I cannot seem to even get a simple case of a button on one page triggering a switch to a second page to work. The documentation seems to indicate that I should be using the ChangeSelection() method, and I find the same answer searching onling, but it  seems to do precisely nothing. I thought maybe I had overlooked a Refresh or Update call, but they seem to make no difference.

(I'm running Python 2.7.1 and wxPython 2.8.11.0 on a Macbook - OSX 10.6.8).

Any suggestions/advice appreciated.

Brett Duncan



It looks like SetSelection() works for me on Windows, Python 2.7.3 , wxPython 2.9.3.1. I have attached an example you can look at too.

- Mike

notty.py

Mike Driscoll

unread,
Jul 18, 2012, 11:43:22 AM7/18/12
to wxpytho...@googlegroups.com

EXTRA NOTE: I just tried it with ChangeSelection too and it worked for me as well...

- Mike

Robin Dunn

unread,
Jul 18, 2012, 12:05:05 PM7/18/12
to wxpytho...@googlegroups.com
On 7/18/12 8:05 AM, Brett Duncan wrote:
> Hi!
>
> I'm struggling with wxNotebook, specifically with switching between
> pages. I want to be able to trigger something on one page of a notebook
> and have my script switch to a different page, but I cannot seem to even
> get a simple case of a button on one page triggering a switch to a
> second page to work. The documentation seems to indicate that I should
> be using the ChangeSelection() method, and I find the same answer
> searching onling, but it seems to do precisely nothing. I thought maybe
> I had overlooked a Refresh or Update call, but they seem to make no
> difference.
>
> (I'm running Python 2.7.1 and wxPython 2.8.11.0 on a Macbook - OSX 10.6.8).

Please make a runnable, small as possible, sample application that
demonstrates the problem. http://wiki.wxpython.org/MakingSampleApps



--
Robin Dunn
Software Craftsman
http://wxPython.org



Brett Duncan

unread,
Jul 18, 2012, 9:56:55 PM7/18/12
to wxpytho...@googlegroups.com


On Thursday, July 19, 2012 1:40:35 AM UTC+10, Mike Driscoll wrote:
Hi,



It looks like SetSelection() works for me on Windows, Python 2.7.3 , wxPython 2.9.3.1. I have attached an example you can look at too.

- Mike


Mike, thank you very much! Your example worked, and from it I was able to see where I was going wrong. (Specifically, I was trying to call a method at the frame level to do what I wanted, which didn't generate any errors, but didn't give me the result I wanted either.)

Thanks again,

Brett Duncan
Reply all
Reply to author
Forward
0 new messages