1. Baby Steps
- Posted by tbohon Nov 23, 2010
- 1835 views
Greetings ...
Whenever I set out to learn a new language there are several 'standard' programs I write in that language. Since I've been spectacularly unsuccessful in OE this evening trying to write the simplest one of them I thought I'd ask for help. Pardon my ignorance in advance - I'm very much a 'newbie' to gui apps in Euphoria.
The task I've set myself is to use EUIDE to create a simple form with two controls, a Label named 'lblTest" and a Button named 'btnClick'. When the button is clicked I simply want to change the contents of the label from whatever it is to "Hello".
I have the form created but can't seem to figure out the correct combination and sequence of Euphoria commands to make the above action happen.
Any assistance/guidance appreciated.
Tnx in advance.
Tom
2. Re: Baby Steps
- Posted by DerekParnell (admin) Nov 23, 2010
- 1799 views
The task I've set myself is to use EUIDE to create a simple form with two controls, a Label named 'lblTest" and a Button named 'btnClick'. When the button is clicked I simply want to change the contents of the label from whatever it is to "Hello".
I have the form created but can't seem to figure out the correct combination and sequence of Euphoria commands to make the above action happen.
On the click event for the button, use the setText routine.
For example:
procedure onClickbtnClick(integer self, integer event, sequence parms) setText(lblTest, "Hello") end procedure
3. Re: Baby Steps
- Posted by euphoric (admin) Nov 24, 2010
- 1811 views
I'm very much a 'newbie' to gui apps in Euphoria.
Are you a newbie to GUI apps in general, or just to Euphoria specifically. Programming GUI apps is a different paradigm than programming, say, console apps.
I have the form created but can't seem to figure out the correct combination and sequence of Euphoria commands to make the above action happen.
Since you're using the IDE, right click on the button and choose "Edit Code" (or whatever the command is). When the editor pops up, make sure you are in the "onClick" event. If not, go ahead and select it on the left. Then add this code:
setText( lblTest, "Hello" )
Run it and it should work.
Let us know! :)
P.S. This might also help.
4. Re: Baby Steps
- Posted by tbohon Nov 24, 2010
- 1634 views
Of course it worked great - thanks I really like the simplicity of the IDE and the logical construction of the language. The latter will take a bit of getting used to - my most recent projects have been in C#.Net - but OpenEuphoria and the IDE take me back to when I really had fun writing programs.
Promise not to harass y'all with questions during the coming weeks as I learn my way around ... unless I hit the proverbial wall and my BP jumps over, say, 300/200 or something ...
Thanks again and best wishes.
Tom