XY Spliter

Just starting out? Need help? Post your questions and find answers here.
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

XY Spliter

Post by rndrei »

How to find out the current position of the XY Spliter (#SPG)?

Code: Select all

  SplitterGadget(#spg ,10,10,100,100,#panel_1,#panel_2 )
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: XY Spliter

Post by BarryG »

Read the manual -> https://www.purebasic.com/documentation ... adget.html

It's good to ask questions when you're stuck, but man, you aren't even trying.
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: XY Spliter

Post by Quin »

I agree, give the PB manual a good, long read. Even if you don't read all of it, it'll let you learn how its structure works, how to navigate it, and where all the info you want is located. There are some pieces of info that are hidden really well, like the compiler functions such as SizeOf and CopyStructure(), but this is right there.
User avatar
mk-soft
Always Here
Always Here
Posts: 6246
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: XY Spliter

Post by mk-soft »

Press F1

Code: Select all

If OpenWindow(0, 0, 0, 230, 180, "SplitterGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  #Button1  = 0
  #Button2  = 1
  #Splitter = 2
  
  ButtonGadget(#Button1, 0, 0, 0, 0, "Button 1") ; No need to specify size or coordinates
  ButtonGadget(#Button2, 0, 0, 0, 0, "Button 2") ; as they will be sized automatically
  SplitterGadget(#Splitter, 5, 5, 220, 120, #Button1, #Button2, #PB_Splitter_Separator)
  
  TextGadget(3, 10, 135, 210, 40, "Above GUI part shows two automatically resizing buttons inside the 220x120 SplitterGadget area.",#PB_Text_Center )
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Break
        
      Case #PB_Event_Gadget
        Select EventGadget()
          Case #Splitter
            Debug "Splitter Position: " + GetGadgetState(#Splitter)
            Debug "Button 1 Height: " + GadgetHeight(#Button1)
            Debug "Button 2 Height: " + GadgetHeight(#Button2)
        EndSelect
        
    EndSelect
  ForEver
  
EndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
HeX0R
Addict
Addict
Posts: 1204
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: XY Spliter

Post by HeX0R »

Don't feed the troll.
I'm slowly really wondering how long it takes until people see what I see...
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 153
Joined: Thu Dec 28, 2023 9:04 pm

Re: XY Spliter

Post by rndrei »

Hey, I know where to read the information, but if I ask, this does not mean that I'm not trying ...
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: XY Spliter

Post by Quin »

rndrei wrote: Wed Apr 16, 2025 2:59 am Hey, I know where to read the information, but if I ask, this does not mean that I'm not trying ...
Show us the code you're trying then. All you posted is the code to create the gadget.
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: XY Spliter

Post by BarryG »

rndrei wrote: Wed Apr 16, 2025 2:59 amHey, I know where to read the information, but if I ask, this does not mean that I'm not trying ...
You asked: "How to find out the current position of the XY Spliter"

But one of the first items in the manual for SplitterGadget says:

Image

That's why I said you weren't trying. :wink:
Fred
Administrator
Administrator
Posts: 18220
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: XY Spliter

Post by Fred »

@rndrei, if you don't do any effort for your future posting, i will remove them. The minimum to ask for help is to post at least a small working sample showing why it doesn't work as expected.
Post Reply