Page 2 of 2
Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Fri Apr 01, 2022 7:40 pm
by Psychophanta
RASHAD wrote: Fri Apr 01, 2022 6:35 pm
Hi Psychophanta
I hope that I just understood you correctly
After resize you can do what you want with the gadget
Code: Select all
Procedure SizeCB()
w = WindowWidth(0)
h = WindowHeight(0)
ResizeGadget(0,10,10,w-20,h-20)
EndProcedure
OpenWindow(0, 0, 0, 800,600, "test", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
ScrollAreaGadget(0, 10, 10, 780,580 , 2000,1500, 30)
;add some other gadgets...
CloseGadgetList()
BindEvent(#PB_Event_SizeWindow,@sizeCB())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_Resize ;The gadget has been resized.
SetGadgetAttribute(0, #PB_ScrollArea_X, 2000)
hpos = GetGadgetAttribute(0, #PB_ScrollArea_X)
SetGadgetAttribute(0, #PB_ScrollArea_Y, 1500)
vpos = GetGadgetAttribute(0, #PB_ScrollArea_Y)
SetGadgetAttribute(0, #PB_ScrollArea_X, hpos/2)
SetGadgetAttribute(0, #PB_ScrollArea_Y, vpos/2)
EndSelect
EndSelect
EndSelect
Until Quit = 1
Again: you did not understand a thing.
Please do not try again to make to loss my time. I even uploaded a video showing it, so i think it is enought.
Thank you.
Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Fri Apr 01, 2022 7:50 pm
by RASHAD
You are rude beside you did not understand what the event can do
RTFM carefully
Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Fri Apr 01, 2022 8:22 pm
by Psychophanta
Dear RASHAD.
Sorry my rudeness, but please try to watch the reason of it.
Again and again you are posting tips which have nothing to do with the issue

Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Fri Apr 01, 2022 11:42 pm
by breeze4me
The following event is supported through EventType():
#PB_EventType_Resize: The gadget has been resized.
The above explanation has the following meaning.
#PB_EventType_Resize: This event occurs when the gadget has been resized by using ResizeGadget() function.
And this does not mean that the gadget can be resized by dragging a specific part of it.
The points mentioned above apply to all gadgets of container type.
Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Sat Apr 02, 2022 5:33 pm
by Psychophanta
breeze4me wrote: Fri Apr 01, 2022 11:42 pm
The following event is supported through EventType():
#PB_EventType_Resize: The gadget has been resized.
The above explanation has the following meaning.
#PB_EventType_Resize: This event occurs when the gadget has been resized by using ResizeGadget() function.
And this does not mean that the gadget can be resized by dragging a specific part of it.
The points mentioned above apply to all gadgets of container type.
Nope, dear.
The above explanation has NOT that meaning.

Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Sun Apr 03, 2022 11:16 am
by mk-soft
I don't see any code example from you and ...
You cannot change the size of the ScrollAreaGadget with the mouse. The size of the ScrollAreaGadget can only be changed with ResizeGadget(...). This must be done in the event #PB_Event_SizeWindow. (So like in my example)
Re: Resize Windows and make scrollbar appear ? [Solved]
Posted: Mon Apr 04, 2022 8:11 am
by Psychophanta
mk-soft wrote: Sun Apr 03, 2022 11:16 am
You cannot change the size of the ScrollAreaGadget with the mouse.
That's all Folks
