Welcome, Guest. Please login or register.

Author Topic: Getting datatype handle from DTA_Sync message on IDCMP_IDCMPUPDATE  (Read 2580 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thomas


Quote
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

Offline Thomas

Re: Getting datatype handle from DTA_Sync message on IDCMP_IDCMPUPDATE
« Reply #1 on: April 09, 2009, 05:21:52 PM »


Quote
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.

Code: [Select]

obj_ptrs[id] = NewDTObject (...,GAD_ID,id,...);
id ++;


Quote
Even then I'd still have to get the datatype handle from the gadget structure...


The gadget structure *is* the datatype handle.

Bye,
Thomas

Offline Thomas

Re: Getting datatype handle from DTA_Sync message on IDCMP_IDCMPUPDATE
« Reply #2 on: April 09, 2009, 06:09:44 PM »

Quote
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