On 12/4/07, Ernst Tanaka <ernst / tanakasite.com> wrote:

> I have managed to build a demo screen with FoxGui (see below), but I am
> struggling to write a program that handles this window.
>
> On the forum I see a lot of us (newbie's) struggling with the first
> Fxruby steps.

What "forum" are you talking about?

> Would one of you please be so kind and write a little
> program using my enclose Demo Window.
>
> Let the program handle the following actions.
> At Init move value '1' to button one, '2' to button '2' and '3' to
> button '3', 'a' to text1, 'b' to text2 and 'c' to text3.

The code is difficult to follow because it's not using the standard
FXRuby API. If you're asking how to change the label text for an
FXButton or FXTextField widget, however, you can use:

	@button1.text = "1"
	@button2.text = "2"
	@button3.text = "3"
	@text1.text = "a"
	@text2.text = "b"
	@text3.text = "c"

I am assuming that what your code calls FX::Button and FX::Text are
the same things as FXButton and FXText (or maybe FXTextField).

> On click of button1. Swap the strings from button2 and button3 and text2
> and text3.

	@button1.connect(SEL_COMMAND) do
		tmp = @button2.text
		@button2.text = @button3.text
		@button3.text = tmp
		tmp = @text2.text
		@text2.text = @text3.text
		@text3.text = tmp
	end

> On click of button2. swap the strings from button1 and button3 plus
> text1 and text3.

	@button2.connect(SEL_COMMAND) do
		tmp = @button1.text
		@button1.text = @button3.text
		@button3.text = tmp
		tmp = @text1.text
		@text1.text = @text3.text
		@text3.text = tmp
	end

> On click of button3. swap 1 and 2.

	@button3.connect(SEL_COMMAND) do
		tmp = @button1.text
		@button1.text = @button2.text
		@button2.text = tmp
		tmp = @text1.text
		@text1.text = @text2.text
		@text2.text = tmp
	end

> A picture is worth a 1000 words equals to an example hold the value of a
> book.

I need to remember that one.

> Thanks a million in advance.

Hope this helps. I would also recommend subscribing to the FXRuby
Users mailing list. The information can be found on the FXRuby Home
Page, at http://www.fxruby.org.