Hi,
I have been plaing around w/ Andrea's AGW.Aui.DockingLibrary example in
the demo.
I am well aware of the mgr, adding tabs, disabling them, etc ....
Now what I did is outside the AuiFrame of the demo I call a function
inside AuiFrame that creates a panel, fills it and adds it to the notebook
(all working perfectly)
including a button that reads in the lists (2 in my example, x in the
real thing)
The problem is now that when I add notebook panes and like this dynamically
I am overwriting the values w/ each new notebook pane (which does not
affect the visual representation of already created panes of course),
resulting in the button function to always refer to the listx values of
the last added pane.
So visually I have now x panes w/ the right content displayed, but on
activating a pane/ click it I do not overwrite the lists w/ these values
again and/ or update the button references.
Is there, or how would one have a kind of refresh function when a pane
is clicked?
Could I go for storing the panel reference and maybe the needed
variables away in a dict and access the dict on panel activation/
clicked or something?
Is there a recommended way to connect the notebook pane references in
_mgr w/ data references?
Thanks
AuiFrame.MkTabPaneProduct(self.parent, self,*lots of variables...*)
#which looks like:
def MkTabPaneProduct(self, event, *lots of variables*):
auibook = self._mgr.GetPane("notebook_content").window
panel = wx.Panel(self)
panel.SetBackgroundColour('White')
self.list1 = TestVirtualList(panel) # a ListCtrl
#... fill the list
self.list2 = TestVirtualList(panel)
#fill the list
# ... sizers etc ....
apply_button = wx.Button(panel, -1, u'Apply')
self.Bind(wx.EVT_BUTTON, self.SaveProduct, apply_button)
def SaveProduct(self,event):
# only a static example to demonstrate the scheme
maxItem = self.list1.GetItemCount()
cItem = 0
for x in range(self.list1.GetItemCount()):
lItem = self.list1.GetItem(x).GetText()
lItemData = self.list1.GetItemData(x)
print "Item col0: %s, data: %s" % (lItem, lItemData)
calcdata[lItemData] = int(lItem)
artikelnos.append(lItemData)
maxItem = self.list2.GetItemCount()
cItem = 0
for x in range(self.list2.GetItemCount()):
lItem = self.list2.GetItem(x).GetText()
lItemData = self.list2.GetItemData(x)
print "Item col0: %s, data: %s" % (lItem, lItemData)
calcdata[lItemData] = int(lItem)
artikelnos.append(lItemData)
···
--
--------------------------------------------------
Tobias Weber
CEO
The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56
Geschï¿œftsfï¿œhrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------