在NSIS中,如何在运行时在对话框控件上应用onClick事件?

时间:2013-06-21 15:51:39

标签: user-interface dialog controls custom-controls nsis

在此控件上,

 CONTROL "link", 1002, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 5, 195, 45, 10 

现在,

!define MUI_UI "myUi.exe"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "License.rtf"
...
Function LicenseShow
  ...

  ; Inner window
  FindWindow $0 "#32770" "" $HWNDPARENT

  ; Link
  GetDlgItem $1 $0 1002
  SetCtlColors $1 0x0000FF 0xFFFFFF ; This works
  ${NSD_SetText} $1 "Link to google" ; This works too
  ${NSD_OnClick} $1 on_click_link ; This does NOT work

  ...
FunctionEnd

然后,

Function on_click_link
    ExecShell "open" "http://www.google.com"
FunctionEnd

如何在运行时在此“标签”上添加 onClick事件? 我不想为此使用 nsDialogs :: Create 1018 et nsDialogs :: Show

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

NSD_On *回调仅适用于nsDialogs页面上的控件,请尝试ButtonEvent plugin ...