khval / NallePuh

Paula audio and CIAA/CIAB emulation for AmigaOS
GNU General Public License v2.0
4 stars 0 forks source link

ReAction interface uses depreciated macros #27

Open Hypexed opened 10 months ago

Hypexed commented 10 months ago

Hello.

Likely because of the old code base the NallePuh interface uses old and depreciated macros that are advised against in new OS4 applications. In particular this involves class instantiation. Even method calls using XXX_GetClass() are not recommended. But instead using the Intuition OpenClass() call. More info can found in links below. For the macros at least they have been made obsolescent since around 2011.

https://www.os4coding.net/blog/trixie/recommended-practice-os4-reaction-programming

https://wiki.amigaos.net/wiki/ReAction#Class_Opening_and_Closing

khval commented 10 months ago

I have been coping around old Reaction GUI stuff from other reaction GUI projects, so perhaps this why it’s using old macros. Its frustrating because there is not a lot of good examples. (Basilisk II has been my blueprint on this.)

Hypexed commented 10 months ago

I'm not sure of an easy way to replace it. The advised method is more involved as direct functions need to be used. Lots of calls to NewObject() and the like. Perhaps replacing with new macros would help that use modern methods. In addition the main gadget classes used would need opening before since it would rely on them being opened. Perhaps there should be a higher level function that takes a taglist of an interface and breaks it down internally into method calls.

javierdlr commented 10 months ago

maybe http://os4depot.net/share/audio/misc/mixer.lha prefs window (prefs.c) can help you somehow in ReAction stuff