Menus in Skill

Discussion in 'Cadence' started by kirscher_jerome, Jun 29, 2005.

  1. Hello,
    I ve created a cyclic field in my form using the skill function
    "hiCreateCyclicField" . But how can I launch a function depending on
    the field I choose. I mean, I manage to create just one callback, which
    will be activated whatever the field of my list is.
    Thanks a lot
    Jerome
     
    kirscher_jerome, Jun 29, 2005
    #1
  2. kirscher_jerome

    S. Badel Guest

    << Callback string for this field. If a callback is specified, the item
    selected (either text or an icon) is appended to this callback
    before being executed by SKILL. >>

    thus you define the callback as a string like

    ?callback "myCallback arg1 ... argn"

    and the callback gets one more argument which is the selected item

    procedure( myCallback( arg1 ... argn item ) printf("selected %s\n" item) )

    alternatively, include hiGetCurrentForm() in your callback and use the form handle
    to retrieve the field value

    ?callback "myCallback hiGetCurrentForm()"
    procedure( myCallback( form @rest args ) printf("selected %s\n" form->field->value) )


    the trap is to define the callback as

    ?callback "myCallback( arg1 ... argn )" or ?callback "(myCallback arg1 ... argn)"

    because then the evaluated skill is

    myCallback( arg1 ... argn ) item

    which calls the callback without the item argument, and evaluates the item upon return.



    stéphane
     
    S. Badel, Jun 29, 2005
    #2
  3. This solution works. Thx!!
     
    kirscher_jerome, Jun 29, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.