Scripting on Unix still beats the pants off of all our non-scriptable GUIs. I wish people had copied BeOS’s simple GUI event sends message to itself to perform operation because that little indirection meant the message can be recorded or injected. And voilà, you've got some GUI scripting that's not an abomination of simulate a mouse cursor at this rect offset.

https://birdhouse.org/beos/byte/08-scripting/ #beos #programming

2/ This Hello World GUI app in BeOS illustrates the publish and subscribe to self messages I mentioned. It was simple. The developer didn't have to do anything special to support scripting. A lot of times the messages were just u32s.

// Define your u32 message identifier
const uint32 kMyMessage = 'MYMG';

// Initialize your message
BMessage msg(kMyMessage);

https://www.besly.de/haisly2.besly.de/index.php/development/c-c/programming-for-haiku-hello-world #beos #programming

Programming for Haiku: Hello World - BeSly Haiku only

3/ The first time I saw a u32 defined by four C characters I was so, so confused. It didn't even look legal to my eyes, but now I think it's kind of brilliant. #beos #programming
@shanecelis https://en.wikipedia.org/wiki/FourCC are also stored like this. I remembered that AirParrot for Mac had this in a few places. You could "unlock with condition". The condition was either 'GOGO' or 'WAIT', which are integers. https://developer.apple.com/documentation/foundation/nsconditionlock/unlock(withcondition:)

@JonathanGerlach Oh, neat. That's cool to see.

It's like the cheapest hash of stack-bound max-length 4 string.