Page 1 of 1
Event driven code versus waiting for userinput
Posted: Sun Jun 15, 2003 9:00 pm
by Grumble
I'm evaluating the trial version and looking at some examples, and I noticed that instead on having OnClick events (or OnMouseOver, or others) these examples work with Repeat-Until loops to wait for user input. At first sight I'd think this is a major disadvantage compared to some other languages (I have used RapidQ a lot), but I want to hear your opinion on this.
For example how would you deal with a Form with 20 buttons, changing the cursor whenever it's over a button. Is something like this as easy to do as with the OnMouseOver events that other languages have ?
Re: Event driven code versus waiting for userinput
Posted: Sun Jun 15, 2003 10:56 pm
by tinman
If you write all your code in procedures you can have the same style of handling events. So you write one procedure for each event of each gadget. The only difference is that you also have to write the code which catches the events and decides which procedure gets called.
In the other languages this event catching loop is hidden from you. But it works the same way.
Posted: Mon Jun 16, 2003 12:42 am
by Kale
PureBasic catches all the events you list but just does it in a different way, there not wrapped up in 'cute' event handlers, you have to write the code to handle them yourself (which is not as bad as it sounds).
Also remember that when purchasing PB you get great support from all the guys here and from lead dev Fred.
Also regular updates are available in roughly about 2-3months intervals. Briefly looking at RapidQ it looks like it hasn't been updated for nearly 3 yrs (08.29.2000) ???
Posted: Mon Jun 16, 2003 12:49 am
by Karbon
If you want the cute event handlers and stuff you can have it too!
Check out
http://www.hellobasic.com/
Posted: Mon Jun 16, 2003 8:58 am
by Fred
When the event loop is hidden, you can't do anymore some nice trick to groups the events or use non blocking event handler. This is two differents approaches, but both have the pro & con.
Posted: Mon Jun 16, 2003 7:02 pm
by fsw
Kale wrote:PureBasic catches all the events you list but just does it in a different way...
Well you should be fair enough to tell that this is only true if you know WindowsAPI and use the WindowCallback as a second Event Loop in addition to the NORMAL Event Loop. And mostly it's all WindowsAPI.
So if you don't know Windows API you have to learn.
BTW: All has be done by hand. Some people say this is an advantage, others say it's a disadvantage.
IMO there are no disadvantages to have the GUI events automated...
Kale wrote:
Also regular updates are available in roughly about 2-3months intervals. Briefly looking at RapidQ it looks like it hasn't been updated for nearly 3 yrs (08.29.2000) ???
But people are still using it (although there will be no updates anymore, because the project is abandoned)
RapidQ also has a Linux version that is AFAIK at the same function level as the Windows Version.
PureBasic has also a Linux Version but it's not at the same stage as the Windows Version - thats a fact!
So if you want to play with a programming language, you should know what you want/need and then figure out if it's available under that language. Also look at the core language itself - is it complete, will it ever be complete, and so forth.
Re: Event driven code versus waiting for userinput
Posted: Mon Jun 16, 2003 7:11 pm
by fsw
tinman wrote:If you write all your code in procedures you can have the same style of handling events. So you write one procedure for each event of each gadget. The only difference is that you also have to write the code which catches the events and decides which procedure gets called.
In the other languages this event catching loop is hidden from you. But it works the same way.
Yes but you have less work
Imagine you have an GUI event handler that with one line of code you call the procedures for all your Gadgets (it could be 1000 - it wouldn't matter)
or you have to SELECT CASE 1000 Gadgets and call the procedures by hand.
I prefer the first method.
Posted: Mon Jun 16, 2003 7:25 pm
by fsw
Let's see... $59 for a compiler, libraries, editor, visual designer, and more.
For $39 you get another visual designer with different event handling...
(BTW it isn't released for the latest PureBasic version)
Hmm...
Re: Event driven code versus waiting for userinput
Posted: Mon Jun 16, 2003 9:17 pm
by ricardo
Grumble wrote: At first sight I'd think this is a major disadvantage compared to some other languages (I have used RapidQ a lot), but I want to hear your opinion on this.
Its not a disadvantage, its a great possibilitie.
As Fred says, you can do manyother things.
In fact, you have the control on everything. Try it and after a few weeks you will find that its the best approach because its open to you how to use it.
About lazy to code eventhandler, you can write your own app that does the job for you, its easy.
PureBasic is 'plastic', you can model it in many ways.
Rapid-Q is nice, but nothing to do with PureBasic. In a near future you will look back to Rapid-Q and notice many limitations that PB dosen't have.
Posted: Tue Jun 17, 2003 2:21 am
by Karbon
fsw:
Hey man, don't shoot the messenger
There are a few more products out there like that too, I don't think that's the only one. Bounce around a little and maybe you'll find one more to your liking.
Personally I like the way PB works. Muuuuch more powerful IMHO.
There is always VB! *grin*
Posted: Tue Jun 17, 2003 5:18 am
by fsw
Karbon wrote:fsw:
Hey man, don't shoot the messenger
NEVER EVER
