Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: How to create simple event driven app?
Pages: [1] Print
Author Topic: How to create simple event driven app?  (Read 467 times)
PopMilo
Newbie
*
Offline Offline

Posts: 6


View Profile
How to create simple event driven app?
« on: December 15, 2006, 06:29:23 PM »

I have seen a lot of code in rebol, and i seem to get the parts, but like if some connecting idea is missing ... Sad

I made some very nice scripts in few lines which really do exectly what they should, and are great, but when I tried to make a simple graphic editor I was stucked...

I remember my first programming effort was drawing program which basicly looked like this:

loop: wait for keypress
        draw something on screen depending on what key was pressed
        goto loop

Now on rebol I know how to do something when something is pressed (feel stuff and such) but... but Im not quite clear on where exectly to put it...

So if someone could give me an example of something like this written in rebol...:

loop: wait for keypress
        if something usefull is pressed then do what you are supposed to do (draw on surface, move cursor, change color....)
       goto loop or whatever

Thank you very much in advance!

Rebol is a beauty and its getting better every week.... Smiley
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
Re: How to create simple event driven app?
« Reply #1 on: December 15, 2006, 06:40:52 PM »

Logged

PopMilo
Newbie
*
Offline Offline

Posts: 6


View Profile
Re: How to create simple event driven app?
« Reply #2 on: December 16, 2006, 05:08:57 AM »

Ok. Ill look at those scripts but....

paint.r is little too much Smiley

lets say I want just a grid (50x50) of dots (like some sprite editor in zoomed mode), and to have cursor moving over this grid with arrow keys, and if you press "1" it makes the current "dot" black, and if you press "2" it makes it white.... and thats it... no mouse, no lines no circles no nothing......

Hope this makes sense...

« Last Edit: December 16, 2006, 10:37:28 AM by PopMilo » Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
Re: How to create simple event driven app?
« Reply #3 on: December 16, 2006, 06:01:26 AM »

Basically, instead of having a loop, you just get keys in face/feel and do what you want with them. A quick way would be to just use feel/detect for the window face.
Logged
PopMilo
Newbie
*
Offline Offline

Posts: 6


View Profile
Re: How to create simple event driven app?
« Reply #4 on: December 16, 2006, 09:18:46 AM »

Well that was my question, acctually...  Cheesy

Not how to draw grid and change colors, but what should be best way to do more complex apps.

Should I make objects (visible, non visible) and assign different functions for them... assign them to feel-engage stuff?

How do I make game loop for some more complex game?

I know I have to read more, thats for shure Smiley thanks for your help!
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: How to create simple event driven app?
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 06:31:19 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2311 Posts in 595 Topics by 4138 Members
Latest Member: Irrederwasy

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc