• 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. Private GUI Callbacks and SKILL++

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 143
  • Views 16505
  • 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

Private GUI Callbacks and SKILL++

Curtisma
Curtisma over 6 years ago

Hello:

I am trying to create a SKILL++ package that includes a form gui.  I setup a gui using a public function of the package.  My plan was to have the callback functions for the gui elements remain private as part of the package and then only make the function to create and open the gui public.  However when I try this I cannot get it to recognize the private functions.  Is there any way I can keep the callback functions private to the package and still run the gui?

I've tried several ways of specifying the callback function when creating the field.  These include trying a string call the private function, a symbol for it, and including the package name in the call. (packageName->selectFileCB) None have fixed the scope issue.

packageName = let(

...

procedure( createGui(L C V)

...

   hiCreateButton(
   ?name 'SelectFileButton
   ?buttonText "Browse"
   ?callback "SelectFileCB('hiGetCurrentForm())")

...

) ; procedure createGui

procedure( selectFileCB()

...

) ; procedure selectFileCB....

) ; let

list(nil 'createGui createGui))

Start Gui:

packageName->createGui()

Gui starts but the callbacks don't work.

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

    The callbacks are evaluated in the global scope, so that's why it can't see your lexically scoped callback function. From IC617 onwards, you can specify most of the UI callbacks as function objects rather than a SKILL expression or the name of a function, so that allows you to pass the function object accessed via a lexical scope to be the callback - and then since the UI now has the function object, it will be called in the correct scope.

    Details on how to specify function objects as callbacks can be found in the Cadence User Interface SKILL Reference manual, in Chapter 1, in a section headed Function Object Callbacks.

    Here's a simple example I just put together based on your outline:

    ; ensure this is in a file with a .ils suffix
    myPackage=let(()
      procedure(createGUI()
        hiDisplayForm(
          hiCreateAppForm(
    	?name 'forumGUI
    	?fields
              list(
                list(
                  hiCreateStringField(
                    ?name 'name 
                    ?prompt "Name"
                  )
                  0:0 400:30 100)
                list(
                  hiCreateButton(
                    ?name 'button
                    ?buttonText "Press me"
                    ; pass the callback as a function object rather than
                    ; the name of the function or a SKILL expression
                    ?callback buttonCB
                  )
                  100:30 150:30)
              )
          )
        )
      )
      procedure(buttonCB(field scope)
        printf("Button pressed - field:%L scope:%L\n"
          field scope
        )
      )
      list(nil 'createGUI createGUI)
    )

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Curtisma
    Curtisma over 6 years ago in reply to Andrew Beckett

    Is there a way to make the deRegApp callbacks private?  Can I use a function object as the callback there also?

    -Curtis

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Curtisma
    Curtisma over 6 years ago in reply to Andrew Beckett

    Is there a way to make the deRegApp callbacks private?  Can I use a function object as the callback there also?

    -Curtis

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to Curtisma

    Curtisma said:

    Is there a way to make the deRegApp callbacks private?  Can I use a function object as the callback there also?

    Hi Curtis,

    No. These callbacks currently have to be specified as the symbol for the name of the function. There may well be an enhancement request to change this (I didn't check as I'm on vacation this week), but it would be worth you contacting customer support to request this.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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