WindowY why only with his work, Delay()?

Linux specific forum
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

WindowY why only with his work, Delay()?

Post by mestnyi »

Code: Select all

ProcedureDLL WindowBorder(Window)
  ;Delay(30) ;
  Protected BorderX = WindowX(Window,#PB_Window_InnerCoordinate) - WindowX(Window,#PB_Window_FrameCoordinate)
  Protected InnerY = WindowY(Window,#PB_Window_InnerCoordinate) 
  Protected FrameY = WindowY(Window,#PB_Window_FrameCoordinate)
  Protected BorderY = InnerY - FrameY
  SetGadgetText(1, "#PB_Window_InnerCoordinate "+InnerY + #CRLF$ + "#PB_Window_FrameCoordinate "+FrameY + #CRLF$ + "BorderY "+BorderY) 
EndProcedure

CompilerIf (#PB_Compiler_IsMainFile)
  Procedure Window(Flag)
    OpenWindow(1,0,0,400,200,"",#PB_Window_ScreenCentered|Flag) :StickyWindow(1,#True)
    ButtonGadget(5,5,150,190,24,"#PB_Window_MaximizeGadget") :SetGadgetData(5,#PB_Window_MaximizeGadget)
    ButtonGadget(15,200,150,190,24,"#PB_Window_MinimizeGadget") :SetGadgetData(15,#PB_Window_MinimizeGadget)
    
    TextGadget(1,5,5,WindowWidth(1)-10,84,"")
    WindowBorder(1)
  EndProcedure
  
  Window(#PB_Window_SystemMenu)
  
  Repeat 
    Event = WaitWindowEvent()
    If Event = #PB_Event_Gadget 
      If EventGadget() = 5
        Window(GetGadgetData(5))
      ElseIf EventGadget() = 15
        Window(GetGadgetData(15))
      EndIf 
    EndIf 
  Until Event = #PB_Event_CloseWindow
CompilerEndIf

mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: WindowY why only with his work, Delay()?

Post by mestnyi »

why WindowY () returns a different value each time?
somebody tell me ? :evil:
If you call delay () before WindowY () is all okay . :x
Post Reply