Archive: nsdialogs DropList Problem when popping variable


nsdialogs DropList Problem when popping variable
Hello all,

i have come across a problem which i cannot explain since it works in another script, i have the following demo script


!include "MUI2.nsh"

Name TestSetup
OutFile TestSetup.exe

XPStyle on

Page custom GetInstallationType ;LeaveGetInstallationType

Var /GLobal Dialog
Section Test

SectionEnd

Function .onInit
InitPluginsDir
FunctionEnd

Function GetInstallationType

!insertmacro MUI_HEADER_TEXT "$(GetInstallationType_Header)" "$(GetInstallationType_SubHeader)"

nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog

${If} $Dialog == error
Abort
${EndIf}

${NSD_CreateGroupBox} 0 0 100% 100 GroupBox
Pop $0

${NSD_CreateLabel} 10 20 95% 30 Description
;Pop $0


${NSD_CreateDropList} 10 60 200 30
Var /Global GetInstallationType_DropListInstallType
Pop $GetInstallationType_DropListInstallType

${NSD_CB_AddString} $GetInstallationType_DropListInstallType one
${NSD_CB_AddString} $GetInstallationType_DropListInstallType two
${NSD_CB_AddString} $GetInstallationType_DropListInstallType three

${NSD_CB_SelectString} $GetInstallationType_DropListInstallType two

nsDialogs::Show

FunctionEnd


if you look closely i have remarked the Pop $0 after the line with the ${NSD_CreateLabel}.

Only then it will show the GroupBox if you enable the Pop command it will not.

This time its not a problem with Unicode (or not) since it works in neither

NSIS 2.42
NSIS 2.42 Unicode
NSIS 2.38 Unicode
NSIS 2.37

Any Ideas?

Thanks
Regards
Holger

What about changing the order - first create label and then the group box?


first create label and then the group box?
same result i switched it around like this

${NSD_CreateLabel} 10 20 95% 30 Description
Pop $0

${NSD_CreateGroupBox} 0 0 100% 100 GroupBox
Pop $0


but i have to remark the Pop of the ${NSD_CreateLabel} to make it work

What's in $0 after you do a Pop $0 after ${NSD_CreateLabel}? Is it a valid HWND?


Well i get back a 6 digit number (different every time i start the setup), is that a valid $HWND?


although I haven't the foggiest why it would behave the way it does with/without that pop, the problem does appear to get resolved if you pass the droplist creation function a caption, even if empty..

${NSD_CreateDropList} 10 60 200 30 ""

..perhaps it is always 'required'?

AAAARRRGGHHHHH

*imagine here sound of forehead hitting a tabletop*



Thanks a lot!


well, don't hit the tabletop yet.. like I said, I'm not sure why it behaves the way it does without the caption.. and to add to that, if you specify a non-empty caption... you still don't actually -see- a caption, which to me would imply it doesn't have a caption.. so why would you have to specify one?

*eyes the nsDialogs documentation and comes up empty*

Anyway.. as long as it's resolved :)