resizing of gadgets

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

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