• 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. icons in code/context

Stats

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

icons in code/context

Adrian Nistor
Adrian Nistor over 14 years ago

Hi all,

I was thinking about adding some icons to a form. Everything it's ok, except that when I will "release" the final version of my tool, I will have to provide also the icon files, and this I want to avoid. Is there any method to include an icon in a context file or to "compile" it as skill code? Or is there other method to resume the tool at only one file and also to mantain the possibility to load the file in icfb (this way the both the script and the icons shoul be loaded) ?

 

Thank you,

Adrian

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Hi Adrian,

    You can create icons the old fashioned way - for example:

    (defun abSomeExampleToCreateIconButtons ()
    (let (colourArray downString upString downIcon upIcon downButton upButton outputs)
    ;-----------------------------------------------------------------
    ; Create the icons for the up/down buttons
    ;-----------------------------------------------------------------
    (setq colourArray (hiCreateColorArray))
    (setarray colourArray 0 (hiMatchColorByName "thistle"))
    (setarray colourArray 1 (hiMatchColorByName "red"))
    (setq downString
    "aaaaaaaaaaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    a111111111111a\
    aa1111111111aa\
    aaa11111111aaa\
    aaaa111111aaaa\
    aaaaa1111aaaaa\
    aaaaaa11aaaaaa\
    aaaaaaaaaaaaaa"
    )
    (setq upString
    "aaaaaaaaaaaaaa\
    aaaaaa11aaaaaa\
    aaaaa1111aaaaa\
    aaaa111111aaaa\
    aaa11111111aaa\
    aa1111111111aa\
    a111111111111a\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaa11aaaaaa\
    aaaaaaaaaaaaaa"
    )
    (setq downIcon (hiStringToIcon colourArray downString 14 13))
    (setq upIcon (hiStringToIcon colourArray upString 14 13))
    ;--------------------------------------------------------------------
    ; Now create the fields on the form
    ;--------------------------------------------------------------------
    (setq upButton
    (hiCreateButton
    ?name 'upButton
    ?buttonText "Up"
    ?buttonIcon upIcon
    ?callback "(abMyFormCB (hiGetCurrentForm) t)"
    ))
    (setq downButton
    (hiCreateButton
    ?name 'downButton
    ?buttonText "Down"
    ?buttonIcon downIcon
    ?callback "(abMyFormCB (hiGetCurrentForm) nil)"
    ))
        ; code modified to remove irrelevant stuff below 
    )) 

    But apart from that, you can't embed (say) png or similar bitmap files within the context. You should be able to devise a way to locate them though - normally they'd go in the .cadence dir somewhere and be found that way (I think) - sorry, don't have time to try it out and experiment, so giving a very quick cut-and-paste answer.

    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