Not a problem here; I just want to know what you guys
advise...
I'm trying to create a panel whose content will be
pretty dynamic. When messages come in (every second
or so), window components (custom panels that display
signal strengths) will be created and destroyed.
These components will be laid out with sizers in
sizers in sizers.
I guessing that my best two options when changes need
to be made are either:
* Call methods like wxSizer:Remove & wxSizer:Insert.
or
* Create new sizers every time the page needs to be
updated and replace the old ones.
Both should work. The first is more efficient and the
latter is simpler code (and less instance members to
keep track of). I doubt performance will be an issue
since a slow update can just delay the next query,
which is not a big deal.
So, if you were in my shoes, which way would you go
(or would you not do it this way at all)? Have you
done something like this in the past? Did you
experience problems or instability?
All opinions are welcome. Feel free to post to the
list or to me directly if you don't want to waste
everyone's bandwidth.
Thanks,
Gre7g
···
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545469
Not a problem here; I just want to know what you guys
advise...
I'm trying to create a panel whose content will be
pretty dynamic. When messages come in (every second
or so), window components (custom panels that display
signal strengths) will be created and destroyed. These components will be laid out with sizers in
sizers in sizers.
I guessing that my best two options when changes need
to be made are either:
* Call methods like wxSizer:Remove & wxSizer:Insert.
or
* Create new sizers every time the page needs to be
updated and replace the old ones.
Both should work. The first is more efficient and the
latter is simpler code (and less instance members to
keep track of). I doubt performance will be an issue
since a slow update can just delay the next query,
which is not a big deal.
So, if you were in my shoes, which way would you go
(or would you not do it this way at all)?
If your panel items are always the same other than being shown or not shown then I would simply Show or Hide them as needed, and then call Layout. The sizer will automatically deal with hidden items as you would expect. Otherwise Insert and Remove are probably best.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Thursday, June 28, 2007, 7:55:08 PM, Gre7g Luterman wrote:
I'm trying to create a panel whose content will be
pretty dynamic. When messages come in (every second
or so), window components (custom panels that display
signal strengths) will be created and destroyed.
These components will be laid out with sizers in
sizers in sizers.
I guessing that my best two options when changes need
to be made are either:
* Call methods like wxSizer:Remove & wxSizer:Insert.
or
* Create new sizers every time the page needs to be
updated and replace the old ones.
or
wx.Sizer.Show & wx.Sizer.Hide: don't destroy anything, change the
contents of the panels and/or Show and Hide them (the panels) as you
need.
I guess it all depends on how the contents need to be shown.
-- tacao
No bits were harmed during the making of this e-mail.