|
|
#1 |
|
Member
Join Date: Jul 2015
Posts: 62
|
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? |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
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.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#3 |
|
Member
Join Date: Jul 2015
Posts: 62
|
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. |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
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. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
It works just fine, you must be doing something wrong:
PHP Code:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Member
Join Date: Jul 2015
Posts: 62
|
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. |
|
|
|
|
|
#7 |
|
Member
Join Date: Jul 2015
Posts: 62
|
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. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|