Home > Community > Forums > Custom IC SKILL > change default GUI callback

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 change default GUI callback 

Last post Fri, May 11 2012 4:09 AM by Leonid Y. 17 replies.
Started by Leonid Y 02 May 2012 07:10 AM. Topic has 17 replies.
Page 2 of 2 (18 items) < Previous 1 2
Sort Posts:
  • Fri, May 11 2012 3:58 AM

    • Leonid Y
    • Not Ranked
    • Joined on Thu, Dec 17 2009
    • Posts 11
    • Points 160
    Re: change default GUI callback Reply

    I must have stated it wrong way. My question is not about  the deRegUserTriggers() function itself but about function which is passed to it. In my case it is  _defCR8I_CB which does not require any arguments itself. Initially, I created it without any parameters and tried to pass it as it is:

     ;;;

    procedure(_defCR8I_CB()
    leCreateInstForm->cellName->_callback="_cr8tinstCallback()"
    )


    deRegUserTriggers("maskLayout" '_defCR8I_CB)

    ;;;;

     The commands worked OK but when tried to open any layout cellview CIW reported:

     

     *Error* _defCR8I_CB: too many arguments (0 expected, 1 given) - ((nil wasPushed nil prependList nil ... ))

     *WARNING* A Skill error occurred in function _defCR8I_CB

     

    That's why I had to define the redundant _defCR8I_CB(opt) parameter in order to avoid the error, but I do not really understand how it works.

     

     

    • Post Points: 20
  • Fri, May 11 2012 4:03 AM

    Re: change default GUI callback Reply

    OK, the callback must be defined to accept a single argument. It's not optional as far as the caller is concerned. If you read the documentation on de triggers (in the manual which covers deRegUserTriggers amongst other things), you'll see that the argument is used to pass various information - for example, the window, the cellView, the action performed (e.g. whether you've pushed or popped, etc). It's a "disembodied property list". What it means however is that you must declare this argument in your function whether you need it or not - because it's going to be passed to you regardless.

    Many callbacks work this way - they have a documented call signature.

    Regards,

    Andrew.

     

    • Post Points: 20
  • Fri, May 11 2012 4:09 AM

    • Leonid Y
    • Not Ranked
    • Joined on Thu, Dec 17 2009
    • Posts 11
    • Points 160
    Re: change default GUI callback Reply

    Good explanation, I got it. Thank you

    • Post Points: 5
Page 2 of 2 (18 items) < Previous 1 2
Sort Posts:
Started by Leonid Y at 02 May 2012 07:10 AM. Topic has 17 replies.