wxpython

Defining a wx.Panel destructor in wxpython

Defining a wx.Panel destructor in wxpython Question: How do you define a destructor for a wx.Panel in wxpython? META: After inheriting a code base which uses wxpython and PyPubSub I’ve discovered a huge number of pubsub subscriptions in the __init__ functions of wx.Panel‘s that are never unsubscribed and cause errors later on in the program. …

Total answers: 2

How to change font for entire wxPython application

How to change font for entire wxPython application Question: I have a wxPython application (using 2.8), built with python 2.7. Is there a way to change the font for the whole application ? I mean, I would like to change font for any wx.StaticText, wx.Button, wx.Combo for every widget that shows “text”. Do I need …

Total answers: 2

Embedding a Pygame window into a Tkinter or WxPython frame

Embedding a Pygame window into a Tkinter or WxPython frame Question: A friend and I are making a game in pygame. We would like to have a pygame window embedded into a tkinter or WxPython frame, so that we can include text input, buttons, and dropdown menus that are supported by WX or Tkinter. I …

Total answers: 4

How to use wxPython.Choice in a wxPython.Dialog?

How to use wxPython.Choice in a wxPython.Dialog? Question: I am trying to visualize an image in a dialog, and a droplist besides it to show some options. Here is my code (everything is within a class that defined by me): “”” Create main App “”” self._app = wx.App() “”” Load image “”” png = wx.Image(‘show_work.png’, …

Total answers: 1

Retrieve XY data from matplotlib figure

Retrieve XY data from matplotlib figure Question: I’m writing a little app in wxPython which has a matplotlib figure (using the wxagg backend) panel. I’d like to add the ability for the user to export X,Y data of what is currently plotted in the figure to a text file. Is there a non-invasive way to …

Total answers: 1

How to stop a looping thread in Python?

How to stop a looping thread in Python? Question: What’s the proper way to tell a looping thread to stop looping? I have a fairly simple program that pings a specified host in a separate threading.Thread class. In this class it sleeps 60 seconds, the runs again until the application quits. I’d like to implement …

Total answers: 8

change the colorbar width

change the colorbar width Question: I have created this, as you can see the colorbar is very thin, is there anyway of increasing the width of the colorbar without increasing the height Asked By: John Smith || Source Answers: You need to get hold of the axes of the colorbar. Assuming you hold a reference …

Total answers: 2

Set colour to wx.listbox item

Set colour to wx.listbox item Question: Wxpython provides the following api to change wx.listbox items colour: wx.ListBox.SetItemBackgroundColour(self, item, c) and wx.ListBox.SetItemForegroundColour(self, item, c) For some reason this functions fail to do so in my linux and windows. Any one know why? note that wx.ListBox.SetOwnBackgroundColor works perfectly. Asked By: Jah || Source Answers: My guess is …

Total answers: 2

Embedding a matplotlib figure inside a WxPython panel

Embedding a matplotlib figure inside a WxPython panel Question: How do I embed a matplotlib figure object inside a WxPython panel? I googled around and saw complicated examples involving interactive graphics and other extra stuff. Can anybody help with a minimal example? Asked By: Jesvin Jose || Source Answers: This is a minimal example for …

Total answers: 2

What is the difference between Python vs Jython vs IronPython vs wxPython?

What is the difference between Python vs Jython vs IronPython vs wxPython? Question: I am quite new in Python programming. While googling I found some of the Python related words. I just wanted to know what is the difference among Python, Jython, IronPython, and wxPython. I know wxPython is for GUI programming. But what are …

Total answers: 1