English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. C/C++ (https://eab.abime.net/forumdisplay.php?f=118)
-   -   How to add a hook on Button Kind? (https://eab.abime.net/showthread.php?t=102896)

Sim085 28 June 2020 18:32

How to add a hook on Button Kind?
 
I have managed to add a hook on String Kind but don't seem to find how to add a hook on Button Kind. How to add a hook on a button to be triggered on button click? Is this even allowed? Or clicks on buttons are only to be handled as part of IDCMP_GADGETUP handler?

thomas 28 June 2020 22:36

Quote:

Originally Posted by Sim085 (Post 1410430)
I have managed to add a hook on String Kind

You mean by GTST_EditHook? This is an attribute of string gadgets. There is no such thing for button gadgets.

If you use BOOPSI instead of GadTools, you can use the ICA_TARGET attribute to get a custom class get its OM_UPDATE method called. A class is similar to a hook, you just have to call MakeClass to get the hook pointer and NewObject to get an instance of this class to be used with ICA_TARGET.

Sim085 29 June 2020 07:43

Thanks thomas. Will check BOOPSI as well.


All times are GMT +2. The time now is 07:35.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.18028 seconds with 11 queries