Simple TextGadget with centered Hal & Val text
Posted: Wed Sep 20, 2017 11:27 pm
- Any font size
- Single or Multi line
- Cross Platform (not tested
)
I have a feeling that I am not the first one
I like PB it has a lot of tools you can craft with it almost any thing
- Single or Multi line
- Cross Platform (not tested

I have a feeling that I am not the first one

I like PB it has a lot of tools you can craft with it almost any thing
Code: Select all
LoadFont(0,"Tahoma",14)
If OpenWindow(0, 0, 0, 270, 160, "TextGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ContainerGadget(0,10,10,250,100,#PB_Container_Flat)
TextGadget(1, 0, 0, 250, 60, "TextGadget Center"+#CRLF$+"Second Line", #PB_Text_Center)
CloseGadgetList()
HideGadget(0,1)
SetGadgetFont(1,FontID(0))
SetGadgetColor( 0,#PB_Gadget_BackColor,$D0FEFE)
SetGadgetColor( 1,#PB_Gadget_BackColor,$D0FEFE)
SetGadgetColor( 1,#PB_Gadget_FrontColor,$2128FE)
th = GadgetHeight(1,#PB_Gadget_RequiredSize)
dth = GadgetHeight(0)/2 - th/2
ResizeGadget(1,0,dth,250,th)
HideGadget(0,0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf