What's the best way to overlap controls ?

hello,

to handle different html documents and/or different OS's,
I want to make iewin.IEHtmlWindows and html.HtmlWindow that overlaps,
and while running my code, use the most appropriate one.
( I also want to use wxp-widgets and CSS translations)

I think I saw the code (shown below) somewhere,
and it seems to work.
- Put both controls in a boxsizer
- make one visible and the other invisible
- call Layout

Is this a good solution,
or are there better ones ?

thanks,
Stef Mientki

=== creation ===
    self.Html=iewin.IEHtmlWindow( self,style = wx.NO_FULL_REPAINT_ON_RESIZE)
    self.Html2=wx.html.HtmlWindow( self,style = wx.NO_FULL_REPAINT_ON_RESIZE)

    self.Sizer = wx.BoxSizer ( )
    self.Sizer.Add ( self.Html, 1, wx.EXPAND )
    self.Sizer.Add ( self.Html2, 1, wx.EXPAND )
    self.SetSizer ( self.Sizer )

=== loading a page ===
    self.Html.Show()
    self.Html2.Hide()
    self.Sizer.Layout ( )
    self.Html.LoadUrl ( ‘http://mathworld.wolfram.com/’ )

I don't know the answer to this, but here's another possible way of framing the problem: in REALbasic, there is a thing called a "PagePanel" which is like an invisible TabPanel (what we in wx world call a Notebook). That is, it doesn't have any GUI of its own. But you can still position controls in each page, and can (from code) control which page is shown at any given time.

It's a pretty elegant solution, since a PagePanel and a TabPanel are alike in every way except for the GUI used to label and control the pages. (In fact TabPanel derives from PagePanel, so you can easily have code that works with both.)

Is there anything similar in wx? I.e., a Notebook with no visual GUI?

Best,
- Joe

···

On Nov 14, 2008, at 1:44 PM, Stef Mientki wrote:

I think I saw the code (shown below) somewhere,
and it seems to work.
- Put both controls in a boxsizer
- make one visible and the other invisible
- call Layout

Is this a good solution, or are there better ones ?

Stef Mientki wrote:

hello,

to handle different html documents and/or different OS's,
I want to make iewin.IEHtmlWindows and html.HtmlWindow that overlaps,
and while running my code, use the most appropriate one.
( I also want to use wxp-widgets and CSS translations)

I think I saw the code (shown below) somewhere,
and it seems to work.
- Put both controls in a boxsizer
- make one visible and the other invisible
- call Layout

Is this a good solution,

Yes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Stef Mientki wrote:

hello,

to handle different html documents and/or different OS's,
I want to make iewin.IEHtmlWindows and html.HtmlWindow that overlaps,
and while running my code, use the most appropriate one.
( I also want to use wxp-widgets and CSS translations)

I think I saw the code (shown below) somewhere,
and it seems to work.
- Put both controls in a boxsizer
- make one visible and the other invisible
- call Layout

Is this a good solution,

Yes.

thanks Robin,

cheers,
Stef