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 7566527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:26:16+00:00 2026-05-30T14:26:16+00:00

I am looking for a way in which wxPython GUI elements can be added

  • 0

I am looking for a way in which wxPython GUI elements can be added into pygame. If there is an alternative to solve the purpose of adding GUI elements to a pygame please suggest so. I am having problem in installing PGU.Thanks for help.

  • 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-05-30T14:26:18+00:00Added an answer on May 30, 2026 at 2:26 pm

    Nope; you CAN add wxWidgets to PyGame. It’s trivial to add open/save dialogs, buttons, etc. Sometimes it gets nasty when you try to share areas, (as above, there’s conflicting window systems), but it is definitely doable.

    I wrote the following years ago, so it’s messy; but at least it’s simple. It should help you get started:

    class SDLThread:
        def __init__(self,screen):
            self.m_bKeepGoing = self.m_bRunning = False
            self.screen = screen
            self.color = (255,0,0)
            self.rect = (10,10,100,100)
        def Start(self):
            self.m_bKeepGoing = self.m_bRunning = True
            thread.start_new_thread(self.Run, ())
        def Stop(self):
            self.m_bKeepGoing = False
        def IsRunning(self):
            return self.m_bRunning
        def Run(self):
            while self.m_bKeepGoing:
                pass
    ##            GetInput()
    ##            Draw()
            self.m_bRunning = False;
    class SDLPanel(wx.Panel):
        def __init__(self,parent,ID,tplSize):
            global pygame
            wx.Panel.__init__(self, parent, ID, size=tplSize)
            self.Fit()
            os.environ['SDL_WINDOWID'] = str(self.GetHandle())
            os.environ['SDL_VIDEODRIVER'] = 'windib'
            import pygame
            pygame.init()
            icon = pygame.Surface((1,1));icon.set_alpha(0);pygame.display.set_icon(icon)
            global Surface
            Surface = pygame.display.set_mode(tplSize)
            self.thread = SDLThread(Surface)
            self.thread.Start()
        def __del__(self):
            self.thread.Stop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a way with C# which I can serialize a class into
I am looking for a way by which I can automate my application build
I was looking for a way in php which can replace a string like
I am looking for a way in which I can grab an element id
I'm looking for a way to control which monitors are currently being used via
I'm looking for a way to monitor which processes are using (or attempting to
I'm looking for a way to delete a file which is locked by another
I am looking for a way to determine for a thread on which other
I'm looking for a way to add an EventListener which will automatically removes itself
I'm looking for a way to overwrite for example the dialog which pops up

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.