[Gambas-user] window resize help

gian bagoneo at libero.it
Tue Dec 20 14:40:14 CET 2022

Il 19/12/22 17:10, Bruce Steers ha scritto:
> Hey all.
> I wrote a routine to resize a window without a titlebar/border
> it tracks the mouse and makes the mouse image change okay (needs a 
> better way to set it back to normal though)
> Something is not correct though with moving the Left or Top edge and I 
> can't get my head around it.
> it seems to be jumpy setting the width or height when moving the left 
> edge top, the opposite edge moves a bit and it shouldn't :(
> I tried a few methods but still the left/top edge is glitchy :(
> i've attached 2 versions
> 1.0.1 just uses Me.Move a lot
> 1.0.2 better uses Rect and i've tried to use Mouse.ScreenX not mouse 
> StartX method.
> both glitch about the same.
> Anyone got a better, more robust method for window resizing via left/top 
> edge?
> Cheers
> BruceS


I don't know if this will help your problem, but when I tried to find 
the exact height of the window menus so that I could show a popup window 
(instead of the menu) I had noticed that the top position of the window 
minus the border differed depending on the libraries.

For example:

   For Each h As Component In Components
     If h.Name Like "gb.qt*" Then
       $iMenuH = hFont.TextHeight(sMenu) + Style.BoxFrameHeight
     Else If h.Name Like "gb.gtk*" Then
       $iMenuH = hFont.TextHeight(sMenu) + (Style.BoxFrameHeight * 2)

So the popup for QT libraries had to start slightly lower than for GTK

Something similar I had done for the left side again with the help of 
Style but I couldn't find the latest version of my test and the old ones 
didn't work right, sorry :-(

Maybe Benoit could clarify things :-)



More information about the User mailing list