Archive: nsDialogs not displaying text field state?


nsDialogs not displaying text field state?
Hi, I'm using NSIS for the first time, v2.45.

I've build a simple custom page with a few configuration options, using nsDialogs and InstallOptions. All is fine, except that Text Fields are not displaying the State values set in my .ini file, they're always empty.

In fact, the same problem occurs with the NSIS examples: compiling and running Examples\nsDialogs\InstallOptions.nsi the text field is empty. However compiling and running Examples\InstallOptions\test.nsi - that references the same test.ini file - displays the same text field displays "Multiline edit...".

Does anybody else have the same issue?

Thanks

Mirko


As a workaround, setting Text rather than State seems to do the trick, i.e.


[Field 1]
Type=Text
Text="Initial Value"

instead of

[Field 1]
Type=Text
State="Initial Value"

"using nsDialogs and InstallOptions"
you might want to ponder what you're doing there :) nsDialogs is intended as a complete replacement for InstallOptions, so you wouldn't typically use them side-by-side at all; it's 'convenient' to use the INI, perhaps, but you're best off moving to nsDialogs entirely.

Anyway, looks like CreateDialogFromINI in nsDialogs.nsh doesn't read the State value from Text fields in ini files. If you really want to continue to use this hybrid approach, open nsDialogs.ini and change the Case for Text to a __NSD_ControlCaseEx call, and add a new Function '${UNINSTALLER_FUNCPREFIX}Text' function that uses $R9 for the text field.
( I think )


Originally posted by Animaether
"using nsDialogs and InstallOptions"
you might want to ponder what you're doing there :)
I was just following this nsDialogs\InstallOptions.nsi example really, to try and get this custom page done as quickly as possible. :)

Originally posted by Animaether
nsDialogs is intended as a complete replacement for InstallOptions, so you wouldn't typically use them side-by-side at all; it's 'convenient' to use the INI, perhaps, but you're best off moving to nsDialogs entirely.
Good to know, thanks. The INI file is quite handy though, along with ReadINIStr and WriteINIStr.

There is additional problem of checkboxes - their state is not read from ini file State key. I modified nsDialogs CreateDialogFromINI to read the State and (if it's not empty) call NSD_SetState.
nsDialogs.nsh is attached for version 2.45.