wxpython

wxPython: prevent taskbar menu from closing after clicking an item

I am using wxPython to create a taskbar menu. The menu contains some menu items (obviously). Now I would like to update/change some of these items when a particular item is clicked, while still displaying the menu. How can I prevent the taskbar menu from disappearing after clicking an item? The only method I've found that could be us...

WxPython: deriving wx.ListItem but wx.ListCtrl only returns old class

Hello people, I've got a small issue with derived classes, namely wx.ListItem with wx.ListCtrl. I succesfully derived wx.ListItem as a MediaItem, the code is not finished but you get the point: class MediaItem(wx.ListItem): def __init__ (self, fullname): wx.ListItem.__init__(self) self.fullname = fullname s...

List of all style parameters used in the wx.Frame style bitmask

Getting a listing of all wxPython events is possible using: import wx for x in dir(wx): if x.startswith('EVT_'): print x How do I get the list of all style parameters used in defining the wx.Frame style bitmask? ...

wxWidgets: How to catch left-click on wxListCtrl?

Hi all, I want to add checkboxes to a wxListCtrl, and this works fine except there doesn't appear to be an EVT_LIST_ITEM_CLICK or EVT_LIST_ITEM_LEFT_CLICK event to catch when the mouse is clicked on the item so the image can be toggled. There are events for right and middle click, just not left click - which means you have to middle or...

wxPython segmentation fault with Editors

I have created a wx.grid.Grid with a wx.grid.PyGridTableBase derived class to provide its data. I want to also to control the editors used on the table. Towards that end I defined the following method def GetAttr(self, row, col, kind): attr = wx.grid.GridCellAttr() if col == 0: attr.SetEditor( wx.grid.GridCellChoiceEdito...

WxPython custom styled controls

I'd need to make a new style for buttons and text entry controls. It should look something like Is there a way to do this? ...

How to make a dynamic number of horizontal BoxSizers?

I have a fucntion that calculates the number of images that can be displayed on the screen, if there are more images than the ones that can be put on screen, I resize the images till they all can happear. Then, I want to display them with one vertical box sizer and several horizontal box sizers! The horizontal number of box sizers are...

How do I get the screen DPI using wxPython?

I can get the screen resolution in with wx.DisplaySize() but I don't see a method which gives me the DPI. ...

How do I get the size of an individual cell of a wx.GridSizer?

I'm wondering if I could get the size of an individual cell of a wx.GridSizer after calling Fit(). If so, how do I do that? ...

wx.ListCtrl: telling a user's Click from program's a_listctrl.Select()

A first question post to SO. When a user clicks on a ListCtrl widget it generates a EVT_LIST_ITEM_SELECTED event. However if I want set up the list before display to the user so that several items are already highlighted (by calling Select() on the ListCtrl) the widget generates the same event. This event is the incorrectly processed by...

Select and copy text from dialog in wxPython

I have a wxPython app, and in this app, I can select and copy text from various frames, but I can't do so from dialogs. Is there a way to do this? I understand I could probably do this by putting some kind of TextCtrl in the dialog, but I'd like to be able to do this from a standard looking dialog. EDIT: Sorry, I should have been mor...

How to change wx.aui.AuiManager border size?

I can add several panes to the wx.aui.AuiManager. Because I have the direction set to CENTER, they attach on themselfs and have a litle border between them where I can define the size of two panes. Now, I want to know if I can set the size of that border. Is it possible? Thanks in advance! :D ...

wxPython Subprocess communication : Extracting real time output and updating in the Text Control

Hi , This is my post and hence please do not mind of any mistakes , what i wanted the help is about extracting/displaying the real output and updating the values in my text control area. For example : if i have to update the signal catch by a device and have to update in my GUI text Control area and the code that extracts the signa...

wx.CreateStatusBar() without the resize handle

I am creating a wx.Frame that cannot be resized. How do I disable the size grip at the right side of a status bar? Quoting http://docs.wxwidgets.org/2.6/wx_wxstatusbar.html#wxstatusbar : Window styles wxST_SIZEGRIP -- On Windows 95, displays a gripper at right-hand side of the status bar. Translating to wxPython, it should read ...

wxPython on Mac OS X: creating a wx.Frame without stealing focus

I managed to get it working on Win32 (inheriting from wx.MiniFrame does the trick), on wxGTK (wx.PopupWindow) but whatever I try, when I create a frame on wxMac, my main window loses focus and the new frame gets it. wxMac does not seem to have a way to interact with the native platform (something like GetHandle() on Win32 and GetGTKWidg...

Pango error after a minute of running

I have the following python modules. Sorry if the code is ugly. This is my first python GUI app and I'm fairly new to python as well. It's some sort of a count down timer with a todo list. It works kinda well except that after two minutes after running the program, it crashes with the following error: Pango:ERROR:/build/buildd/pango1.0-...

How to get item list from wxpython ListBox

Is there a single method that returns the list of items contained in a wxPython listBox? I cant seem to find anything anywhere in the documentation or anywhere for that matter. All that I can think to do is to set the selection to all of the items and then get the selected items, though seems like an ugly roundabout way of doing some...

Create multiple buttons with consecutive integers in name

I have the following python code and I was wondering if it's possible to create those buttons in a for loop instead? I was thinking of modifying the local namespace but I'm not sure if that's a good idea. I really want the buttons to be named so that it's named consecutively. self.todo1 = wx.TextCtrl(self, -1, "") self.timer_label1 = w...

wxPython: how to make taskbar icon respond to left-click

Using wxPython, I created a taskbar icon and menu. Everything works fine (in Windows at least) upon right-click of the icon: i.e., the menu is displayed, and automatically hidden when you click somewhere else, like on Windows' taskbar. Now I do want to have the menu appear when the icon is left-clicked as well. So I inserted a Bind() to...

Programmatically Uncheck a Checkbox in a wx.CheckListBox

Is there a method to uncheck a checkbox in a wx.CheckListBox as I need to implement an "uncheck all" button, can't seem to find anything... although there is number of methods for setting a checkbox/s. ...