Home
  • Products
  • Solutions
  • Support
  • Company

This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  • Products
  • Solutions
  • Support
  • Company
Community Custom IC SKILL How to access the value of a boolean button within a form...

Stats

  • Locked Locked
  • Replies 20
  • Subscribers 136
  • Views 8422
  • 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

How to access the value of a boolean button within a form within a docked window

blankman
blankman over 1 year ago

Hi,

I have a form, within a docked window, within my session window. And within that form I have a boolean button. How do I access the value of that boolean button?

I have tried this, however is not accessing it:

hiGetCurrentForm()~>bool1~>value

Thanks,

B

  • Cancel
  • blankman
    blankman over 1 year ago

    PS, the dock window was created using code provided by AurelBuche (at the following location). ie the dock window was added to a global table.

    community.cadence.com/.../1395442

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to blankman

    You can't use hiGetCurrentForm() with forms in dock windows - see this post. Are you trying to access this within a callback - if so that post will give you a suggestion, hopefully.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    Thanks Andrew,

    Yes this is for within a callback.

    I have tried the below, though not functioning. Can you advise what I might be missing?

    ?callback lambda((bool1 DockForm()) printf("New value in field %L scope %L\n" bool1 DockForm()))



    I am using the following to define the boolean button that is used within the form


    bool1 = hiCreateBooleanButton(
    ?name 'bool1
    ?buttonText "Test"
    ?callback lambda((bool1 DockForm()) printf("New value in field %L scope %L\n" bool1 DockForm()))
    ?buttonLocation 'right
    )

    Thanks,

    B

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to blankman

    I'm not sure why you've put parentheses after DockForm - it's not a function. Also, you're missing the third argument for the callback function. This will work:

      bool1 = hiCreateBooleanButton(
        ?name 'bool1
        ?buttonText "Test"
        ?callback 
          lambda((bool1 DockForm value) 
            printf("New value %L in field %L scope %L\n" value bool1 DockForm)
          )
        ?buttonLocation 'right
      )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    Thanks Andrew, yes it is more a trial and error approach I am taking at the moment not yet having formally trained in skill. This works now, this is much appreciated.

    What syntax would I then use to assign the value of the boolean button to a variable for use in other procs? ie if ticked, TestVar = t, and if unticked, TestVar = nil. 

    Thanks again,

    B.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to blankman

    Well, you could do exactly as you've described - set a global variable in the callback function (use TestVar=t or TestVar=nil or even TestVar=value if value was the argument to the callback function). However, I really don't see any good reason to introduce a global variable for this - if it's needed in the callback for another field, you could use DockForm->bool1->value (DockForm being the variable describing the scope argument) to look up the value - no additional variables are needed.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    THanks Andrew, "DockForm->bool1->value" - this works a charm, however, when I have multiple dock windows open, ie across different session windows, all referncing the same DockForm, I notice only the most recently opened dockwindow seems to register the boolean button change. ie if I change the boolean button value on a previosuly opened dock window, "DockForm->bool1->value" doesn't register that change. Is there a way of grabbing the boolean button change per session window so that the boolean in each docked window registers the change? I am assuming this might have something to do with accessing the table that each docked window has been added to, as per this example?

    https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/58186/after-creating-dockable-window-containing-a-form-how-to-locate-and-delete-in-order-to-recreate-the-dockable-window-and-form/1395442#1395442

    Thanks again,

    B

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to blankman

    Given that DockForm is the argument to the callback function (the lambda), I would expect this to show you the value of the field on the form. I only briefly looked at Aurélien's example code, but I don't think the table stuff should make a difference.

    Can you either share a complete enough example that shows the problem, or if you can't do that, contact customer support?

    Thanks,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    Hi Andrew, yes example test code below. See condition statement used in proc: UseBoolTest()

    [EDIT: code removed]

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to blankman

    Thanks for the sample code.

    However, this doesn't really explain where you are trying to access the boolean button from (the function UseBoolTest is not called from anywhere), and also the global variable Test is just set in that uncalled function and not used anywhere. I would have expected that you might have some kind of callback/action in the docked form and that the callback for those items would do everything necessary. Without understanding the overall flow of how you expect to interact with the form and what it triggers, it's pretty hard to advise...

    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