• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. How to hide or expose different options

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 11154
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to hide or expose different options

saurabh96
saurabh96 over 4 years ago

Hey..

is there any way to hide or expose certain string field  based on options from combo box .Suppose if i choose "a" from combo box then string filed "x" gets hide or disappear not disabled and when selected "b" its appear?

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    myform->field1->invisible=t

    will make the field invisible. If you set the invisible property to nil it will reappear again.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for charm response...here what i have implement and getting confused/error how to callback local variable in another procedure ... i tried that and getting error when i select  technode is "60nm" or "80nm'' my string and button data gets hidden.

    (let (techNodes rules rulesTbl string button_data)

       rulesTbl = (makeTable 'rulesTbl nil)
       rulesTbl["60nm"] = rulesTbl["50nm"] =rulesTbl["90nm"] = (list "rule7" "rule2" "rule9")
       rulesTbl["10nm"] = rulesTbl["40nm"] =rulesTbl["80nm"] = (list "rule1" "rule4")

       techNodes = (hiCreateCyclicField
                      ?name 'techNodes
                      ?prompt     "Tech Nodes"
                      ?choices    (list "10nm" "40nm" "50nm" "60nm" "80nm" "90nm")
                      ?callback  list(("MytechFields(hiGetCurrentForm())") ("MyhideFields(hiGetCurrentForm())") )



       rules = (hiCreateCyclicField
                      ?name 'rules
                      ?prompt     "Rules"
                      ?choices    (list "rule1" "rule4"))

    string = hiCreateStringField(
    ?name 'string
    ?prompt "chk"
    ?value ""
    )
    button_data = hiCreateButton(
    ?name 'button_data
    ?buttonText "Browse"
    ?callback "ddsFileBrowseCB(hiGetCurrentForm() 'string \"\" 'fileOnly)"

       theForm = (hiCreateAppForm
          ?name 'myForm
          ?formTitle "Just playing..."
          ?fields (list techNodes rules string button_data))

       (hiDisplayForm theForm)
    )

    procedure(MytechFields(form)

    (lambda (fld form node)
    theForm->rules->choices = rulesTbl[node]))

    procedure(MyhideFields(form)

    case(form->technodes->value
    ("60nm"

    myform->string->invisible=t

    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    There were very few lines in your code that didn't have an error of some sort. Between missing (or mismatched) parentheses, misspelt variable names, failing to access field values, unnecessary lambdas, and a callback argument that was just some random use of lists, very little was correct.

    I would strongly suggest you follow SKILL training as mentioned in a previous post, or at the very least look at my video: Writing Good SKILL Code (Video)

    I've reformatted your code to make it easier to read - as I mention in the video, using consistent indentation tends to help with readability and also spotting mistakes. Using bracket matching in an editor really helps too to find mistakes. Or just reading the documentation and taking some training (it's not clear to me that you have much programming experience as regardless of the language most of these things ought to have been pretty easy to spot).

    Andrew

    (let (techNodes rules rulesTbl)
    
       rulesTbl = (makeTable 'rulesTbl nil)
       rulesTbl["60nm"] = rulesTbl["50nm"] =rulesTbl["90nm"] = (list "rule7" "rule2" "rule9")
       rulesTbl["10nm"] = rulesTbl["40nm"] =rulesTbl["80nm"] = (list "rule1" "rule4")
    
       ; close brackets were missing too here, and callback is nonsense
       techNodes = (hiCreateCyclicField
          ?name 'techNodes
          ?prompt     "Tech Nodes"
          ?choices    (list "10nm" "40nm" "50nm" "60nm" "80nm" "90nm")
          ; original bad  callback
          ;?callback  list(("MytechFields(hiGetCurrentForm())") ("MyhideFields(hiGetCurrentForm())") )
          ; two space-separated callback functions - calls one then the other
          ?callback  "MytechFields(hiGetCurrentForm()) MyhideFields(hiGetCurrentForm())"
          ; alternative implementation with new function which does both changing choices and controls
          ; visibility
          ;?callback  "MytechAndHideFields(hiGetCurrentForm())"
       )
    
       rules = (hiCreateCyclicField
          ?name 'rules
          ?prompt     "Rules"
          ?choices    (list "rule1" "rule4"))
    
       string = hiCreateStringField(
          ?name 'string 
          ?prompt "chk"
          ?value "" 
       )
    
       ; close brackets were in wrong place (after the hiDisplayForm)
       button_data = hiCreateButton(
          ?name 'button_data 
          ?buttonText "Browse" 
          ?callback "ddsFileBrowseCB(hiGetCurrentForm() 'string \"\" 'fileOnly)"
       )
    
       theForm = (hiCreateAppForm
          ?name 'myForm
          ?formTitle "Just playing..."
          ?fields (list techNodes rules string button_data))
    
       (hiDisplayForm theForm)
    )
    
    ; WARNING - the functions below rely on dynamic scoping - the rulesTbl variable is 
    ; defined in the let above, and it's only visible here because the form is blocking, 
    ; and the hiDisplayForm is within the let. You need to be careful not to change that
    ; behaviour because otherwise this will stop working (i.e. if you don't call hiDisplay
    ; within the let).
    
    procedure(MytechFields(form)
    
       ; no idea why you'd put a lambda here - absolutely unnecessary to create an anonymous function
       ; when you're actually creating a named function!
       ;(lambda (fld form node))
       ; the variable name was also wrong (theForm) plus the node wasn't being retrieved from the form
       form->rules->choices = rulesTbl[form->techNodes->value]
    
    )
    
    procedure(MyhideFields(form)
    
       ; you'd misspelled techNodes as technodes in the case
       case(form->techNodes->value
          ("60nm"
             ; form variable was wrong here - you'd used myform (lowercase). Either
             ; use form (the variable passed in) or the global variable theForm
             form->string->invisible=t
          )
          ; added a default clause so that there is some way of making it visible again
          (t
             form->string->invisible=nil
          )
       ; were missing two close parentheses here
       )
    )
    
    ; alternative implementation - combined both into one function
    procedure(MytechAndHideFields(form)
       form->rules->choices = rulesTbl[form->techNodes->value]
       case(form->techNodes->value
          ("60nm"
             form->string->invisible=t
          )
          (t
             form->string->invisible=nil
          )
       )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    There were very few lines in your code that didn't have an error of some sort. Between missing (or mismatched) parentheses, misspelt variable names, failing to access field values, unnecessary lambdas, and a callback argument that was just some random use of lists, very little was correct.

    I would strongly suggest you follow SKILL training as mentioned in a previous post, or at the very least look at my video: Writing Good SKILL Code (Video)

    I've reformatted your code to make it easier to read - as I mention in the video, using consistent indentation tends to help with readability and also spotting mistakes. Using bracket matching in an editor really helps too to find mistakes. Or just reading the documentation and taking some training (it's not clear to me that you have much programming experience as regardless of the language most of these things ought to have been pretty easy to spot).

    Andrew

    (let (techNodes rules rulesTbl)
    
       rulesTbl = (makeTable 'rulesTbl nil)
       rulesTbl["60nm"] = rulesTbl["50nm"] =rulesTbl["90nm"] = (list "rule7" "rule2" "rule9")
       rulesTbl["10nm"] = rulesTbl["40nm"] =rulesTbl["80nm"] = (list "rule1" "rule4")
    
       ; close brackets were missing too here, and callback is nonsense
       techNodes = (hiCreateCyclicField
          ?name 'techNodes
          ?prompt     "Tech Nodes"
          ?choices    (list "10nm" "40nm" "50nm" "60nm" "80nm" "90nm")
          ; original bad  callback
          ;?callback  list(("MytechFields(hiGetCurrentForm())") ("MyhideFields(hiGetCurrentForm())") )
          ; two space-separated callback functions - calls one then the other
          ?callback  "MytechFields(hiGetCurrentForm()) MyhideFields(hiGetCurrentForm())"
          ; alternative implementation with new function which does both changing choices and controls
          ; visibility
          ;?callback  "MytechAndHideFields(hiGetCurrentForm())"
       )
    
       rules = (hiCreateCyclicField
          ?name 'rules
          ?prompt     "Rules"
          ?choices    (list "rule1" "rule4"))
    
       string = hiCreateStringField(
          ?name 'string 
          ?prompt "chk"
          ?value "" 
       )
    
       ; close brackets were in wrong place (after the hiDisplayForm)
       button_data = hiCreateButton(
          ?name 'button_data 
          ?buttonText "Browse" 
          ?callback "ddsFileBrowseCB(hiGetCurrentForm() 'string \"\" 'fileOnly)"
       )
    
       theForm = (hiCreateAppForm
          ?name 'myForm
          ?formTitle "Just playing..."
          ?fields (list techNodes rules string button_data))
    
       (hiDisplayForm theForm)
    )
    
    ; WARNING - the functions below rely on dynamic scoping - the rulesTbl variable is 
    ; defined in the let above, and it's only visible here because the form is blocking, 
    ; and the hiDisplayForm is within the let. You need to be careful not to change that
    ; behaviour because otherwise this will stop working (i.e. if you don't call hiDisplay
    ; within the let).
    
    procedure(MytechFields(form)
    
       ; no idea why you'd put a lambda here - absolutely unnecessary to create an anonymous function
       ; when you're actually creating a named function!
       ;(lambda (fld form node))
       ; the variable name was also wrong (theForm) plus the node wasn't being retrieved from the form
       form->rules->choices = rulesTbl[form->techNodes->value]
    
    )
    
    procedure(MyhideFields(form)
    
       ; you'd misspelled techNodes as technodes in the case
       case(form->techNodes->value
          ("60nm"
             ; form variable was wrong here - you'd used myform (lowercase). Either
             ; use form (the variable passed in) or the global variable theForm
             form->string->invisible=t
          )
          ; added a default clause so that there is some way of making it visible again
          (t
             form->string->invisible=nil
          )
       ; were missing two close parentheses here
       )
    )
    
    ; alternative implementation - combined both into one function
    procedure(MytechAndHideFields(form)
       form->rules->choices = rulesTbl[form->techNodes->value]
       case(form->techNodes->value
          ("60nm"
             form->string->invisible=t
          )
          (t
             form->string->invisible=nil
          )
       )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information