• 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. Window size is defferent from the size used in hiOpenWi...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 142
  • Views 9864
  • 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

Window size is defferent from the size used in hiOpenWindow

kkdesbois
kkdesbois over 3 years ago

Hello,
I create a window using the followin syntax, where bbow is defined earlier :

(set windowName (hiOpenWindow
                                     ?type "form"
                                     ?bBox bbox ;'default ; bbox ;
                                     ;?scroll nil
                                     ?menus (list (hiCreatePulldownMenu 'sessionmenu "Session" (list
                                                                      (hiCreateMenuItem ?name 'save
                                                                               ?itemText "Save ..."
                                                                               ?callback cbsave )
                                                                      (hiCreateMenuItem ?name 'load
                                                                               ?itemText "Load ..."
                                                                               ?callback cbload )
                                                                      (hiCreateMenuItem ?name 'close
                                                                               ?itemText "Close"
                                                                               ?callback (sprintf nil "(hiCloseWindow %s)" windowName ))))
                                                                      (hiCreatePulldownMenu 'helpmenu "Help" (list
                                                                      (hiCreateMenuItem ?name 'help
                                                                               ?itemText "Display ..."
                                                                               ?callback "UartBaCustomAnnotationHelp()" )))) ; list menus
                                     ?form form ) ; hiOpenWindow
) ; set

But, once the window is created, the command hiGetAbsWindowScreenBBox returns another box value.

For instance :

 - initial bbox = ((1794 185) (2474 930))

 - hiGetAbsWindowScreenBBox(window(28)) = ((1794 179) (2474 962))

I can't explain the reason. Any ideas?

Laurent.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Laurent,

    The window location argument to hiOpenWindow (the ?bBox argument) is a hint to the window manager, but they don't reliably honour it (and different window managers behave in different ways). There's some aspect of the window decorations coming into play here - and some of these will be above, and some below the window. You can pass t as the second argument to the function which excludes the parts of the window which are the window manager decorations, but that doesn't match either.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kkdesbois
    kkdesbois over 3 years ago in reply to Andrew Beckett

    Thanks Andrew for your prompt reply.

    Which function are you talking about when you advise to pass t as 2nd argument?

    My real need is actually to reuse the previous size and location of the window. The window's initial size in saved in a file (file already defined and used for other topics).

    Maybe, based on your experience, you can suggest a better way to do that?

    Laurent.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to kkdesbois

    Hi Laurent,

    The second argument I'm talking about is for the hiGetAbsWindowScreenBBox function. I'm not sure it's going to help you though. 

    If you want access to the initial bounding box, you could do:

    windowName->initialBBox=bbox

    (note, your variable name windowName is a bit of a misnomer, since it's a window id that is returned from hiOpenWindow, not a window name). I'm just suggesting storing the bounding box as a property on the window - and then you retrieve that with windowId~>initialBox. Of course, it won't update if you move the window, so this may not be useful either...

    Regards,

    Andrew 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kkdesbois
    kkdesbois over 3 years ago in reply to Andrew Beckett

    Hello Andrew,
    Thank you for your advices.

    I take note for being more rigorous when naming my variables in order their name to reflect their role Thumbsup

    The initialBBox won't be enough in my testcase because it's not being updated when the window is moved.

    Anyway, I adjusted my code in order to save only the lower point of the window and use that point to be the origin of the next opened window (which size is forced).

    See you in my next post Wink

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • kkdesbois
    kkdesbois over 3 years ago in reply to Andrew Beckett

    Hello Andrew,
    Thank you for your advices.

    I take note for being more rigorous when naming my variables in order their name to reflect their role Thumbsup

    The initialBBox won't be enough in my testcase because it's not being updated when the window is moved.

    Anyway, I adjusted my code in order to save only the lower point of the window and use that point to be the origin of the next opened window (which size is forced).

    See you in my next post Wink

    • 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