wxpython

wxPython wxDC object from win32gui.GetDC

I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int/long. I need to blit this DC into a memory DC in python. The only thing I can't figure out how to do is get a wxDC derived object from the int/long that win32gui returns. None of the wxDC objects allow me to pass an actual D...

How do I safely decode a degrees symbol in a wxPython app?

I have a debug app I've been writing which receives data from a C-based process via UDP. One of the strings sent to me contains a '°' character - http://en.wikipedia.org/wiki/Degree_symbol">Unicode U+00B0 (which incidentally breaks the StackOverflow search function!). When my wxPython application tries to append that string to a text box...

How to insert a copyright statement into files created by wxGlade?

I use wxGlade to create Python scripts, which use wxWidgets. wxGlade directly manipulates XML files, which describe the wxWidgets based GUI. Those files have the *.wxg extension. From the *.wxg files, it is possible to generate code which actually runs the GUI in one of several languages, and I am using it to generate Python code. I wo...

How do I Create an instance of a class in another class in Python

I am trying to learn Python and WxPython. I have been a SAS programmer for years. This OOP stuff is slowly coming together but I am still fuzzy on a lot of the concepts. Below is a section of code. I am trying to use a button click to create an instance of another class. Specifically-I have my main panel in one class and I wanted to...

When is "self" required?

I have been using classes for only a short while and when I write a method, I make all variables reference self, e.g. self.foo. However, I'm looking through the wxPython in Action book and notice that "self" isn't used all the time. For example: import wx class TextFrame(wx.Frame): def __init__(self): wx.Frame.__init__(se...

Is it possible to use wxPython inside IronPython?

When my IronPython program gets to the line import wx I get this message: A first chance exception of type 'IronPython.Runtime.Exceptions.PythonImportErrorException' occurred in IronPython.dll Additional information: No module named _core_ although I do have the file wx\_core_.pyd. Also, before attempting the import, I have the ...

Tabs in Tkinter

Having played around a little with both Tkinter and wxPython, I like Tkinter much better in terms of how clean my source code looks. However, it doesn't seem to have as many features; in particular it doesn't have tabs (as in, the tabs at the top of a Firefox window). A little Googling on the subject offers a few suggestions. There's ...

WX Python and Raw Input on Windows (WM_INPUT)

Does anyone know how to use the Raw Input facility on Windows from a WX Python application? What I need to do is be able to differentiate the input from multiple keyboards. So if there is another way to achieving that, that would work too. ...

wxPython, Set value of StaticText()

Hi Guys, I am making a little GUI frontend for a app at the moment using wxPython. I am using wx.StaticText() to create a place to hold some text, code below: content = wx.StaticText(panel, -1, "Text Here", style=wx.ALIGN_CENTRE) I have a button when clicked retrieves data from MySQL, I am wanting to change the value of the StaticTe...

Is it possible to bind an event against a menu instead of a menu item in wxPython?

Nothing to add ...

How do I disable PythonWin's “Redirecting output to win32trace remote collector” feature without uninstalling PythonWin?

When I run a wxPython application, it prints the string Redirecting output to win32trace remote collectorand I must open PythonWin's trace collector tool to view that trace output. Since I'm not interested in collecting this output, how should I disable this feature? ...

How do you compile wxPython under cygwin?

I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin? ...

"import wx" fails after installation of wxPython on Windows XP

I downloaded and installed this version of wxPython for use with my Python 2.6 installation: http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.9.1-py26.exe When I run Python and try to import wx, I get the following error: C:\Program Files\Console2>python Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 ...

py2exe fails to generate an executable

I am using python 2.6 on XP. I have just installed py2exe, and I can successfully create a simple hello.exe from a hello.py. However, when I try using py2exe on my real program, py2exe produces a few information messages but fails to generate anything in the dist folder. My setup.py looks like this: from distutils.core import setup i...

wxpython: Updating a dict or other appropriate data type from wx.lib.sheet.CSheet object

If I have a notebook with three spreadsheet widgets, what is the best way to have changes to the spreadsheet update a dictionary (or maybe an sqlite file?). Do all wx grid objects come with a built in dictionary related to the SetNumberRows and SetNumberCols? Basically I am looking for guidance on how to work with the user-input data f...

Setting the width of a wxPython TextCtrl in number of characters

I have a TextCtrl in my wxPython program and I'd like to set its width to exactly 3 characters. However, the only way to set its size manually accepts only numbers of pixels. Is there any way to specify characters instead of pixels? ...

What can Pygame do in terms of graphics that wxPython can't ?

Hello, I want to develop a very simple 2D game in Python. Pygame is the most popular library for game development in Python, but I'm already quite familiar with wxPython and feel comfortable using it. I've even written a Tetris clone in it, and it was pretty smooth. I wonder, what does Pygame offer in terms of graphics (leaving sound a...

Python - No handlers could be found for logger "OpenGL.error"

Okay, what is it, and why does it occur on Win2003 server, but not on WinXP. It doesn't seem to affect my application at all, but I get this error message when I close the application. And it's annoying (as errors messages should be). I am using pyOpenGl and wxPython to do the graphics stuff. Unfortunately, I'm a C# programmer that h...

Can I use chart modules with wxpython?

Is it possible to use any chart modules with wxpython? And are there any good ones out there? I'm thinking of the likes of PyCha (http://www.lorenzogil.com/projects/pycha/) or any equivalent. Many modules seem to require PyCairo, but I can't figure out if I can use those with my wxpython app. My app has a notebook pane, and I'd like to...

Equivalent of an HTML multiple SELECT box in wxPython

I'd like to create a ListBox in wxPython with the same semantics as a multiple select box in HTML. Specifically I'd like the following semantics When the user clicks on an entry in the list, all other entries become de-selected and the clicked entry becomes selected. If the entry was already selected then it stays selected. Wh...