• 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. Custom "window"-ed form, assign "Enter" for specific callback...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 144
  • Views 2379
  • 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

Custom "window"-ed form, assign "Enter" for specific callback.

FlxZer
FlxZer over 7 years ago

Hi everyone.

I've stumbled across an issue that I couldn't solve myself by reading though skuiref.pdf or any other related document or discussion. I've created a custom tool with a GUI. Using hiCreateAppForm I was able to specify a callback to be executed when "Enter" button is pressed. I achieved this by setting ?callback and ?buttonLayout in the corresponding way:

hiCreateAppForm(
...
?buttonLayout 'ApplyCancel
?callback "myCB()"
...
)

 With it, user was able to swiftly type a term in a search field and press "Enter" to initiate the query ( myCB() ). So far, so good. However, I recently decided to put the my form into a window, thus it can be effectively min/maximized by user and allows me to add new menus in the banner field. Everything works smoothly, but since the form is now "Window"-ed ,  ?buttonLayout 'ApplyCancel and ?callback "myCB()" are no longer effective since the GUI does not have native Apply/Cancel buttons anymore.
 My question: is there a way to specify a default callback to be executed when Enter button is pressed, for a Window-ed form? As an example of what I'm trying to achieve is "Go" button in SKILL API Finder.
 hiCreateWindow does not have any parameter that resembles  buttonLayout & callback functionality and I couldn't identify a key binding function that would accept win_Id as input.  

Any help would be much appreciated!

Regards,
Boris

  • Cancel
Parents
  • drdanmc
    drdanmc over 7 years ago

    you can create a button widget as part of the form like this:

    myform=hiCreateAppForm(?name 'my_form

          ?fields list(

               hiCreateStringField(?name 'myStrField ?prompt "enter something" ?value "" ?defValue "" ?editable t)

               hiCreateButton(?name 'myButton ?buttonText "Apply" ?callback "printf(\"myButton Callback\n\n\")")

           )

    )

    mywin=hiCreateWindow('default "form" "MyApp" "" nil myform)

    hiDisplayWindow(mywin)

    if you don't want the fields to span the whole width of the window, then read about 2D forms.  Basically that list of widgets would be a list of lists like:

    x=0

    y=0

    dy=40

    w=400

    h=20

    pw=200

    list(

      list( hiCreateStringField(...) list(x, y+=dy), w:h, pw)

      list(hiCreate....)

    )

    You can read about those layout parameters (x, y, w, h, pw) in the manual.

    Hope this helps.

    -Dan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • drdanmc
    drdanmc over 7 years ago

    you can create a button widget as part of the form like this:

    myform=hiCreateAppForm(?name 'my_form

          ?fields list(

               hiCreateStringField(?name 'myStrField ?prompt "enter something" ?value "" ?defValue "" ?editable t)

               hiCreateButton(?name 'myButton ?buttonText "Apply" ?callback "printf(\"myButton Callback\n\n\")")

           )

    )

    mywin=hiCreateWindow('default "form" "MyApp" "" nil myform)

    hiDisplayWindow(mywin)

    if you don't want the fields to span the whole width of the window, then read about 2D forms.  Basically that list of widgets would be a list of lists like:

    x=0

    y=0

    dy=40

    w=400

    h=20

    pw=200

    list(

      list( hiCreateStringField(...) list(x, y+=dy), w:h, pw)

      list(hiCreate....)

    )

    You can read about those layout parameters (x, y, w, h, pw) in the manual.

    Hope this helps.

    -Dan

    • 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