Posted: Sun Mar 23, 2003 6:45 am
Restored from previous forum. Originally posted by LJ.
Take the code below. Notice the erradict and generally unresponsiveness of the mouse. Sometimes the words "test image" are drawn on the first click, and sometimes not. Worse, try closing the window, sometimes the window closes on the first click, and sometimes it takes several. Anyone have any ideas?
OpenWindow(1, 0, 0, 796, 560, #PB_Window_SystemMenu, "Test")
CreateGadgetList(WindowID())
CreateImage(1, WindowWidth(), WindowHeight())
StartDrawing(ImageOutput())
Box(0, 0, WindowWidth(), WindowHeight(), $ff)
FrontColor(0, 0, 0)
DrawingMode(1)
DrawingFont(LoadFont(0, "Times New Roman", 16))
Locate(64, 32)
DrawText("Background image")
StopDrawing()
ImageGadget(1, 0, 0, WindowWidth(), WindowHeight(), UseImage(1))
ButtonGadget = ButtonGadget(0, 80, 64, 160, 128, "My Button")
LoadFont(0, "Times New Roman", 16)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
Select EventGadgetID()
Case 0
Gosub UpdateWindow
EndSelect
EndIf
Until WaitWindowEvent()=#PB_EventCloseWindow
End
UpdateWindow:
FreeGadget(0)
UseImage(1)
StartDrawing(ImageOutput())
Box(0, 0, WindowWidth(), WindowHeight(), $ff)
FrontColor(0, 0, 0)
DrawingMode(1)
DrawingFont(UseFont(0))
Locate(64, 32)
DrawText("Test image")
StopDrawing()
ButtonGadget = ButtonGadget(0, 80, 64, 160, 128, "My Button")
SetGadgetState(1, UseImage(1))
ActivateGadget(0)
Return
Take the code below. Notice the erradict and generally unresponsiveness of the mouse. Sometimes the words "test image" are drawn on the first click, and sometimes not. Worse, try closing the window, sometimes the window closes on the first click, and sometimes it takes several. Anyone have any ideas?
OpenWindow(1, 0, 0, 796, 560, #PB_Window_SystemMenu, "Test")
CreateGadgetList(WindowID())
CreateImage(1, WindowWidth(), WindowHeight())
StartDrawing(ImageOutput())
Box(0, 0, WindowWidth(), WindowHeight(), $ff)
FrontColor(0, 0, 0)
DrawingMode(1)
DrawingFont(LoadFont(0, "Times New Roman", 16))
Locate(64, 32)
DrawText("Background image")
StopDrawing()
ImageGadget(1, 0, 0, WindowWidth(), WindowHeight(), UseImage(1))
ButtonGadget = ButtonGadget(0, 80, 64, 160, 128, "My Button")
LoadFont(0, "Times New Roman", 16)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
Select EventGadgetID()
Case 0
Gosub UpdateWindow
EndSelect
EndIf
Until WaitWindowEvent()=#PB_EventCloseWindow
End
UpdateWindow:
FreeGadget(0)
UseImage(1)
StartDrawing(ImageOutput())
Box(0, 0, WindowWidth(), WindowHeight(), $ff)
FrontColor(0, 0, 0)
DrawingMode(1)
DrawingFont(UseFont(0))
Locate(64, 32)
DrawText("Test image")
StopDrawing()
ButtonGadget = ButtonGadget(0, 80, 64, 160, 128, "My Button")
SetGadgetState(1, UseImage(1))
ActivateGadget(0)
Return