Page 1 of 1

Stringgadget is not working with Windowed Screen

Posted: Sat Dec 18, 2004 4:19 pm
by arie
Stringgadget is not working in combination with Windowed Screen.
Please help!

Posted: Sat Dec 18, 2004 5:22 pm
by GreenGiant
You'll need to post some code where its not working. It all seems fine to me, here's a quick example I made with both a stringgadget and a windowed screen and it seems to work fine.

Code: Select all

OpenWindow(0,0,0,400,400,#PB_Window_SystemMenu | #PB_Window_ScreenCentered,"Test")
InitSprite()
OpenWindowedScreen(WindowID(),5,5,390,355,0,0,0)
CreateGadgetList(WindowID())
  StringGadget(0,10,370,390,20,"This is working - change the text and see")
  string$=GetGadgetText(0)
  
Repeat
  Repeat
  
    ev=WindowEvent()
    
    Select ev
      Case #PB_Event_CloseWindow
        End
      Case #PB_Event_Gadget
        If EventGadgetID()=0
          string$=GetGadgetText(0)
        EndIf
    EndSelect
    
  Until ev=0
  
  ClearScreen(0,0,0)
    
  StartDrawing(ScreenOutput())
    Locate(Random(390-TextLength(string$)),Random(355))
    DrawingMode(1)
    FrontColor(Random(255),Random(255),Random(255))
    DrawText(string$)
  StopDrawing()
    
  FlipBuffers()
  Delay(15)
  
ForEver