Using a Reaction class String gadget in a Reaction class window, I'd like the
program to be able to tell when the gadget goes active.
Does anyone know how to get that activation information?
Reaction HandleInput doesn't have a "WMHIGadgetDown" and WMHIActive tells
you that the Window is active, but not which gadget.
The WINDOW_IDCMPHook hook never seems to get called with an
IDCMPGadgetDown, no matter what is in WINDOW_IDCMPHookBits.
It looks like maybe you could use IDCMPIDCMPUpdate, but I don't know how to
get the string gadget to do an OM_Notify or OM_Update upon activation.
Maybe it is necessary to create a new subclass that just sends all incoming
methods on to its String class parent except in OM_Activate it also generates
a message to the Window port?
Have I missed something simple?
Thanks,
Tom
@tbreeden
Have you set GA_Immediate to TRUE when creating the string gadget? Also make sure that IDCMP_GADGETDOWN is enabled in WA_IDCMP.
Tried those. GA_Immediate does not seem to do anything for the Reaction string
gadget, with or without IDCMP_GADGETDOWN in WA_IDCMP.
I wonder if it is possible/wise to try to mix non-Reaction Boopsi gadgets
in the same window with Reaction gadgets?
Tom
Theoretically that should be possible but there's a catch. ReAction BOOPSI gadgets are all designed to respond to GM_LAYOUT properly, and obey the window's layouting mechanism. It is not guaranteed that custom BOOPSI classes will work well in this regard - it really depends on how gadget sizing and positioning is implemented within the particular gadget.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
@trixie
If you need to use a gadget that doesn't support GM_DOMAIN method inside a layout you can always specify the minimum and maximum width and height for it using CHILD_#? tags.
Are you using an IDCMP hook function? Otherwise you won't be able to intercept any IDCMP_GADGETDOWN messages since the WM_HANDLEINPUT method doesn't allow checking for those yet.
Yep. I do see IDCMP_GADGETUP in the hook function, but never IDCMP_GADGETDOWN.
Maybe the Reaction Window/Layout is eating the gadget-down when generating the
GM_GOACTIVE.
OK. I got salass00's sample code (which seems to have disappeared from the comments) and replicated it. Then I did get the IDCMP_GADGETDOWN messages in the Hook procedure.
Traced the problem in my code to a typo that nullified the GA_Immediate setting for the String gadget.
However, there is still a problem, since the IntuiMessage .IAddress field in the received message at the Hook contains the address of the Reaction window's root Layout gadget, and not the String gadget itself. This behaviour is documented for IDCMP_GADGETUP in the autodocs (in layout_gc.doc) and must be similar for IDCMP_GADGETDOWN.
For GadgetUp, special provisions are made in the Reaction Layout gadget to determine the actual gadget that was activated:
And the notification will appear in the hook as in IDCMP_IDCMPUPDATE message.
It does not seem to do this for GADGETDOWN's, and I can't figure a way
to determine which Reaction window gadget was actually activated.
Tom
test
This discussion seems to have been truncated? Two comments lopped off the end.