• 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. Problem of list box update

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 3657
  • 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

Problem of list box update

Martinsh
Martinsh over 1 year ago

Find files and display them in a list box.

Display "Seaching..." in the list box first, then, after file finding is complete, update the list box with the files found.

theForm->listBox->choices = '("Searching...")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Skill code for file seach

;; It may take time of 1 second. fileList is the finding result.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

theForm->listBox->choices = fileList

With the code above, the files found are displayed in the list box. But no "Seaching..." is displayed in the list box in the process of file seaching. Why? 

Regards,

Martin

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    Martin,

    I thought that using one of hiFlush() or hiUpdate() might fix this, but it doesn't need to.

    Assuming that the slow operation is a result of using ipcBeginProcess() - based on your previous question - could you change your ipcBeginProcess() to provide data and exit callbacks and hence work asynchronously? Then the code wouldn't need to block, and the UI could complete...

    Here's an example. Put this in a file with a .ils suffix :

    ;------------------------------------------------------------------------
    ; This needs to be in a file with .ils suffix to ensure that
    ; the local functions used within ForumShowListBox work
    ;------------------------------------------------------------------------
    
    procedure(ForumListBox()
      let((listbox)
        listbox=hiCreateListBoxField(
          ?name 'listBox
          ?choices nil
        )
        hiCreateLayoutForm(
          'ForumLBForm
          "List Box Form"
          hiCreateFormLayout(
            'formLayout
            ?items list(listbox)
          )
        )
      )
    )
    
    procedure(ForumShowListBox()
      let((cid (allFiles "") form)
        ;--------------------------------------------------------------------
        ; Collect all output from the command
        ;--------------------------------------------------------------------
        procedure(dataHandler(id data)
          allFiles=strcat(allFiles data)
        )
        ;--------------------------------------------------------------------
        ; When finished, update the form
        ;--------------------------------------------------------------------
        procedure(exitHandler(id status)
          form->listBox->choices=parseString(allFiles)
        )
        form=ForumListBox()
        hiDisplayForm(form)
        form->listBox->choices='("Searching...")
        cid=ipcBeginProcess("sleep 4; /bin/ls -1 /bin/" "" dataHandler "" exitHandler)
      )
    )
    

    Then call ForumShowListBox()

    Andrew

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

    Hi, Andrew,

    I've saved the above code into a .ils file and load it. But when I run it with ForumShowListBox(), it stoped there with "Searching..." in the List Box.

    Two break points are added in Skill IDE window and the code is reloaded. After that, I run ForumShowListBox() again. The program stops at "Searching..." again and not stop at any break points. It seems the dataHandler() and exitHandler() functions are not accessed by ipcBeginProcess() function.

    Please help. Thanks.

    Martin

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

    Martin,

    That's odd. I can't think what this would be - I've tried various mechanisms I can think of to make it fail, and it always works for me.

    Can you submit a support case at http://support.cadence.com and ask for the AE to contact me (I'd like to take the case) - reference this forum post. Then we can take a look together.

    Andrew

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

    Hi, Andrew,

    When I run your code on another computor, it works well. So there may have some environment problem. Your code is good! Thanks!

    Martin

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

    Hi, Andrew,

    When I run your code on another computor, it works well. So there may have some environment problem. Your code is good! Thanks!

    Martin

    • 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