Notify on window resize?

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Notify on window resize?

Post 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!
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Notify on window resize?

Post 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 :)
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: Notify on window resize?

Post by lazi »

Nice, thanks!
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Notify on window resize?

Post 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...
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Notify on window resize?

Post 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.
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: Notify on window resize?

Post 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.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Notify on window resize?

Post 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
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Notify on window resize?

Post by sinisrus »

small error > "win" = "winbase"
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Notify on window resize?

Post 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
Post Reply