..... that must have changed Peter because the following code results in the window fitting my smartphone screen precisely?
Code: Select all
EnableExplicit
CloseDebugOutput()
ExamineDesktops()
#Desktop = 0
Enumeration
#Win
#Btn1
#Btn2
#Btn3
#BtnExit
#Scroll
#Msg
#Txt
EndEnumeration
Global igAvailW.i, igAvailH.i, igWinH.i, igWinW.i
;!igAvailW = window.screen.availWidth
;!igAvailH = window.screen.availHeight
;!igWinW = window.screen.width
;!igWinH = window.screen.height
igWinW = DesktopWidth(#Desktop)
igWinH = DesktopHeight(#Desktop)
;Debug igAvailW
;Debug igAvailH
;Debug igWinW
;Debug igWinH
Procedure CloseWindowEvent()
;#---------------------------
CloseWindow(EventWindow()) ; Close the specific window
EndProcedure
Procedure MyGadgetEvent()
;#------------------------
SetGadgetText(#Msg, "Button" + Str(EventGadget()) + " pressed!")
EndProcedure
If OpenWindow(#Win, 0, 0, igWinW, igWinH, "", #PB_Window_BorderLess|#PB_Window_ScreenCentered)
ScrollAreaGadget(#Scroll, 0, 0, igWinW, igWinH, 1920, 1080, 40)
ButtonGadget(#Btn1, 10, 10, 255, 38,"Button 1")
ButtonGadget(#Btn2, 10, 50, 255, 38,"Button 2")
ButtonGadget(#Btn3, 10, 90, 255, 38,"Button 3")
ButtonGadget(#BtnExit, 10, 130, 255, 38,"Exit")
TextGadget(#Msg, 10, 180, 255, 26, "", #PB_Text_Center | #PB_Text_Border)
TextGadget(#Txt, 200, 210, 230, 26, "Scroll to see all of the Text Here", #PB_Text_Right | #PB_Text_Border)
BindEvent(#PB_Event_Gadget, @MyGadgetEvent(), #Win, #Btn1)
BindEvent(#PB_Event_Gadget, @MyGadgetEvent(), #Win, #Btn2)
BindEvent(#PB_Event_Gadget, @MyGadgetEvent(), #Win, #Btn3)
BindEvent(#PB_Event_Gadget, @CloseWindowEvent(), #Win, #BtnExit)
CloseGadgetList()
EndIf