I have a notification event set on MUIA_String_Acknowledge for my String gadgets, which means I get an event when the user presses Enter. The problem is that if the user just Tabs to the next String gadget, then I never get any event, and so the old String contents is still used.
So, is there any way to get an event on Tab? Preferably without a custom class.
Currently my best idea seems a bit kludgy & tricky: Get notified when MUIA_Window_ActiveObject changes, store the new object, then *somehow* check if the previous object was a string (any suggestions?), and if so then generate a fake MUIA_String_Acknowledge event for it.
There is no other way than subclassing. Just watch out for MUIM_GoInactive. This method will be called whenever the active object becomes inactive for whatever reason: TAB, mouse click, etc.
Not the answer I wanted to hear, but thanks for the confirmation.
But are you SURE my "best idea" isn't workable? It seems to me it would work if I can determine the parent object (class) of the active object. I presume that should be possible via some BOOPSI magic (if I had a clue).
I've never done it with BOOPSI/MUI stuff, and I don't understand BOOPSI's object model. Possibly I can do it by copying & pasting an example (without really understanding), but they seems like a reciepy for disaster (e.g. my blind copying of DoPkt3() code to detect soft/hard links didn't work reliably).
I decided to have a quick go, just to see how difficult or not this might be using a custom class... but I quickly ran into a problem:
MUIM_GoInactive does not exist in my public MUI headers. Since this solution is suppose to work on OS3.x (and clones), I guess this means your solution isn't workable
Currently my best idea seems a bit kludgy & tricky: Get notified when MUIA_Window_ActiveObject changes, store the new object, then *somehow* check if the previous object was a string (any suggestions?), and if so then generate a fake MUIA_String_Acknowledge event for it.
This is the solution I am now using. But rather than query BOOPSI for the object's type, I just store all known MUI String/Text/etc objects in a hash table. As this is all handled by PortablE's GUI generation system, it's no hassle.
But I'd still be interest to know (if possible) how to find the parent object (aka "class") of a BOOPSI object.
MUIM_GoInactive does not exist in my public MUI headers. Since this solution is suppose to work on OS3.x (and clones), I guess this means your solution isn't workable
I may be missing in the by now quite old MUI 3.8 includes, but it is available in MUI 3.8 already and public since MUI 3.9. Furthermore there is the undocumented MUI features archive on Aminet since more than 14 years by now. This archives contains a header file with lots of useful definitions.