Receiving events from gadgets: ICA_TARGET model objects or ICTARGET_IDCMP, and how ?
Some month ago, I suggested receiving button and sliders OM_NOTIFY events to a modelclass boopsi object, that stands for my app, would be a correct approach... This works nice, but there is something annoying: receiving OM_NOTIFY is done on the context of the sending Gadget, which means a special context, not on the main process or anywhat, and I'm supposed to process lots of things. So I figured out ICA_TARGET,ICTARGET_IDCMP seems to be a better approach, as I guess messages are delayed, and hopefully catched in the main loop, at the lowest recursion possible, which is prefect. But then my loop is managed with DoMethod(app->window_obj, WM_HANDLEINPUT,..) and WMHI_XXXX enums for events, not the intuition IDCMP level. And there are WMHI_XXX enums for lots of messages... but nothing that mirrors IDCMPUPDATE message !
On the devCD2.1, Early boopsi exemples from 1991 just do WaitPort( w->UserPort ) then switch ( imsg->Class ) to IDCMPUPDATE, then retrieve the full gadget notify taglist (what I need) in IDCMPUPDATE (Reference/DevCon/Milan_1991/Devcon91.1/Libraries/Intuition/other_examples/boopsi/demo5.c)
So well: Is there a way to get IDCMPUPDATE full OM_NOTIFY messages with WMHI_SOMETHING , or is there a way to both handle message with GetMsg( w->UserPort ) and DoMethod(app->window_obj, WM_HANDLEINPUT,..) ? Or some methods I don't know ?
Online Status
Brrr ... By definition using GetMsg() at Window->UserPort level is impossible because messages can be read only once.
ICA_TARGET,ICTARGET_IDCMP looks totally impossible to get, Apparently I'll have to manage my own message stack to delay OM_NOTIFY from a target modelclass to main loop.
... some WMHI_IDCMPUPDATE is clearly missing.
Edit: At the end I found out a button gadget would set OM_NOTIFY with GA_Selected when mouse click down and move, orduring a slider movement, but will send nothing at the "gadget up." when action in finished on the gadget. That is precisely what is returned by WHMI_GAGDGETUP ,with just the GA_ID ! So what I do finally is gathering the OM_NOTIFY received by a modelclass object received as a ICA_TARGET for everyone, and the WHMI_GAGDGETUP , in a message stack that is delayed to the next main loop turn. That way I have all the messages needed, treated by the right process with no recursion , with the GA_ID of the gadget and all movements and gadgetup.