In Delphi I used TActionList with lots of TAction items to implement the various actions in an application. These actions can then be linked to menu items and buttons. An action can have an OnUpdate event handler which is responsible for activating and deactivating the action depending on the current state of the application. This is a very useful feature which is also available in Lazarus but unfortunately it is somewhat broken in current Lazarus version (At least up to daily snapshot 20081231) because the OnUpdate event handlers are not called correctly for actions which are only linked to menu items. This bug is already reported and hopefully it will be fixed soon. But for now I have created a little workaround for it.
Continue reading "Lazarus TActionList"