English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 28 June 2020, 18:32   #1
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
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?

Last edited by Sim085; 28 June 2020 at 19:09.
Sim085 is offline  
Old 28 June 2020, 22:36   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by Sim085 View Post
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.
thomas is offline  
Old 29 June 2020, 07:43   #3
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Thanks thomas. Will check BOOPSI as well.
Sim085 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD32 joypad blue button vs standard 2 button joystick jotd Coders. Asm / Hardware 6 08 May 2018 09:56
Configure button 1 as fire and button 2 as autofire Harry support.WinUAE 1 21 December 2013 13:37
WinUAE x64 2.2 & 2.3 closing when "Add HardDrive" button is pressed Thom87 support.WinUAE 4 26 September 2010 16:37
Inactive Add Hard Drive button AlfaRomeo support.WinUAE 5 07 April 2010 09:45
Hook jcmoorehead support.Games 2 27 June 2004 17:48

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:02.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18891 seconds with 15 queries