wxpython

Rebind button with wxpython

I have this button : self.mybutton= wx.Button(self, -1, label= "mylabel", pos=(100,180)) self.Bind(wx.EVT_BUTTON, self.Onbutton, self.mybutton) and need to Bind it to another function whenspecifc radio button is choosen for exmaple : def onRadiobutton(self,event) : if choosen radio button : bind the mybutton to another func...

Execute external application and send some key events to it...

Hi! I wasn't able to find a solution for Python. I am abelt o launch the application (using subprocess.Popen or subprocess.call), but I can't find a way to do the other part: I want to send a serie of keys (kind of macro) to the application I just opened. Like: Tab Tab Enter Tab Tab Delete ... Is there a way to do this that is Mac a...

How do I dynamically get a list of all PythonCard components in a GUI class?

Here is a sample resource file for PythonCard: { 'application':{ 'type':'Application', 'name':'Test Sounds', 'backgrounds': [ { 'type':'Background', 'name':'Test Sounds', 'title':'Test Sounds', 'position':( 5, 5 ), 'size':( 300, 200 ), 'components': [ { 'type':'TextField', 'name':'fldFile...

wx.radiobox python

I have the following code : myList =['a','b'] rb=wx.RadioBox(self.panel, -1, "Options :", (0, 0), wx.DefaultSize,myList, 2, wx.RA_SPECIFY_COLS) When it renders first time I see that a choice has been made how can I change the code that when this radibox rendered first time there are no option has been chosen. ...

wx.wizard and python

I have a class which derived from wx.frame and need to attach it to wx.wizard as a page is that possible and if yes how can i do that : for example i have frame=myDrevidedFrame(..) where myDervidedFrame its base class wx.frame how can i attach the frame object to wx.wizard ? ...

WxPython Wizard: from last to first page

I have created a simple Wizard and now I need to give the user the possibility to start again from the first page without restarting the program. I tried overwrite the GetNext() method and used SetNext() to set a new page after the last. It works but the button "Next >" changes on the last page to "Finish" and doesn't change back by itse...

how to create read only text ctrl but support copy paste event

Hi All, In my application i have text control. I want my text ctrl should be read only but when some one right click on this he is able to copy the value from that ctrl and he can paste that value in other text control. If i made my text control read only with wx.TE_READONLY then copy/paste is not working. Is there any requirement to ...

wxPython: Assigning text labels to ticks on a slider

Hi, A wxPython program that I'm writing uses two sliders as part of the GUI. These sliders represent a three state switch with the states "On Full", "On Medium" and "Off". I'd like to be able to assign these labels to the ticks on the slider. Is there a way of doing this without having to subclass or position separate static text contro...

Python: Setting sys.stdout to a wx.TextCtrl with Process/Thread leads to crashes

I've got a wx-gui that's piping stdout/stderr to two different text-controls. In the program I'm creating a process to run some data-crunching code, and I have a thread that joins the process and changes the global state when the process is finished. import multiprocessing as mp from threading import Thread t = Thread(target=self.joi...

GtkExpander style widget in wxWidgets?

I'm looking for a widget along the lines of GtkExpander, but for wxWidgets. Can't seem to find anything obvious in the documentation. Custom widgets (non-GPL) from somewhere else would be fine, but they need to work on Windows (i.e. without GTK). Practically (if it makes any difference) this is primarily for wxPython, on Windows and hop...

wxWidgets ComboBox center on selected item

Hello SO, I have a requirement to center a wx.ComboBox on the selected item when opened. Basically, I want to do this (http://stackoverflow.com/questions/592911/wpf-listbox-centering-selected-item), but using wxWidgets. Thanks ...

Using a loop to generate unique bitmap buttons with separate events when clicked.

I'm pretty new to Python, so I'll hope you forgive me for such amateurish code. I've tried pouring over examples that do similar things but I'm having trouble figuring out what they're doing that is different. In examples I've seen each button generated with the loop had a different action, for mine only the last button in the loop is af...

Using DC to draw wx.BitMapButtons on the fly?

I'm currently able to get this to do most of what I want to. It draws buttons based on lines from a text file as well as handles the way different button states look. What's really tripping me up right now is when self.input writes to the text file I have no idea how to get it to redraw everything to add or update buttons based on the ne...

WxPython - Resize WxFrame when adding new content?

Pretty much exactly as it sounds. I have buttons in a Wx.Frame that are created on the fly and I'd like the parent frame to increase in height as I add new buttons. The height is already being acquire from the total number of buttons multiplied by an integer equal the each button's height, but I don't know how to get the frame to change ...

Python wxPython how to align 2 toolbars on same the row, one aligned left and one aligned right!?

Hello. I use wxPython to sketch up a user interface for the a python program. I need to put 2 toolbars on the same row. One toolbar is on the left while the other is on the right. I use BoxSizer to achieve this (by putting a stretchable space between 2 toolbars) However, the stretchable space produces a blank space between 2 toolbar...

wxPython - How to get Top Frame or Application object

Hi all, I am little confused about how to get the top frame in an application. I start off my application with the usual class AppFrame(ClientGUI.MyFrame): #ClientGUI.MyFrame generated by wxformbuilder. def __init__(self): # create some panels. # Create some object classes that invoke objects of other classes. # .. do othe...

wxPython for Python: How to remove the 1px border under a toolbar?

Hello. I need your help. I have a toolbar, which is next to a slider (screenshot: http://i54.tinypic.com/w2n6ag.jpg) and wxPython automatically puts a tiny 1px border under the [Play/Pause/Stop | Previous/Next] buttons. This does not look nice at all so is it possible to remove it/set it to 0px? Thank you very much. Here is part of...

counting records of files on directory with python

I have wxpython application that run over a list of files on some directory and proccess the files line by line I need to build a progress bar that show the status how records already done with wx.gauge control I need to count the number of the records before i use the wx.guage in order to build the progress bar , is this the way to do ...

How to make a .exe for Python with good graphics?

Hello, I have a Python application and I decided to do a .exe to execute it. This is the code that I use to do the .exe: # -*- coding: cp1252 -*- from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "SoundLog.py"}], zipf...

Command+W Support in wxPython

It's my understanding that in wxPython in OSX, ⌘+w support for closing wx.Window objects. In order to add it, I've had to bind to wx.EVT_KEY_DOWN, checking for event.MetaDown() and event.KeyCode == 'W' explicitly. In my app, I need to have all windows and dialogs support this. I'm still in the process of layout out my GUI, but I got to ...