Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:49:11+00:00 2026-06-09T06:49:11+00:00

I was wondering if anyone knows a way to program flashing text into wxPython?

  • 0

I was wondering if anyone knows a way to program flashing text into wxPython? (I am fairly new to wxPython)
It would flash between red and normal every half second or so, I am using Python 2.7.3, not the most recent release.

Thanks

Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:49:12+00:00Added an answer on June 9, 2026 at 6:49 am

    You’ll want to look at how to change fonts on the fly. Typically, it’s just calling the widget’s SetFont() method. Since you want to do this on a regular basis, then you’ll almost certainly want to use a wx.Timer. You can read my tutorial on that subject, if you want. I would probably use the StaticText widget.

    Update: Here’s a silly example:

    import random
    import time
    import wx
    
    ########################################################################
    class MyPanel(wx.Panel):
        """"""
    
        #----------------------------------------------------------------------
        def __init__(self, parent):
            """Constructor"""
            wx.Panel.__init__(self, parent)
    
            self.font = wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)
            self.flashingText = wx.StaticText(self, label="I flash a LOT!")
            self.flashingText.SetFont(self.font)
    
            self.timer = wx.Timer(self)
            self.Bind(wx.EVT_TIMER, self.update, self.timer)
            self.timer.Start(1000)
    
        #----------------------------------------------------------------------
        def update(self, event):
            """"""
            now = int(time.time())
            mod = now % 2
            print now
            print mod
            if mod:
                self.flashingText.SetLabel("Current time: %i" % now)
            else:
                self.flashingText.SetLabel("Oops! It's mod zero time!")
            colors = ["blue", "green", "red", "yellow"]
            self.flashingText.SetForegroundColour(random.choice(colors))
    
    ########################################################################
    class MyFrame(wx.Frame):
        """"""
    
        #----------------------------------------------------------------------
        def __init__(self):
            """Constructor"""
            wx.Frame.__init__(self, None, title="Flashing text!")
            panel = MyPanel(self)
            self.Show()
    
    #----------------------------------------------------------------------
    if __name__ == "__main__":
        app = wx.App(False)
        frame = MyFrame()
        app.MainLoop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering if anyone knows a nice way to execute a Java command-line program from
I was wondering if anyone knows a way to prevent building unneeded device drivers
I was wondering if anyone knows an easy way to do this. I have
Just wondering whether anyone knows how to get blogger labels into alt tags in
Hi i was wondering if anyone knows how i can calculate the difference between
I was wondering if anyone knows of a way to remove the application title
I am wondering if anyone knows how to toggle between full screen and normal
I'm wondering if anyone knows a way that you can prevent browser zooming of
Just wondering if anyone knows of a way that wiring up jquery to run
Just wondering if anyone knows a neater way of doing the following without creating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.