[fxruby-users] A problem about updating an FXRuby program layout recursively

Lyle Johnson lyle at knology.net
Fri Sep 22 21:36:57 EDT 2006


On Sep 22, 2006, at 3:17 PM, Axel Etzold wrote:

> I have written a method with a lot of evals in it, which calls  
> itself, when the user
> clicks on a button, and updates its arguments (move to the next  
> word etc.)
> to do the trick of updating the buttons, but I can only show the  
> first set of buttons and replace the first word - the new buttons
> for the next set of replacement words don't appear.
> I rather randomly tried to call "app.update, app.recalc" etc., but  
> none worked.
>
> What am I missing ?

Are you actually constructing a new FXButton each time? If so, you  
need to call create() on the button to realize it, e.g.

	new_button = FXButton.new(p, "Button Label", ...)
	new_buttton.create

Note that a preferable approach (if I understand what you're doing)  
is to just re-use the existing buttons, and change their label text,  
e.g.

	old_button.text = "New Label for an Old Button"

Hope this helps,

Lyle


More information about the fxruby-users mailing list