wxPanel

Hey,
Everytime I put something on a wxPanel he doesn't show it right how can
this be ?

here's some code, the probleme is with HtmlPanel it doesn't show
HtmlWindow correct ..

class HtmlWindow(wxHtmlWindow):
  def __init__(self,parent,id):
    wxHtmlWindow.__init__(self,parent,id)
    self.LoadPage("http://www.google.be")
    
class HtmlPanel(wxPanel):
  def __init__(self,parent,id):
    wxPanel.__init__(self,parent,id)
    self.html = HtmlWindow(self,-1)

class MainFrame(wxFrame):
  def __init__(self,parent,id,title,get):
    self.get = get
    wxFrame.__init__(self,parent,id,title,wxDefaultPosition, wxSize(200,
150))
    self.splitter = wxSplitterWindow(self,-1)
    self.splitter.SplitVertically(leftSplitter(self.splitter,-1,self.get),HtmlPanel(self.splitter,-1))

Geiregat Jonas wrote:

Hey,
Everytime I put something on a wxPanel he doesn't show it right how can
this be ?

here's some code, the probleme is with HtmlPanel it doesn't show
HtmlWindow correct ..

You don't do anything to manage the size of the HtmlWindow. I assume that you want it to be the same size as the HtmlPanel, but the panel has no way of knowing that unless you tell it so. Please see the docs and samples about sizers for more complicated layouts, but here is a very simple example of the brute force method:

class HtmlPanel(wxPanel):
  def __init__(self,parent,id):
    wxPanel.__init__(self,parent,id)
    self.html = HtmlWindow(self,-1)
    EVT_SIZE(self, self.OnSize)

  def OnSize(self, evt):
    self.html.SetSize(self.GetClientSize())

···

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