Skip to content

EventSource

Claude edited this page Oct 27, 2026 · 4 revisions
BlitzPlus

EventSource

EventSource:Int32

Returns: A handle, or 0 for events that have no source such as keys and menus.

Description

Gives the object that caused the last event: the gadget that was clicked, the window that moved or the timer that ticked. Compare it with the handles you got when you made them to find out which one it was.

Examples

Graphics 320, 240, 32, 2
win  = CreateWindow("Sources", 20, 20, 260, 160, Desktop(), 3)
info = CreateLabel("Click a button", 10, 10, 230, 40, win)
a    = CreateButton("A", 10, 70, 60, 28, win)
b    = CreateButton("B", 90, 70, 60, 28, win)
Repeat
	e = WaitEvent()
	If e = $401 Then
		If EventSource() = a Then SetGadgetText info, "Pressed A"
		If EventSource() = b Then SetGadgetText info, "Pressed B"
	EndIf
Until e = $803

Media

EventSource

Related Commands

EventData, EventID, EventX, EventY, EventZ, PeekEvent, WaitEvent

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally