• 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. hiGetAbsWindowScreenBBox() and view()

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 13404
  • 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

hiGetAbsWindowScreenBBox() and view()

Aldo2
Aldo2 over 5 years ago

Hello,

I would like to open a file, through view(), always in the same position.

I am using hiGetAbsWindowScreenBBox() to get the boxSpec value for view(), but I have a 30pt-shift in y direction (correction is in red.)

if(boundp('viewFile) && windowp(viewFile) then
    boxSpec=hiGetAbsWindowScreenBBox(viewFile)
    boxSpec=list(list(caar(boxSpec) cadar(boxSpec)-30) list(caadr(boxSpec) cadadr(boxSpec)-30))
    hiCloseWindow(viewFile)
    viewFile=view(hiGetCurrentForm()~>strFile~>value boxSpec)
else
    viewFile=view(hiGetCurrentForm()~>strFile~>value nil    )
)

Thank you,

Aldo

  • Cancel
  • skillUser
    skillUser over 5 years ago

    Hi Aldo,

    Have you tried including a non-nil value to the optional argument to the hiGetAbsWindowScreenBBox function:

    hiGetAbsWindowScreenBBox(w_windowId [g_includeWMOffsets] )

    This doesn't fully eliminate the need for correction, but should reduce it greatly.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Aldo2
    Aldo2 over 5 years ago in reply to skillUser

    Hi Lawrence,

    I have tried now, but, as you says, there is an offset also in this case.

    I could get the real y-offset value (30 in my case) as cadddr(hiGetWMOffsets()), but I do not know if this is a general solution for any windows manager.

    What do you think?

    Thank you very much

    Best regards,

    Aldo

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Aldo2

    Hi Aldo,

    It's been a while since I looked into the precise nature of window manager offsets across different window managers, but I do know in the past some window managers were less well behaved about honouring precise coordinates. Without experimenting with a lot of window managers, I'm not sure I could confidently say this will work OK.

    However, I would ask why you need to close and recreate the window each time. Why not use hiSetViewfile(viewWindow newFile) to update the existing window to the new file contents? Then it will stay exactly where it was before...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Aldo2
    Aldo2 over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    hiSetViewfile() works fine. It is the best solution for me.

    Thank you very much

    Best regards,

    Aldo

    • 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