agw.aui.AuiNotebook - content of a notebook pane "refresh" / (connect _mgr references w/ variable data)

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

www.roglink.com

Geschï¿œftsfï¿œhrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Hi Tobias,

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?

I use "aui.EVT_AUINOTEBOOK_PAGE_CHANGING" event handler, evt.GetSelection gives you what page is being selected.

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?

I am not sure I understand. What are these variables? Data from your db, controls .....? You passed them in to each pane, wouldn't the pane then already have/keep a reference to them.

Werner

···

On 10/27/2011 12:03 AM, Tobias Weber wrote:

Hi Tobias,

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?

I use "aui.EVT_AUINOTEBOOK_PAGE_CHANGING" event handler,
evt.GetSelection gives you what page is being selected.

Thanks

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?

I am not sure I understand. What are these variables? Data from your
db, controls .....? You passed them in to each pane, wouldn't the pane
then already have/keep a reference to them.

The data is loaded from a db and filled into ListCtrls. The prob is that
I am creating the pane inside my AuiFrame class in a def and do not know
how to 'store it away' so when a new pane is created via calling that
same def my list values do not get overwritten. Pressing the button
triggers the ListCtrl values, partly changed from the user, to b e
reread- so I need to reference these lists-
So to the question: Well- yes- but the reference is overwritten w/ a new
instance each time I create a new pane. Basically I have problems
implementing 'Pythonic' style lists or
dicts instead of, what I did in static languages, dynamically create
variables as a reference. Right now I have a hard time following
recommended Python lines, but each time I did I found it worth it in the
end, i.e. learn ...
What I had to do then, I guess, is make the panes available outside my
AuiFrame. So I nedd to instanciate them with a unique reference and
thus make the data associated w/ it available for later use. The mgr
implemented methods evt.getSelection, etc are a mere reference to the
visual representation, not the data itself I guess. So I have
to make my own reference(like i.e. a dict) that connects the active pane
and the data it is holding ....
It sure is homework time for me now and get myself to re-think. If only
I did not lack sleep ....

Does anybody maybe have a simple example that creates x panels and holds
references to the ctrl(s) in each panel, so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

Thank you Werner,
helpful as always

TObi

···

Am 27.10.11 11:55, schrieb werner:

On 10/27/2011 12:03 AM, Tobias Weber wrote:

Werner

Hi Tobias,

...

Does anybody maybe have a simple example that creates x panels and holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a reference to its children, even if you don't give an explicit name to each doing "self.mycontrol = somecontrol(panel, ....).

  so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is too much and might just cause more confusion.

Werner

···

On 10/27/2011 02:56 PM, Tobias Weber wrote:

Thanl you- I'll give it a shot right away

···

Am 27.10.11 15:42, schrieb werner:

Hi Tobias,

On 10/27/2011 02:56 PM, Tobias Weber wrote:
...

Does anybody maybe have a simple example that creates x panels and holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

  so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is
too much and might just cause more confusion.

Werner

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

I think i am stuck with a simple thinking problem .. I am putting
together a demo to show my problem and hope maybe s.o. can have a look
at it cause I am pretty sure it is sticking out but unfortunately not
into my eye ...

I'll be back ... (though not from Austria :wink: )

···

Am 27.10.11 15:47, schrieb Tobias Weber:

Am 27.10.11 15:42, schrieb werner:

Hi Tobias,

On 10/27/2011 02:56 PM, Tobias Weber wrote:
...

Does anybody maybe have a simple example that creates x panels and holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

  so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is
too much and might just cause more confusion.

Werner

Thanl you- I'll give it a shot right away

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Another thought, as GetChildren() will give you all controls on that panel you could also keep/maintain your own list.

In the init of your generic panel have:

self.myInterestingControls =

when you add a control:

somec = wx.TextCtrl(panel, ....

self.myInterestingControls.append(somec)

Then use self.myInterestingControls in your button handler. If you need more info per control then either make it a dict or add a tuple per control.

self.myInterestingControls.append((somec, someotherinfo, and somemore))

Werner

···

On 10/27/2011 03:47 PM, Tobias Weber wrote:

Am 27.10.11 15:42, schrieb werner:

Hi Tobias,

On 10/27/2011 02:56 PM, Tobias Weber wrote:
...

Does anybody maybe have a simple example that creates x panels and holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

   so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is
too much and might just cause more confusion.

Werner

Thanl you- I'll give it a shot right away

Attached a stripped down and copy-pasted example that works and
demonstrates my problem.

Open it and klick on one of the items in the left List
This opens up a new pane in the notebook
In line
304
i call to create the new pane

which happens in line
3322
(pls neglect copy-paste-code and hacked stuff otherwise- oj not always-
in seperate modules- i know its ugly in this demo)

in line
3388
I create the 1st ListCtrl and fill it , etc....
in line
3601
I create the button
binding it to line
3738
where the save function is called

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am making but
I've been burning midnight oil for days/ nights w/ other projects and I
simply do not see it ...

Thanks for any contribution and eye-opening.

Cheers

pane-prob.zip (130 KB)

···

Am 27.10.11 16:43, schrieb werner:

On 10/27/2011 03:47 PM, Tobias Weber wrote:

Am 27.10.11 15:42, schrieb werner:

Hi Tobias,

On 10/27/2011 02:56 PM, Tobias Weber wrote:
...

Does anybody maybe have a simple example that creates x panels and
holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

   so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is
too much and might just cause more confusion.

Werner

Thanl you- I'll give it a shot right away

Another thought, as GetChildren() will give you all controls on that
panel you could also keep/maintain your own list.

In the init of your generic panel have:

self.myInterestingControls =

when you add a control:

somec = wx.TextCtrl(panel, ....

self.myInterestingControls.append(somec)

Then use self.myInterestingControls in your button handler. If you
need more info per control then either make it a dict or add a tuple
per control.

self.myInterestingControls.append((somec, someotherinfo, and somemore))

Werner

I hope its OK to attach zips- but it loads from a file structure so i
thought its easier this way ...

···

Am 27.10.11 17:38, schrieb Tobias Weber:

Am 27.10.11 16:43, schrieb werner:

On 10/27/2011 03:47 PM, Tobias Weber wrote:

Am 27.10.11 15:42, schrieb werner:

Hi Tobias,

On 10/27/2011 02:56 PM, Tobias Weber wrote:
...

Does anybody maybe have a simple example that creates x panels and
holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

   so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is
too much and might just cause more confusion.

Werner

Thanl you- I'll give it a shot right away

Another thought, as GetChildren() will give you all controls on that
panel you could also keep/maintain your own list.

In the init of your generic panel have:

self.myInterestingControls =

when you add a control:

somec = wx.TextCtrl(panel, ....

self.myInterestingControls.append(somec)

Then use self.myInterestingControls in your button handler. If you
need more info per control then either make it a dict or add a tuple
per control.

self.myInterestingControls.append((somec, someotherinfo, and somemore))

Werner

Attached a stripped down and copy-pasted example that works and
demonstrates my problem.

Open it and klick on one of the items in the left List
This opens up a new pane in the notebook
In line
304
i call to create the new pane

which happens in line
3322
(pls neglect copy-paste-code and hacked stuff otherwise- oj not always-
in seperate modules- i know its ugly in this demo)

in line
3388
I create the 1st ListCtrl and fill it , etc....
in line
3601
I create the button
binding it to line
3738
where the save function is called

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am making but
I've been burning midnight oil for days/ nights w/ other projects and I
simply do not see it ...

Thanks for any contribution and eye-opening.

Cheers

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Tobi,

import images and art_image is failing, i.e. not there.

Werner

They are from Andrea's demo so I forgot- Sorry

art_image.py (12 KB)

images.py (497 KB)

···

Am 27.10.11 17:49, schrieb werner:

Tobi,

import images and art_image is failing, i.e. not there.

Werner

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Sorry don't get it, what are you overwriting?

I opened three panes "Es3451M", "ES4140" and "ES3640" and the panes on the right show different information for each item.

BTW, I got encoding errors on some of the "print" statements containing German Umlaute. Might have to do with me running my Win 7 in a VirtualBox which is hosted on Ubuntu.

My work around for this for a long time now is adding the following to the top the main app file.

# people say one should leave this alone and use decode/encode, or define this
# in sitecustomize.py
# either of them don't really work for me, so as long as the following does
# this is what I will do until I switch to Py 3.x
import sys
if hasattr(sys, "frozen"): #Py2Exe does not run Site.py
     sys.setdefaultencoding('utf-8')
     del sys.setdefaultencoding
else: #The Python interpreter needs to reload the function
     reload(sys)
     sys.setdefaultencoding('utf-8')
     del sys.setdefaultencoding

Werner

···

On 10/27/2011 05:38 PM, Tobias Weber wrote:

Am 27.10.11 16:43, schrieb werner:

On 10/27/2011 03:47 PM, Tobias Weber wrote:

Am 27.10.11 15:42, schrieb werner:

Hi Tobias,

On 10/27/2011 02:56 PM, Tobias Weber wrote:
...

Does anybody maybe have a simple example that creates x panels and
holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

    so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think this is
too much and might just cause more confusion.

Werner

Thanl you- I'll give it a shot right away

Another thought, as GetChildren() will give you all controls on that
panel you could also keep/maintain your own list.

In the init of your generic panel have:

self.myInterestingControls =

when you add a control:

somec = wx.TextCtrl(panel, ....

self.myInterestingControls.append(somec)

Then use self.myInterestingControls in your button handler. If you
need more info per control then either make it a dict or add a tuple
per control.

self.myInterestingControls.append((somec, someotherinfo, and somemore))

Werner

Attached a stripped down and copy-pasted example that works and
demonstrates my problem.

Open it and klick on one of the items in the left List
This opens up a new pane in the notebook
In line
304
i call to create the new pane

which happens in line
3322
(pls neglect copy-paste-code and hacked stuff otherwise- oj not always-
in seperate modules- i know its ugly in this demo)

in line
3388
I create the 1st ListCtrl and fill it , etc....
in line
3601
I create the button
binding it to line
3738
where the save function is called

Create the 1st panel- fine- create another panel- I am overwriting ...

Hi Tobias,

...

Does anybody maybe have a simple example that creates x panels and
holds
references to the ctrl(s) in each panel,

Unless I misunderstand what you want, the panel automatically holds a
reference to its children, even if you don't give an explicit name to
each doing "self.mycontrol = somecontrol(panel, ....).

    so that a button on each panel
always returns the Ctrls of the currrently selected(active) panel? i
need a jumpstart for my brains ...

What about "self.GetParent().GetChildren()" in your button control
handler assuming that it is on the panel you are interested in.

I was going to include some of my code as a sample but I think
this is
too much and might just cause more confusion.

Werner

Thanl you- I'll give it a shot right away

Another thought, as GetChildren() will give you all controls on that
panel you could also keep/maintain your own list.

In the init of your generic panel have:

self.myInterestingControls =

when you add a control:

somec = wx.TextCtrl(panel, ....

self.myInterestingControls.append(somec)

Then use self.myInterestingControls in your button handler. If you
need more info per control then either make it a dict or add a tuple
per control.

self.myInterestingControls.append((somec, someotherinfo, and somemore))

Werner

Attached a stripped down and copy-pasted example that works and
demonstrates my problem.

Open it and klick on one of the items in the left List
This opens up a new pane in the notebook
In line
304
i call to create the new pane

which happens in line
3322
(pls neglect copy-paste-code and hacked stuff otherwise- oj not always-
in seperate modules- i know its ugly in this demo)

in line
3388
I create the 1st ListCtrl and fill it , etc....
in line
3601
I create the button
binding it to line
3738
where the save function is called

Create the 1st panel- fine- create another panel- I am overwriting ...

Sorry don't get it, what are you overwriting?

I opened three panes "Es3451M", "ES4140" and "ES3640" and the panes on
the right show different information for each item.

Correct- but:

open pane 1:
edit the 1st cell in the 1st Column (St�ck)
press the button- all correct
open a 2nd panel and edit the 1st column- �ress the button all correct
go back to the 1st panel and change the value in the 1st column and
press enter.
The values of the last added panel are being read- no the
active/selected panel
You can see it i.e. by printing the calcdata dictionary
So what do I want?:
I add the contents of the cells to the dict, i.e. the unique number in
the db and number the user entered (St�ck)
so when the user selects any panel and changes that value I need to
replace exactly that value, i.e. read the status (and cell values) of
the panel the button was pressed on.
Meaning: I do not have a "put the correct initial data x panels"-prob
but a "read the changed data back"-prob... :frowning:

BTW, I got encoding errors on some of the "print" statements
containing German Umlaute. Might have to do with me running my Win 7
in a VirtualBox which is hosted on Ubuntu.

My work around for this for a long time now is adding the following to
the top the main app file.

# people say one should leave this alone and use decode/encode, or
define this
# in sitecustomize.py
# either of them don't really work for me, so as long as the following
does
# this is what I will do until I switch to Py 3.x
import sys
if hasattr(sys, "frozen"): #Py2Exe does not run Site.py
    sys.setdefaultencoding('utf-8')
    del sys.setdefaultencoding
else: #The Python interpreter needs to reload
the function
    reload(sys)
    sys.setdefaultencoding('utf-8')
    del sys.setdefaultencoding

Thanks for the advice- I will sure include that- I already put that on
the list of things to do after your post from October 20 in which you
included it :slight_smile:

Tobi

···

Am 27.10.11 19:10, schrieb werner:

On 10/27/2011 05:38 PM, Tobias Weber wrote:

Am 27.10.11 16:43, schrieb werner:

On 10/27/2011 03:47 PM, Tobias Weber wrote:

Am 27.10.11 15:42, schrieb werner:

On 10/27/2011 02:56 PM, Tobias Weber wrote:

Werner

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Hi Tobias,

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am making but
I've been burning midnight oil for days/ nights w/ other projects and I
simply do not see it ...

I think I get it, you mean the printed/debug values when clicking "Uebernehmen" are not correct.

I am not sure yet, but I think it is in "MkTabPaneProduct" you are creating "self.panel".

Added a print "print 'CREATE %s' % self"

Which gives me:
CREATE <__main__.AuiFrame; proxy of <Swig Object of type 'wxFrame *' at 0x23b1458> >
CREATE <__main__.AuiFrame; proxy of <Swig Object of type 'wxFrame *' at 0x23b1458> >
CREATE <__main__.AuiFrame; proxy of <Swig Object of type 'wxFrame *' at 0x23b1458> >

So, self.panel will refer to which ever panel was created last, I don't think that is what you want.

Does that get you going or do would you like me to look into it further?

Werner

P.S.
You might also want to look into "logging" module when you have a moment and replace your 160 odd print statements with logging.debug('whatever info')

Hi Tobias,

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am making but
I've been burning midnight oil for days/ nights w/ other projects and I
simply do not see it ...

I think I get it, you mean the printed/debug values when clicking
"Uebernehmen" are not correct.

I am not sure yet, but I think it is in "MkTabPaneProduct" you are
creating "self.panel".

Added a print "print 'CREATE %s' % self"

Which gives me:
CREATE <__main__.AuiFrame; proxy of <Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE <__main__.AuiFrame; proxy of <Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE <__main__.AuiFrame; proxy of <Swig Object of type 'wxFrame *'
at 0x23b1458> >

So, self.panel will refer to which ever panel was created last, I
don't think that is what you want.

Does that get you going or do would you like me to look into it further?

Werner

I just identified that as well and am still blank about how to get what
I want.
So if you could I would VERY MUCH appreciate an approach/ solution to my
problem, i.e. get the button on ech panel to return the value of the
actual panel... (if its not too much to ask for)

P.S.
You might also want to look into "logging" module when you have a
moment and replace your 160 odd print statements with
logging.debug('whatever info')

logging — Logging facility for Python — Python 3.13.0 documentation

Thanks- will do

···

Am 27.10.11 19:40, schrieb werner:

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

I thought the solution must be simple, but couldn't have told you without trying it myself.

Basically change "self.panel" to e.g. 'aPanel', change all the lists from self.list1 = virt(parent=self.panel) to aPanel.list1 = virt(parent=self.panel....) and in SaveProduct use the current_page.list1 instead of self.list1.

I think this is it, at least it looks like it to me.

Will send you the changed code off-list.

Werner

···

On 10/27/2011 07:51 PM, Tobias Weber wrote:

Am 27.10.11 19:40, schrieb werner:

Hi Tobias,

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am making but
I've been burning midnight oil for days/ nights w/ other projects and I
simply do not see it ...

I think I get it, you mean the printed/debug values when clicking
"Uebernehmen" are not correct.

I am not sure yet, but I think it is in "MkTabPaneProduct" you are
creating "self.panel".

Added a print "print 'CREATE %s' % self"

Which gives me:
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >

So, self.panel will refer to which ever panel was created last, I
don't think that is what you want.

Does that get you going or do would you like me to look into it further?

Werner

I just identified that as well and am still blank about how to get what
I want.
So if you could I would VERY MUCH appreciate an approach/ solution to my
problem, i.e. get the button on ech panel to return the value of the
actual panel... (if its not too much to ask for)

Werner, you are my hero.
Merci inifiniment - je n'ai pas perdu ma journ�e! ... ou ma nuit.

I only did a quick check on the variables and a return value and now am
going to study the code and adapt it for my purposes.
Not only did you help me out a lot by this but also w/ many hints and
receommendations in the past.

I hope I can give sthg back to the (wx/Python) community one of these days.

Cheers,

Tobi

···

Am 27.10.11 21:57, schrieb werner:

On 10/27/2011 07:51 PM, Tobias Weber wrote:

Am 27.10.11 19:40, schrieb werner:

Hi Tobias,

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am
making but
I've been burning midnight oil for days/ nights w/ other projects
and I
simply do not see it ...

I think I get it, you mean the printed/debug values when clicking
"Uebernehmen" are not correct.

I am not sure yet, but I think it is in "MkTabPaneProduct" you are
creating "self.panel".

Added a print "print 'CREATE %s' % self"

Which gives me:
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >

So, self.panel will refer to which ever panel was created last, I
don't think that is what you want.

Does that get you going or do would you like me to look into it
further?

Werner

I just identified that as well and am still blank about how to get what
I want.
So if you could I would VERY MUCH appreciate an approach/ solution to my
problem, i.e. get the button on ech panel to return the value of the
actual panel... (if its not too much to ask for)

I thought the solution must be simple, but couldn't have told you
without trying it myself.

Basically change "self.panel" to e.g. 'aPanel', change all the lists
from self.list1 = virt(parent=self.panel) to aPanel.list1 =
virt(parent=self.panel....) and in SaveProduct use the
current_page.list1 instead of self.list1.

I think this is it, at least it looks like it to me.

Will send you the changed code off-list.

Werner

It's still amazing to profit from the idea of 'the community' and
sharing hints, tips and proficiency ...

Thank you (all)

···

Am 27.10.11 21:57, schrieb werner:

On 10/27/2011 07:51 PM, Tobias Weber wrote:

Am 27.10.11 19:40, schrieb werner:

Hi Tobias,

Create the 1st panel- fine- create another panel- I am overwriting ...
I am still sure its a very basic and embarrasing mistake I am
making but
I've been burning midnight oil for days/ nights w/ other projects
and I
simply do not see it ...

I think I get it, you mean the printed/debug values when clicking
"Uebernehmen" are not correct.

I am not sure yet, but I think it is in "MkTabPaneProduct" you are
creating "self.panel".

Added a print "print 'CREATE %s' % self"

Which gives me:
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >
CREATE<__main__.AuiFrame; proxy of<Swig Object of type 'wxFrame *'
at 0x23b1458> >

So, self.panel will refer to which ever panel was created last, I
don't think that is what you want.

Does that get you going or do would you like me to look into it
further?

Werner

I just identified that as well and am still blank about how to get what
I want.
So if you could I would VERY MUCH appreciate an approach/ solution to my
problem, i.e. get the button on ech panel to return the value of the
actual panel... (if its not too much to ask for)

I thought the solution must be simple, but couldn't have told you
without trying it myself.

Basically change "self.panel" to e.g. 'aPanel', change all the lists
from self.list1 = virt(parent=self.panel) to aPanel.list1 =
virt(parent=self.panel....) and in SaveProduct use the
current_page.list1 instead of self.list1.

I think this is it, at least it looks like it to me.

Will send you the changed code off-list.

Werner

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

Gesch�ftsf�hrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

You are welcome.

"hero" status on here, I still think this goes to persons like Robin, Andrea, Cody, Kevin, Peter Damoc and I am sure there are many more I should name here.

While this helped you there is also some self interest in this, I believe it was Peter Damoc who put me on to this. I read just about every post and very often I try to figure out the answer to the question and I have learned tons by doing this as one can compare ones answer to the answer which worked and for me it "sinks" in more doing it myself instead of just reading the answer from some one else.

Anyhow thanks to everyone who makes this community work and we all know who should get the biggest thanks;-) .

Werner

···

On 10/27/2011 10:21 PM, Tobias Weber wrote:

Werner, you are my hero.
Merci inifiniment - je n'ai pas perdu ma journ�e! ... ou ma nuit.