flashing text for TextGadget?

Just starting out? Need help? Post your questions and find answers here.
smacker
User
User
Posts: 55
Joined: Thu Nov 06, 2014 7:18 pm

flashing text for TextGadget?

Post by smacker »

Is there an easy way with PB to flash the text of a TextGadget (or for any other gadget with text)?

for example;

Code: Select all

If OpenWindow(0, 0, 0, 270, 160, "flash text?", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    TextGadget(0, 10,  10, 250, 20, "want to flash this text")
    
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
how would I get the "want to flash this text" to flash for as long as I wished, including 'forever', at the rate I wish ?
The world and human nature was screwed up before I was born. It's not my fault and I'm just stuck with trying to deal with the mess left behind, so don't blame me.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4663
Joined: Sun Apr 12, 2009 6:27 am

Re: flashing text for TextGadget?

Post by RASHAD »

Hi

Code: Select all

If OpenWindow(0, 0, 0, 270, 160, "flash text?", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    TextGadget(0, 10,  10, 250, 24, " want to flash this text")
    
    ButtonGadget(1,10,120,60,24,"RUN")
    AddWindowTimer(0,125,500)
    bcolor = $AFFEFE
    fcolor = $050DFF
    Repeat
     Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Quit = 1
        
      Case #PB_Event_Timer
        If Run = 1
          bcolor = bcolor ! $FFFFFF
          fcolor = fcolor ! $FFFFFF
          SetGadgetColor(0,#PB_Gadget_BackColor,bcolor)
          SetGadgetColor(0,#PB_Gadget_FrontColor,fcolor)
        EndIf
      
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 1
            Run ! 1
            
        EndSelect
    EndSelect
  Until Quit = 1
      
  EndIf
Egypt my love
smacker
User
User
Posts: 55
Joined: Thu Nov 06, 2014 7:18 pm

Re: flashing text for TextGadget?

Post by smacker »

Thank you RASHAD :)
The world and human nature was screwed up before I was born. It's not my fault and I'm just stuck with trying to deal with the mess left behind, so don't blame me.
Post Reply