List of PB_EventType* ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Karbon.

Is there a complete list of all the event types somewhere? I see then scattered throughout the manual but no single listing of all of them.

Thanks!




-Mitch
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by Karbon

Is there a complete list of all the event types somewhere? I see then scattered throughout the manual but no single listing of all of them.
Look in the Window library, WindowEvent command.

If you see any others in the reference manual which are not listed there, report it as a bug in the documentation. Of course, some people use the Windows API constants as event types, which works on the Windows version of PureBasic, but not necessarily on others.


--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Karbon.

Ok, well now I'm royally confused.

I see these in the WindowEvent doc.

#PB_Event_Menu : a menu has been selected
#PB_Event_Gadget : a gadget has been pushed
#PB_Event_CloseWindow: the window close gadget has been pushed
#PB_Event_Repaint : the window content has been destroyed and must be repained (useful for 2D graphics operations)
#PB_Event_MoveWindow : the window has been moved

Then I see these in EventType()

#PB_Event_Menu : a menu has been selected
#PB_Event_Gadget : a gadget has been pushed
#PB_Event_CloseWindow: the window close gadget has been pushed
#PB_Event_Repaint : the window content has been destroyed and must be repained (useful for 2D graphics operations)
#PB_Event_MoveWindow : the window has been moved

There has to be more than this - right? I might be missing the point. Except for about 5 years ago what event-driven programming I've done has been over the last few days with BlitzPlus. All the event codes for b+ were available - I'm assuming (perhaps incorrectly) that PureBASIC works the same way..

Smack me with a clue stick? :)

Thanks!!!!

-Mitch
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by Karbon

There has to be more than this - right? I might be missing the point. Except for about 5 years ago what event-driven programming I've done has been over the last few days with BlitzPlus. All the event codes for b+ were available - I'm assuming (perhaps incorrectly) that PureBASIC works the same way..

Smack me with a clue stick? :)
Thhhhhhhhhhwackkkkkkkkkkk!

;) Yes, there are more than this, but I have never experienced b+ so I don't know what they class as events. For example, in PB you also have the EventType() command to check what specific type of event it was - you could have a WindowEvent which says that a gadget was pushed and an EventType which says that event was a double click.

Also, the reason there appear to be so few events in PB is that Fred wants to keep the language source code compatible across platforms. He might need some time to figure out how to do a certain event on Windows and Linux if one of them does not support it directly.

The other possibility is that Fred might think these are the only events you might need from a GUI driven application (and I'm talking user interacting with UI type of events here). Sure, Windows has a tonne more events than this, but quite a few are ones that the user cannot generate and therefore might not be useful to you to know about (PB would handle these internally).

If you really are limited by the types of events that PureBasic reports then you have two choices:

1) Write a callback procedure to handle the events directly and go for non-portability. Put a post in the requests forum asking for event type XXXX to be reported by PB.

2) Put a post in the requests forum asking for event type XXXX to be reported by PB and wait for it to be implemented.

Hope that helps.


--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Karbon.

Someone on the PureBASIC mailing list was nice enough to supply mw with an Excel spreadsheet FULL of them!

http://www.karboneye.com/PBConstants.xls.zip

Hope it's OK that I shared this!

-Mitch
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

Why is portability an issue?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by dmoc

Why is portability an issue?

Code: Select all

While quit=0
  event.l = WaitWindowEvent()

  Select event
    Case #WM_SOMEWINDOWSMESSAGECONSTANT
      ; Blah
  EndSelect
Wend
That source code might compile on Windows but not on Linux (well, assuming I used a real message :). There is also no guarantee that Linux even supports that specific type of message meaning that even if it did compile, your program might not work.

--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

But how many are actually developing for Linux? My point is that while "portability" is often raised as an argument against doing something a particular way, in reality (in the PB community at least) few seem to creating anything but MSWin progs and PB-Linux always seems to lag by several versions.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by dmoc

But how many are actually developing for Linux? My point is that while "portability" is often raised as an argument against doing something a particular way, in reality (in the PB community at least) few seem to creating anything but MSWin progs and PB-Linux always seems to lag by several versions.
Sure. It's up to the user whether they want to go for portability at all and whether they use the "official" PB constants or do it some other way. Those who don't care about portability wouldn't bother, but I think that this is one of PB's strong points (if all versions were kept together - a very big task for Fred).


--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

Well Fred should damn well clone himself and get up to speed :wink: But, yes, I agree this IS one of PB's strong points and should be taken advantage of where poss, especially if like me you have vowed never to upgrade beyond Win98.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Karbon.

Why would you never upgrade past Windows 98?

-Mitch
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

XP...eXtra Protection...for Micro$oft! No seriously, I won't have any company dictating (or even trying to) what I do in my own home with my own kit (computer kit that is). I often swap and change parts between several computers and all my systems have been self-build. I'll never accept anything that requires me to phone/ email/ whatever to explain why I want to re-install the OS. Add to this the obvious trend to get us all paying an *annual* fee just to *continue" to use the same-old-same-old or some tarted-up bug-ridden heap of...arrrrrrh.... deep breaths, meditate... And the best reason of all? Linux - I LOVE LINUX!!! Pity that for the mo I'm stuck with WinDoze because of a couple of apps I need to use (eg, LightWave) but soon I'm going to give Wine a bash and see how far I get.

Well, you did ask :wink:))
Post Reply