Hi Sébastien, thanks for sending over the GCA. I received it today.
> Could you explain the purpose of the message field (the string returned by > gen->get_bind_msg())? > > As far as I can tell, it is simply a copy of the event type and ends up in > the > "cmd" field of the command_event structure (from dope_event)... where it does > not seem to be used anywhere (but maybe I'm wrong). Your observation is very good. Orignally, there were two reasons for these bind-message strings. First, I intended to enable widgets to deliver custom textual messages further describing the occurred event. For mouse and keyboard events, such information is delivered in the dope-event structure, but there is no generic mechanism for other kinds of events. For example, a scrollbar might deliver the new scroll position, an text entry field might deliver the new text, etc. However, until now, no such use case popped up. In most cases, the application code can just respond to an event with requesting the actual context information from the widget. So there seems to be no point in delivering context information with the event. The second intention was to deliver the event type to the callback such that one callback is able to handle different events. But in practice, it turned out that having many callback functions doesn't hurt. Quite contrary, many simple callback functions are certainly better than a few big callback functions with complicated program logic. After reading your question, I searched through all applications based on the Genode-FX software stack and I found exactly 0 uses of the 'cmd' field of the event structure. So it might be a good idea to drop that feature. ;-) Cheers Norman _______________________________________________ http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org IRC: #milkym...@freenode Webchat: www.milkymist.org/irc.html Wiki: www.milkymist.org/wiki
