mercredi 5 avril 2017

Checkbox in NSIS

I am looking to add a basic checkbox to the default directory page using MUI_PAGE_CUSTOMFUNCTION_SHOW in NSIS. However, the checkbox doesn't seem to be appearing or functioning in any way. Here are the different functions I have attempted; I'm not sure if I need to grab the current window in order to draw to it? Any advice would be much appreciated.

!define MUI_PAGE_CUSTOMFUNCTION_SHOW "DirectoryShow"
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "DirectoryLeave"
!insertmacro MUI_PAGE_DIRECTORY

Var Checkbox

Function DirectoryShow
  ${NSD_CreateCheckbox} 0 0 50% 6% "CheckboxTest"
  Pop $Checkbox
  ${NSD_Check} $Checkbox
FunctionEnd

Function DirectoryLeave
  ${NSD_GetState} $Checkbox $0
  ${If} $0 <> 0
    MessageBox mb_ok "Checkbox checked."
  ${EndIf}
FunctionEnd




Aucun commentaire:

Enregistrer un commentaire