Page 1 of 1

Notify on window resize?

Posted: Sun Jan 13, 2019 9:27 pm
by lazi
Good evening Gentlemans!

Can't find the way to get notified when a RapaGUI window is resized by the user.
There are Hollywood displays that should be redrawn after window resize.

Is it possible somehow?

The same question is applicable to MUIRoyale too.

Thanks!

Re: Notify on window resize?

Posted: Wed Jan 16, 2019 10:36 pm
by airsoftsoftwair
If there's a Hollywood display embedded in your GUI, you just have to listen to the normal "SizeWindow" event for the Hollywood display and then you should be notified about size changes :)

Re: Notify on window resize?

Posted: Wed Jan 16, 2019 11:22 pm
by lazi
Nice, thanks!

Re: Notify on window resize?

Posted: Thu Jan 17, 2019 6:17 pm
by jPV
airsoftsoftwair wrote: Wed Jan 16, 2019 10:36 pm If there's a Hollywood display embedded in your GUI, you just have to listen to the normal "SizeWindow" event for the Hollywood display and then you should be notified about size changes :)
And if there isn't a Hollywood display, any way then? I just recently wanted to scale an MUI (Royale) image if window size changes, but didn't find a way to notice it yet...

Re: Notify on window resize?

Posted: Sat Jan 19, 2019 5:33 pm
by airsoftsoftwair
Without a Hollywood display there's currently no way to get notified when a window is resized. I'll see if I can add this for the future.

Re: Notify on window resize?

Posted: Tue Jan 22, 2019 6:50 pm
by r-tea
jPV wrote: Thu Jan 17, 2019 6:17 pm And if there isn't a Hollywood display, any way then?
Maybe embed a "fake" Hollywood display? For example 1x1 ttransparent area.

Re: Notify on window resize?

Posted: Wed Jan 23, 2019 4:23 pm
by sinisrus
My solution for this :

Code: Select all


Function p_Move()

    IF (mui.get("win","Width")<>FlagWinWidth$) OR (mui.get("win","Height")<>FlagWinHeight$)
    FlagWinWidth$=mui.get("winbase","Width")
    FlagWinHeight$=mui.get("winbase","Height")

    DebugPrint("Change Size Window")
    EndIF

Endfunction

IntervalDessin=SetInterval(NIL, p_Move, 1000/200) ; 100fps

Re: Notify on window resize?

Posted: Fri Jan 25, 2019 9:34 am
by sinisrus
small error > "win" = "winbase"

Re: Notify on window resize?

Posted: Sun Aug 16, 2020 8:36 pm
by airsoftsoftwair

Code: Select all

- New: Added Window.SizeChange [N] attribute; this allows you to listen to window size changes; whenever
  the event callback is triggered, the "Width" and "Height" member fields will contain the new window size