color

Just starting out? Need help? Post your questions and find answers here.
t57042
Enthusiast
Enthusiast
Posts: 203
Joined: Fri Feb 22, 2008 12:28 pm
Location: Belgium

color

Post by t57042 »

probably stupid, but i don't see why the colors don't change

Code: Select all

OpenWindow(0,0,0,890,700,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)

        LoadFont(2, "tahoma", 40,#PB_Font_Bold|#PB_Font_Italic )          
    TextGadget(990, 100, 200, 700,500, "LAURIE ",#PB_Text_Center)
    SetGadgetFont(990, FontID(2)) 
    SetGadgetColor(990, #PB_Gadget_BackColor,$00ff00)
    SetGadgetColor(990, #PB_Gadget_FrontColor, $FF0000)
    
   Delay(1000)
   
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: color

Post by Keya »

because you're not allowing the main message loop to process GUI messages (because you haven't provided one) :)
simply replace Delay with an event processing loop such as:

Code: Select all

 Repeat
      Event = WaitWindowEvent()
 Until Event = #PB_Event_CloseWindow
User avatar
TI-994A
Addict
Addict
Posts: 2700
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: color

Post by TI-994A »

Keya's right. Try it like this:

Code: Select all

OpenWindow(0, 0, 0, 890, 700, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)

LoadFont(2, "tahoma", 40, #PB_Font_Bold | #PB_Font_Italic)          
TextGadget(990, 100, 200, 700, 500, "LAURIE ", #PB_Text_Center)
SetGadgetFont(990, FontID(2)) 
SetGadgetColor(990, #PB_Gadget_BackColor, $00ff00)
SetGadgetColor(990, #PB_Gadget_FrontColor, $FF0000)

While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply