• 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. SKILL++ variable in form callback

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 13637
  • 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

SKILL++ variable in form callback

acook
acook over 11 years ago

Another SKILL++ question!

 I have a procedure that has a class instances as well as a form declaration. I would like to have the form callback use a class instance method. My current solution is to declare the class instance using "inSkill" so that it is global to the form. Is there a way to keep it private?

 

procedure( makeForm() <-----this procedure is in a SKILL++ .ils file 

 obj = makeInstance( 'MyClass)

   b_run =hiCreateButton(

            ?name 'run_button

            ?buttonText "Run" 

            ?callback Run(obj)  ; <--- Option 1 Evaluates immediatly

            ?callback strcat("Run(" myObjName ")"); Option 2 requires myObjName, a string that refers to an object instances, as well as whatever the object instance is to be global

   ) 

) 

Option 1 doesn't work at all but is kinda what I'm looking for, where I just want Run(obj) to happen when the button is pressed. obj is kept private

Option 2 is what I am currently doing, in another area I run the makeInstance "inSkill".

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

    In IC616 you can have callbacks be a function object. So you could make the callback ?callback lambda((fieldName form) Run(obj)). Then it would be lexically scoped to the place where the button was created.

    Prior to IC616, the callbacks have to be strings (for fields), and will be executed in the global scope. What you could however do is store the object as a property on the form (so having built the form, you could do myForm->myObj=obj - and then you could access that from within the callback function). The callback function would in that class have to be visible - because it's just evaluated (in SKILL, not SKILL++) using evalstring().

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    In IC616 you can have callbacks be a function object. So you could make the callback ?callback lambda((fieldName form) Run(obj)). Then it would be lexically scoped to the place where the button was created.

    Prior to IC616, the callbacks have to be strings (for fields), and will be executed in the global scope. What you could however do is store the object as a property on the form (so having built the form, you could do myForm->myObj=obj - and then you could access that from within the callback function). The callback function would in that class have to be visible - because it's just evaluated (in SKILL, not SKILL++) using evalstring().

    Regards,

    Andrew.

    • 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