![]() |
Change textbox text at runtime
Hi All,
I have a custom dialog I created using NSD from the Coolsoft NSIS designer. I have a check box on the Dialog with some standard string say "Check this". I am trying to change the Value of this during runtime. The code from the dialog designer is below: ; === CheckBox1 (type: Checkbox) === ${NSD_CreateCheckbox} 50.03u 73.23u 110.58u 14.77u "Check This" Pop $hCtl_ExistingHub_CheckBox1 If I do this in my installer, it doesnt change the text: ${NSD_SetText} $hCtl_ExistingHub_CheckBox1 "Check that" I tried putting this line before calling the function that shows the page. Any inputs? |
If you want to change the text before showing the page, just change the text in the first line (the one that creates the checkbox). If you want to change the text when it's clicked, you have to use a function callback and use ${NSD_SetText} in that.
|
Hi Jason,
Thank you for the reply. The problem with the Coolsoft NSIS designer is one cannot edit the code that it generates, within the .nsdinc file. So,I was thinking if there is anyway say I make a list box/ checkbox and generate the list items or checkbox items from my .nsi file. |
Does it set the read-only flag on the .nsdinc file? (right click -> Properties -> Attributes:).
Unfortunately it becomes very difficult to manage both user code and wizard generated code. NSIS is a scripting language, eventually you will learn how to code installers from scratch if you use it often enough. I would say do as much as you can in the wizard, then manually add the extra bits you need. I would say if you use the wizard again after this, it would probably overwrite all the extra code you put in, wasting more time. |
It works just fine, you must be doing something wrong:
PHP Code:
|
Thanks Jason, thats what am doing these days. Just generating the UI code using the designer and using that in my installer.
Like you mentioned editing the file and re-opening again in wizard overwrites all my changes. |
Hi Anders,
Thank you for your repky. Yes, the piece of code you provided works fine but the Createcheckbox is in the designer code and the settext is in my nsi which doesnt seem to work. |
| All times are GMT. The time now is 18:01. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.