[fxruby-users] deleting children and then adding new ones

Ralph Douglass ralph at grayskies.net
Mon Dec 10 22:50:47 EST 2007

Thanks, the recalc and create worked really well.  I saw the example of the
FXSwitcher widget on the website, but thought it wasn't really what I wanted
at the time.  I'll give it a second look now.

On 12/10/07, Lyle Johnson <lyle at lylejohnson.name> wrote:
> On 12/10/07, Ralph Douglass <ralph at grayskies.net> wrote:
> > I'm working on the ui for a little video game.  On the left in a map of
> the
> > game's galaxy, and on the right in a panel.  When a planet on the left
> in
> > clicked on, I want the panel on the right to change to display
> information
> > and options for that planet.  When a user clicks on a fleet of ships, I
> want
> > it to change to display information and options for the fleet.
> >
> > Is there perhaps a better way to do this than destroying the contents of
> the
> > frame on the right every time?
> Is the information associated with a planet always the same set of
> widgets, just with different values? If so, I'd just update the
> widgets' values whenever the user clicks on a new planet, e.g.
>     planet_button.connect(SEL_COMMAND) do
>         planet_name_label.text = planet.name
>         planet_size_label.text = planet.size
>     end
> Now, I'm assuming that you're displaying completely different kinds of
> information when the user clicks on a fleet of ships, so you'd need to
> do something different in that case. One option would be to implement
> the right-hand side information panel as a switcher (FXSwitcher), with
> one page for "planet information", another page for "fleet
> information", etc. See the shutter.rb example for an idea of how you
> might do that.
> Hope this helps,
> Lyle
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20071210/13eb7364/attachment.html 

More information about the fxruby-users mailing list