0

I am trying to make a wxpython program using multiple XRC files. I would like to load several panels from different XRC files into the same frame. I would like to keep the panels in separate XRC files because each of them will be a plugin for a much larger program.

An example describing how to load many XRC files into the same frame would be awesome.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
John
  • 1
  • 1

1 Answers1

1

I know this question is very old but for completion's sake. I would initialise different panels from XRC inside a frame like so:

self.res1 = xrc.XmlResource('Panel1.xrc')
self.panel1 = self.res1.LoadPanel(self, "BtnPanel")
self.p1 = wx.Panel(self.panel1)

self.res2 = xrc.XmlResource('Panel2.xrc')
self.panel2 = self.res2.LoadPanel(self, "TxtPanel")
self.p2 = wx.Panel(self.panel2)

There are also some good tutorial for that (e.g. http://wiki.wxpython.org/XRCTutorial or http://wiki.wxpython.org/UsingXmlResources) that can be used as guidelines. Also the xrc.XmlResource documentation is useful to find the available methods.

Hopefully this is still useful. Enjoy.

Nebelhom
  • 3,783
  • 4
  • 21
  • 22