Skip to content
⌘ NSIS Forum Archive

Descriptions / ModernUI

9 posts

Yathosho#

Descriptions / ModernUI

i was reading the example by joost for the ModernUI, and i tried to modify it for one of my own installers. what i couldnt figure is how on tells the installer, to show the descriptions for each section.

if someone could give me an example here, i'd be very thankful!
kichik#
What's wrong with the example in the modern UI? You get the section id in $0, compare it to whatever section you want to set the description for, and set it using SendMessage WM_SETTEXT.
matini#

Section "BlaBla" bla_section
;some codes
SectionEnd
.
.
.
Function .onMouseOverSection
!insertmacro MUI_DESCRIPTION_INIT
!insertmacro MUI_DESCRIPTION_TEXT 1033 ${bla_section} "This section will install blabla."
!insertmacro MUI_DESCRIPTION_END
FunctionEnd
The example.nsi is a really good example for learning how to use the modern UI. 🙂
matini#
Sorry.fail on the previous post.
Dick4#
Basically, what they're saying is true, but you do it like this:

First, your section must have a variable name assigned to it, done like this:
Section "MsgBox 3" sec3
where "sec3" is the variable name

then, later in the code, you give that variable name a description, like this:
Function .onMouseOverSection
!insertmacro MUI_DESCRIPTION_INIT

!insertmacro MUI_DESCRIPTION_TEXT 1033 ${sec1} "This is the first section."
!insertmacro MUI_DESCRIPTION_TEXT 1033 ${sec2} "This is the second section."
!insertmacro MUI_DESCRIPTION_TEXT 1033 ${sec3} "This is the third section."

!insertmacro MUI_DESCRIPTION_END
FunctionEnd
Took me a few minutes to figure it out, as there really isn't any good documentation on how it works (that I found), just an example.
Yathosho#
i'm using the latest CVS and get the following message


 unknown variable "{sec1}" detected, ignoring
and i used the same code as mentioned above 😢
Dick4#
I'm almost positive its case sensitive, so check that...

can you post your script so we can look at it?
Joost Verburg#
Originally posted by killahbite
i'm using the latest CVS and get the following message


 unknown variable "{sec1}" detected, ignoring
and i used the same code as mentioned above 😢
Are you sure you made a section with that variable?

For example: Section "Section 1" sec1

You should also place the function in the script below the sections.