Hello, this is probably a beginner (which I am) question, but I can't
seem to answer it alone:
I have an app.
My app has a Frame, implemented by sub-classing wxFrame.
The frame has a button and a notebook.
The notebook has several panels, implemented by sub-classing wxPanel.
The panels have various controls.
In the frame class, I have defined an event handler to respond to the
button. In this handler, I want to retrieve the values of all of the
controls in all of the pages of my notebook, presumably using their
getValue() method.
But, I cannot seem to locate the descendants of the notebook. Am I
just missing something obvious?
Hello, this is probably a beginner (which I am) question, but I can't
seem to answer it alone:
I have an app.
My app has a Frame, implemented by sub-classing wxFrame.
The frame has a button and a notebook.
The notebook has several panels, implemented by sub-classing wxPanel.
The panels have various controls.
In the frame class, I have defined an event handler to respond to the
button. In this handler, I want to retrieve the values of all of the
controls in all of the pages of my notebook, presumably using their
getValue() method.
But, I cannot seem to locate the descendants of the notebook. Am I
just missing something obvious?
If you just want to get to each of the Panels you can do the following.
for idx in range(notebook.GetPageCount()):
page = notebook.GetPage(idx)
page.myGetValuesFunction()
Or if you need to descend into the panels children you can iterate of
the list returned by the GetChildren method. But you would be better
off letting each panel manage that itself and just have a method on
the panel object to retrieve the values.
Cody
···
On Tue, Aug 10, 2010 at 5:56 PM, Heath <heath@brownbarn.com> wrote:
Thanks, I did implement local methods to return a dictionary of the
control values.
My initial problem was actually due to poor indentation, the def was
not being recognized... all is well!
cheers,
-h
···
On Aug 10, 4:21 pm, Cody Precord <codyprec...@gmail.com> wrote:
Hi,
On Tue, Aug 10, 2010 at 5:56 PM, Heath <he...@brownbarn.com> wrote:
> Hello, this is probably a beginner (which I am) question, but I can't
> seem to answer it alone:
> I have an app.
> My app has a Frame, implemented by sub-classing wxFrame.
> The frame has a button and a notebook.
> The notebook has several panels, implemented by sub-classing wxPanel.
> The panels have various controls.
> In the frame class, I have defined an event handler to respond to the
> button. In this handler, I want to retrieve the values of all of the
> controls in all of the pages of my notebook, presumably using their
> getValue() method.
> But, I cannot seem to locate the descendants of the notebook. Am I
> just missing something obvious?
If you just want to get to each of the Panels you can do the following.
for idx in range(notebook.GetPageCount()):
page = notebook.GetPage(idx)
page.myGetValuesFunction()
Or if you need to descend into the panels children you can iterate of
the list returned by the GetChildren method. But you would be better
off letting each panel manage that itself and just have a method on
the panel object to retrieve the values.