MorphOS Developer
Posts: 1075 from 2004/9/23
Yeah, hooks are more or less obsolete. There were a good idea for hooking into system libraries, but in MUI they were always a bad solution.
There are a few classes which are not supporting methods, but generally you can use notifications.
Same goes for lists. Avoid hooks for construct, destruct, sort and co. Just use the methods provided by mui. It is much less work as you dont need to deal with all the shit hooks and code jumps deliver. Just a clean method you receive when something happens and you are done.
Of course this means subclassing, but it is not as bad as it sounds. once you have a proper source file to subclass something, you can simply use it everywhere and it is a nobrainer.
Also if you create a fancy subclass in application one you can simply use that as often as you want and even copy it over to other applications of yours.
Just take a look onto the system settings. The main settings application is just a pile of icons or a list with the settings panels. The panels itself are separate binaries and even inside those panels gui elements come from additional files like the blankers or the usb hardware driver.
Those panels are also used during system installation as well, so going the mui sub class way is the smart way, even if it at first takes some time to understand.