Event-driven api

Hi all,

Can someone explain to me how the BeOS/Haiku event-driven GUI works, as in - how does it listen for mouse input?

Thanks! :slight_smile:

Edit: Reworded…

Specifically, I am hoping to find prototype code for the API that listens for mouse events.

BMessages are used to communicate between the various classes BViews and BWindows of your app (and with the system components) …

so as an example for a BButton, when you create a BButton you assign it a unique BMessage.

The function MessageReceived is then used to check (using a switch statement) what to do.

Mouse info comes from the InputServer or the AppServer.