wxpython

wxpython: How do I examine dragged data in OnDragOver?

I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions pertains to drag and drop in other GUI frameworks as well). The frameworks provides a couple of callbacks (OnEnter and OnDragOver) that purportedly allow me to inform the system whether the current mouse position is a valid place to drop whatever it is that is b...

Hide directories in wxGenericDirCtrl

I am using a wxGenericDirCtrl, and I would like to know if there is a way to hide directories, I'd especially like to hide siblings of parent nodes. For example if my directory structure looks like this: +-a | +-b | | | +-whatever | +-c | | | +-d | | | +-e | | | +-f | +-g | +-whatever If...

Python-passing variable between classes

I'm trying to create a character generation wizard for a game. In one class I calculate the attributes of the character. In a different class, I'm displaying to the user which specialties are available based on the attributes of the character. However, I can't remember how to pass variables between different classes. Here is an example ...

Dynamic radio button creation

In wxPython, if I create a list of radio buttons and place the list initially, is it possible to change the contents in that list later? For example, I have a panel that uses a boxSizer to place the widgets initially. One of those widgets is a list of radio buttons (I have also tried a normal radiobox). I would like to dynamically chang...

how to set a menubar icon on mac osx using wx

I could not find any pointers on how to create a menubar icon on OSX using wx. I originally thought that the wxTaskBarIcon class would do, but it actually creates an icon on the Dock. On Windows, wxTaskBarIcon creates a Systray icon and associated menu, and I would think that on mac osx it would create a menubar icon, I guess not. ...

Keeping GUIs responsive during long-running tasks

Hello, Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming. Here's a good discussion of how to do this in wxPython. To summarize, there are 3 ways: Use threads Use wxYield Chunk the work and do it in the IDLE event handler Which method have you found ...

Is there any Visual Library alternative to wxPython that supports CSS/Style Sheets?

Hi. I've developed a program that extensively uses wxPython - the wxWindow port for python. Even though it is as mature library it is still very primitive and very programming oriented. Which is time consuming and not flexible at all. I would love to see if there is something like Flex/Action Script where all the visual dimensions ar...

Python GUI Application redistribution

I need to develop a small-medium sized desktop GUI application, preferably with Python as a language of choice because of time constraints. What GUI library choices do I have which allow me to redistribute my application standalone, assuming that the users don't have a working Python installation and obviously don't have the GUI librari...

How do I get the scroll position / range from a wx.TextCtrl control in wxPython

I have a little logging app (written in wxPython) that receives data from a bit of kit we're developing, and I want to display the text in a scrolling window. As it stands I'm using a wx.TextCtrl for the text display, but I'm having some issues with the scrolling behaviour. Basically, I'd like it so that if the scrollbar is at the botto...

Is it worthwhile to write a programming tutorial book?

I have written an introductory Python tutorial and I'm working on one for wxPython. My Python tutorial was used at a college for a programming introduction class. I know the answer is probably "if you want to", but I'm curious to know if I should take the time to formalize my tutorials into a book format, most likely as an ebook. I don'...

What to include in a beginner's programming book?

As a follow-up to my previous question, what sort of information should I make sure to include in a tutorial book and what should I avoid? In other words, what would you have liked to have known when first starting with Python or wxPython? Right now I am just planning on restructing the tutorials I have already created and other editing...

Applying a common font scheme to multiple objects in wxPython

Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a SetFont() call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and wxPython In Action book don't discuss this. Is there a way to easily apply the same SetFont() method to all...

Is it possible to pass arguments into event bindings?

I haven't found an answer elsewhere and this doesn't appear to have been asked yet on SO. When creating an event binding in wxPython, is it possible to pass additional arguments to the event? For example, this is the normal way: b = wx.Button(self, 10, "Default Button", (20, 20)) self.Bind(wx.EVT_BUTTON, self.OnClick, b) def On...

Where can I find a good tutorial for py2exe?

Can somebody point me at a good tutorial for py2exe? I've read over the official tutorial but it is rather light on details, compared to all the options one can use when building an executable out of a python script. For the record, my python script uses Python 2.5.2, wxPython/wxWidgets 2.8 and MySQLdb 1.2.2; so if you have specific ti...

wxPython: displaying multiple widgets in same frame

I would like to be able to display Notebook and a TxtCtrl wx widgets in a single frame. Below is an example adapted from the wxpython wiki; is it possible to change their layout (maybe with something like wx.SplitterWindow) to display the text box below the Notebook in the same frame? import wx import wx.lib.sheet as sheet class MyShe...

How to check if OS is Vista in Python?

How, in the simplest possible way, distinguish between Windows XP and Windows Vista, using Python and pywin32 or wxPython? Essentially, I need a function that called will return True iff current OS is Vista: >>> isWindowsVista() True ...

Efficient Image Thumbnail Control for Python?

What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently visible to user. ...

wxpython - Expand list control vertically not horizontally

I have a ListCtrl that displays a list of items for the user to select. This works fine except that when the ctrl is not large enough to show all the items, I want it to expand downwards with a vertical scoll bar rather than using a horizontal scroll bar as it expands to the right. The ListCtrl's creation: self.subjectList = wx.ListCtr...

Alternatives to a wizard

I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game. However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at the same time, I can't have the...

Formatting dict.items() for wxPython

I have a text box in wxPython that takes the output of dictionary.items() and displays it to the user as items are added to the dictionary. However, the raw data is very ugly, looking like [(u'BC',45) (u'CHM',25) (u'CPM',30)] I know dictionary.items() is a list of tuples, but I can't seem to figure out how to make a nice format that ...