[wxpython-users] newbie with some questions
by Tim Mortimer other posts by this author
May 9 2008 4:00AM messages near this date
Re: [wxpython-users] newbie with questions
|
Re: [wxpython-users] newbie with some questions
Hello,
I am new to wxPython, & it's the first GUI tool i've ever used.
(although i've been sniffing around this vicinity once or twice before
without making much progress...)
I started teaching myself Python circa June 2007, primarily to work with
Csound to make "ambient", "experimental", &/or "generative" types of music.
I now wish to use wxPython to start developing some GUI / front ends for
my ideas.
I have the "wx In Action" book & i have found it very helpful. Thank you
to the authors.
I have also been poking around with wxGlade over the last couple of days.
I have some questions that haven't been answered through using the wx In
Action book, & also as a result of looking through the wxPython demo
application.
Primarily they are
1) How can i add more than one Grid into a split wxFrame?
wxGlade allows me to do so, & publishes a preview ok. However the
example of this I have attached (admittedly with only 1 Grid, but the
principle is the same) won't run as a standalone script on my windows XP
machine.
It's the whole attaching Grid to a host Frame as "self" thing (see line
22 of the example code)... how can this be done (if wxGlade can preview
it ok, then surely somehow it is possible?)
2) I'm a little nervous because in the wxPython demo app for Grid it says
"This demo shows various ways of using the new and improved wx.Grid
class. Unfortunatly it has not been documented yet, and while it is
somewhat backwards compatible, if you try to go by the current wx.Grid
documentation you will probably just confuse yourself. "
Assumedly then this is also true vis a vis the information in the wx In
Action book then also?
What's a generally befuddled novitiate like me therefore to do? Most of
what i have tried with the Grid by way of the book examples seems to
work after all...
3) Can someone show me in a general way (or link me appropriately, this
must be asked all the time...) how to conditionally redraw & refresh the
interface with widgets?
For example, lets say i have a list box, with available selections
1,2,3, or 4
The selection is evaluated, & based on this i'd like to repopulate the
Panel & have that many checkboxes (for example) displayed
I actually want to take this one step further & define my own custom row
of checkboxes (assumedly as a Class "MyCustomCheckList")
x x x x x x x
& then populate the screen with this many rows of the CustomCheckList
eg:
selection : 3
display:
x x x x x x x
x x x x x x x
x x x x x x x
(3 rows of CustomCheckList objects)
I'm sure some simple "for n in range(selection)" type statements can
deliver the goods, but is there any special threading or refresh display
calls required to redraw the GUI to the screen?
Of course, if I can get one or more Grids happening in a split frame,
then I can assumedly just re-label (&/or reformat) the rows of the grid
to reflect "this row active", & use checkboxes as cell types to get the
same overall effect. But then we are back to point 1) above
Im looking forward to getting my hands dirty, & i'd welcome any
assistance to hit the ground running.
cheers
Tim (Adelaide, Australia - if you are local & keen to chat Python &/or
wx please get in touch!)
Thread:
Tim Mortimer
Mike Driscoll
|