From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Help retrieving window sizing side/corner in Linux

I'm coding in CVI 8.1 and using the 2010 RTE for Linux.  In Linux, EVENT_PANEL_SIZE fires multiple times instead of EVENT_PANEL_SIZING (as it is in Windows).  The problem is that the EVENT_PANEL_SIZE event doesn't provide any callback data in either eventData1 or eventData2.  Therein liles my problem, I need to know what side/corner of the window is being dragged to fire the EVENT_PANEL_SIZE events in Linux.  I'm going to go out on a limb and bet that the functionality for this hasn't improved since the 2010 Linux RTE release.  Hopefully someone can correct me if I'm wrong (we're in the middle of upgrading to latest CVI) or steer me in the right direction to acquire what side/corner the resize drag occurs on. 

 

I'm really hoping I don't need to fall back to X to get the drag side info.

 

Thanks,

-shrew

0 Kudos
Message 1 of 4
(4,354 Views)

To clarify a confusing sentence in my previous post: I need to know what side/corner of the window is being dragged due to the EVENT_PANEL_SIZE events in Linux.

 

Thanks again for reading,

-shrew

0 Kudos
Message 2 of 4
(4,352 Views)

Hello pshrew, 

 

For information on where this information is passed and stored, please view the following links: 

 

http://zone.ni.com/reference/en-XX/help/370051Y-01/cvi/uiref/cvieventpanelsize/

 

http://zone.ni.com/reference/en-XX/help/370051M-01/cvi/uiref/cvieventpanelsizing/

 

I hope this helps.  Happy holidays!

Amanda B.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(4,322 Views)

Thanks for the reply.  But I was already aware of the sizing functionality as I have programmed it for Windows.  What I wanted to know was how to retrieve the panel side that was being resized in Linux - as in PANEL_SIZING_TOPLEFT, PANEL_SIZING_TOP, PANEL_SIZING_BOTTOM, PANEL_SIZING_BOTTOM_RIGHT, etc.  The "PANEL_SIZING_---" flags are only available from an EVENT_PANEL_SIZING - NOT an EVENT_PANEL_SIZE (which arrives in Linux in lieu of EVENT_PANEL_SIZING) - that is the problem!

 

I have done it, but it isn't the most streamlined thing in my opinion.  To determine the panel side being dragged I maintain the panel's Rect state (the entire window including window manager decorations and titlebar): top, left, width and height.  Without going into detail about how to get the sizing information the following is done:

 

  • Every time EVENT_GOT_FOCUS ocurrs the Rect state is updated
  • When an EVENT_PANEL_SIZE ocurrs in Linux I can determine the side being dragged by comparing the prior Rect state to the current state:
    • If previous top and previous left are same as current top and current left:
      • If previous width and previous height are different than current width and current height then we know the bottom right corner is being dragged so I can issue my own PANEL_SIZING_BOTTOMRIGHT
      • If previous width and current width are same but previous height and current height are different then we know that the bottom edge is being dragged so I can issue my own PANEL_SIZING_BOTTOM
      • Otherwise the only possibility now is PANEL_SIZING_RIGHT
  • Etc.

For readers of this who are dealing with Linux it is good to note this post as well.  Sometimes it is necessary to access the lower level X functions to get things done in Linux.

0 Kudos
Message 4 of 4
(4,269 Views)