Page 1 of 1

Posted: Sun May 19, 2002 5:54 pm
by BackupUser
Restored from previous forum. Originally posted by merendo.

Hi all

I have a window with the #PB_SizeGadget and now I want the gadgets in the window to resize when the user sizes the window. Here is a code snippet, but it doesn´t work.

Code: Select all

if waitwindowevent = #PB_EventSizeWindow
resizegadget(0,8,8,windowwidth()-24,windowheight()-33) ; 0 is a panelgadget
endif
Thanks for any help, merendo

We always need to hear both sides of the story (by Phil Collins)

Posted: Sun May 19, 2002 7:49 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

I guess you have these lines in your code?:

Code: Select all

Repeat
waitwindowevent = WaitWindowEvent()
...
Until waitwindowevent = #PB_CloseWindow
Bye,

El_Choni

Edited by - El_Choni on 19 May 2002 20:50:04

Posted: Sun May 19, 2002 8:51 pm
by BackupUser
Restored from previous forum. Originally posted by merendo.

Almost. I have:

Code: Select all

repeat
  event = waitwindowevent()
  
    if event = #PB_EventSizeWindow
      resizegadget(0,8,8,windowwidth()-24,windowheight()-33) ; 0 is a panelgadget
    endif
  
  if event = #PB_EventCloseWindow : endvari = 1 : endif
until endvari
We always need to hear both sides of the story (by Phil Collins)