Hari Coder wrote:
>
> Im new to python and if someone can explain to me or can help me in
> this following code why the data I want to show in the second panel
> doesn't appear exactly.
> The checkbox is not "checkable".
>
> If you try to all run the code , you'll see what I mean.
Your code does not actually run, because you left a reference to hideBtn
that does not exist.
The problem here is a subtle one. You may have noticed that your
checkboxes were all a different color than the rest of the window.
That's a clue to the problem. In wxWidgets, the usual dialog box
handling (tab navigation and such) is not provided by the frame. It's
provided by a panel. In your case, your second frame is creating a
panel, but you are creating the checkboxes as children of the frame, not
the panel. So, the clicks and keystrokes aren't getting forwarded
properly. If you change this:
self.cb = wx.CheckBox(new_frame,
label=address+"-"+postal_code+"-"+limit, pos=(10,Y))
to this:
self.cb = wx.CheckBox(new_frame.panel,
label=address+"-"+postal_code+"-"+limit, pos=(10,Y))
you'll find that it does what you expect.
By the way, you create an OtherFrame in your MainFrame.__init__, but you
never use it. If you really meant to use that instead of creating a new
OtherFrame each time, then you need to change ShowFrame to use
self.new_frame.other.
Also, in the line I changed above, you are overwriting self.cb every
time you create a new checkbox. You might not need to save them at all,
but if you do, you'll need to create a list, not a single variable.
--
Tim Roberts,
ti...@probo.com
Providenza & Boekelheide, Inc.