开发者

how to change page selection in wxNotebook or wxChoicebook?

Is there any way to change the page of a wxNotebook or wxChoicebook programmatically? Looking at the documentation I would have thought that wxChoicebook::ChangeSelection was the way to go, or wxChoicebook::SetSelection if I want the page changing/changed events to be sent开发者_开发知识库. However, I don't know what these functions expect as input. The seem to require a size_t type input, but all I get from a GetSelection is an integer. I'm working in wxPython if that helps.


I think you should be using wxNotebook::ChangeSelection, and in that function the size_t parameter refers to the integer index of the notebook page you would like to switch to. ChangeSelection(0) would change to the first notebook page, ChangeSelection(1) to the second, and so on.

I did test this in code, and it works. I use wxWidgets with C++ though, I didn't test wxPython. Hope that helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜