Reusing notebook pages?

Steven Swerling sswerling at yahoo.com
Wed Mar 30 16:36:58 UTC 2005


Cees de Groot wrote:
> Hi,
> 
> I have a UI with a tree on the left and depending on what's clicked on 
> the  right, any number of notebook pages with various widgets depending 
> on the  kind of item clicked on in the tree.
> 
> At the moment, I send #deleteAllPages to the notebook and recreate  
> everything with every click on the tree. As I have some items with 
> fairly  complex UI's and quite a bit of data, this takes too much time.
> 
> What is a good way to make sure that view creation is done only once 
> per  different notebook page?
> 
> (I'm clueless about caching views with wxWindows. All I can come up 
> with  is to create all notebook pages and selectively hide/display, but 
> this  seems like a maintenance headache...).
> 

Will "WxBookCtrl>>#insertPage:page:text:" help? It takes the desired
page index, the page (panel) to insert, and the tab label for the page.
  So could you create all your pages at app startup, hold them in a iv,
then use this call to insert them when they are needed? Or does deleting
the page from the notebook blast the handle for that page?




More information about the Wxsqueak mailing list