Archive: Problems with Buttonevent


Problems with Buttonevent
Helo everybody

I have one problem.

InstallOptions::Initdialog /NOUNLOAD "$PLUGINSDIR\win1.ini"

My code

ButtonEvent::AddEventHandler /NOUNLOAD 1
ButtonEvent::AddEventHandler /NOUNLOAD 2
ButtonEvent::AddEventHandler /NOUNLOAD 3

InstallOptions::show
ButtonEvent::WhichButtonID /NOUNLOAD
Pop $R3 ; R3= 1 ==> Next button pressed
; R3= 2 ==> Cancel Button pressed
; R3= 3 ==> Back Button pressed
; R3= -1 No button pressed, Control with
Flag = Notify in win1.ini pressed

My problem is: If arrive at this window from for second time, after press Back button in the next window (win2.ini). R3 dont return -1 if I press my control. Always return 3. I dont understand why mantain in win1.ini the value of the back button (3) pressed in Win2.ini.

May be that i need clean something, but i cant find it.

Any idea?

Thank you


I've just resolved it.

Thank you.


Hi all,
i have the same problem with my installer... when entering the second time the call to
ButtonEvent::AddEventHandler 0x666 XXX does not work... any ideas???


There are few issues with this plug-in - I can remember similar situation where placing second button on form caused problems. (not firing on click event).

But your code is probably wrong: ButtonEvent::AddEventHandler 0x666 XXX should be called only once, there is no reason to attach the same function to the same button twice.

The only way how to solve this is to create a debug build of plug-in and debug it with Visual Studio or other IDE.


Slappy, thanks for your help.
i have fixed the code, so now the mentioned line is called only once.
However the problem still remains- when clicking the back button and then returning to the current page the new created button the attached function (with ButtonEvent::AddEventHandler) does not called...
appreciate any help...thanks.


ok... found the problem... ButtonEvent::AddEventHandler 0x666 XXX had to be declared under the .onInitGUI function..