Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Jose on April 08, 2009, 10:34:07 PM
-
While processing IDCMPUPDATE messages I'm checking the taglist on IAdress. Then process the DTA_Sync tag to be able to update a datatype after loading it to a window (RefreshDtObjectA()), so that the window display is updated automatically.
However let's suppose I load various user defined (through requesters) datatypes to a window. How do I know to which datatype a given DTA_Sync corresponds to ? I tried to look for DTA_Handle tag in the taglist on IAdress but it's not included ...
-
How do I know to which datatype a given DTA_Sync corresponds to ? I tried to look for DTA_Handle tag in the taglist on IAdress but it's not included ...
GA_ID should be included. If you add GA_ID with a unique ID to the NewDTObject call, you should be able to identify the object by that ID when receiving an IDCMP_IDCMPUPDATE message.
Bye,
Thomas
-
@Thomas
Hey, thanks a bunch. But I'm finding that method not very practical. GA_ID only uses 2 bytes of size meaning I can't put my datatype handle in there directly. So I'd have to wonder through the window's gadget list till I find a particular ID... Even then I'd still have to get the datatype handle from the gadget structure...
I thought about using GA_UserData but it doesn't show up in the IDCMPUPDATE message....
Of course, I could dynamically build my own list of datatypes with their IDs, I just thought there was a more practical way to do it...
Cheers
José
-
So I'd have to wonder through the window's gadget list till I find a particular ID...
You could hold the object pointers in an array and use the ID as an index to the array.
obj_ptrs[id] = NewDTObject (...,GAD_ID,id,...);
id ++;
Even then I'd still have to get the datatype handle from the gadget structure...
The gadget structure *is* the datatype handle.
Bye,
Thomas
-
"The gadget structure *is* the datatype handle."
Aha! Good. I said that cause the datatypes handle is declared as an APTR in the docs so I thought it was supposed to be considered a black box (i.e. don't toutch and all of that...).
-
I said that cause the datatypes handle is declared as an APTR in the docs so I thought it was supposed to be considered a black box
It *is* considered a black box. But if you think about how BOOPSI works and know that datatpyes are subclasses of gadget class, then there is no other way than that the datatype object pointer points to a struct Gadget.
The array method is better (more "legal"), though.
Bye,
Thomas
-
Something I want to share. Been fiddling with the the tags received in IDCMPUPDATE messages and found that for datatypes the address is in DTA_Data!!!!!
Yeah baby!!
There had to be an easier way... :-D
Cheers