wxpython

Wxpython app exiting abnormally

Hi I have a wxpython app designed using XRC which has a multiline textctrl inside nested boxlayouts. I'm adding some text(retrieved from the web) to the text control using SetValue(), inside the longtask method from a separate thread using the following code thread.start_new_thread(self.longtask, ()) The app runs fine the first c...

wxPython -- Bash shell

Hey I want to create a bash-shell in wxPython, the only thing it should be able to do is run a python file and be able to offer user_input on the fly. (I know there is a Python Shell, but that is something different) Can someone help me with this? thanks in advance ...

wxPython: centering an image in a panel

I have a GridSizer with StaticBitmap images in it. I want to put each of the images in their own panels so I can change the background color to highlight an image if it has been selected. When I try to do this, however, the images are not centered in their panels and the highlighted background color is only present on two borders. How ca...

Finding out how many lines can be displayed in wx.richtext.RichTextCtrl without scrolling

I'm writing an e-book reader in Python + wxPython, and I'd like to find out how many lines of text can be displayed in a given RichTextCtrl with the current formatting without scrolling. I thought of using and dividing the control's height by RichTextCtrl.GetFont().GetPixelSize(), but it appears that the pixel size parameter of wx.Font...

Eclipse pydev bugs?

I don't know if you guys are having the same problem, but when I'm trying to use """ and """ for multi-lines comments in eclipse pydev, it sometimes does not work. Anybody can suggest me some better IDE? Sorry. I will try to make this clearer. It happens every time when I try to comment off looong multi lines like 300 or so. Just type w...

wxPython: switching text control focus on tab press

I made a frame that asks the user to put in a bunch of information in several text control fields. How can I make it so that when you hit the 'tab' key your cursor moves to the next text control? ...

difference between default and optional arguments

okay code: #!/usr/bin/python import wx import sys class XPinst(wx.App): def __init__(self, redirect=False, filename=None): wx.App.__init__(self, redirect, filename) def OnInit(self): frame = wx.Frame(None, -1, title='Redirect Test', size=(620,450), style=wx.STAY_ON_TOP|wx.DEFAULT_FRAME_STYLE) panel = wx...

How to make wx.TextEntryDialog larger and resizable

I create a wx.TextEntryDialog as follows: import wx dlg = wx.TextEntryDialog(self, 'Rules:', 'Edit rules', style=wx.TE_MULTILINE|wx.OK|wx.CANCEL) dlg.SetValue(self.rules_text.Value) if dlg.ShowModal() == wx.ID_OK: … This results in a dialog box that is too small for my needs, and that is not resizable: ...

Add image dinamically to wx.StaticBitmap?

It is possible to add dinamically images to wx.StaticBitmap? Now I can only add one image and only change existing image. I want to display next image after new line or sth else. My actual code: self.images = wx.StaticBitmap(self, id=-1, pos=wx.DefaultPosition, size=(-1,100), sty...

How to add images/bitmaps to wx.Dialog

I want to add images to wx.Dialog (and then sizer) some like wx.ImageList and display it dinamically. But I don't want to change already displayed image, I want to add next. How can I resolve this problem? ...

Running Python-script in thread and redirecting std.out/std.err to wx.TextCtrl in GUI.

I'm trying to write a GUI that reads in settings for a python-script, then generates the script and runs it. The script can take dozens of minutes to run so in order to not block the GUI and frustrate the user I'm running it in a separate thread. Before I did this I used a separate class to redirect the std.out and std.err of the program...

Where can I find a full reference of wxpython?

Sorry the question may sound stupid, but I do need one. Right now I'm just adding a wx.TextCtrl in my GUI program, and I want to know what styles can I add (such as style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER), so I googled and end up reading this page: http://www.wxpython.org/docs/api/wx.TextCtrl-class.html. It must be the official one, b...

How add already captured screenshot to wx.BoxSizer?

My Python code: self.images = wx.StaticBitmap(self, id=-1, pos=wx.DefaultPosition, size=(200,150), style= wx.SUNKEN_BORDER) self.hbox = wx.BoxSizer(wx.HORIZONTAL) self.sizer.Add(self.hbox) # my main sizer #in function dinamically captured images bmp = wx.Bitmap...

How do I make wx.TextCtrl multi-line text update smoothly?

I'm working on an GUI program, and I use AppendText to update status in a multi-line text box(made of wx.TextCtrl). I noticed each time there's a new line written in this box, instead of smoothly adding this line to the end, the whole texts in the box just disappear(not in real, just visually) and I have to click the scroll button to che...

how do I get variables from one wx notebook page to a different wx notebook page?

I am wondering how one would get a variable from one page to another from a wx notebook. I am thinking there should be some way to reference a variable if I know the variable name and page id. For example if I had the following code, how would I reference variable x from panel y and vice versa import wx class PanelX(wx.Panel): def...

In wxPython how do you bind a EVT_KEY_DOWN event to the whole window?

I can bind an event to a textctrl box np. The problem is I have to be clicked inside of the textctrl box to "catch" this event. I am hoping to be able to catch anytime someone presses the Arrow keys while the main window has focus. NOT WORKING: wx.EVT_KEY_DOWN(self, self.OnKeyDown) WORKING: self.NudgeTxt = wx.TextCtrl(self.panel, s...

Get object created in child thread back in main thread

Assume i want to create 500 wxWidget like (some panels , color buttons and text ctrl etc), I have to create all this at single time but this will freeze my main thread, so i put this creation part in child thread and show some gif anim in main thread. But i was not able to get all these wxWidget object those created on my frame in child ...

What is the best solution to bind objects in wx.DC?

So, for example I draw some objects on wx.PaintDC, such as lines and rectangles. Now I want next: on mouse click I wont know which object was clicked. Of course, I can see what object is the closest, but what about more exact answer? Maybe even not standart wx.DC, but such things as FloatCanvas or something like this. So, what's the be...

a problem about wxpython listctrl

I got a GUI application implemented in wxpython, on the main window, there is a listctrl used to dispaly the names of the files. it was empty at the very beginning. the user clicks the "File", then "open", then chooses a file to open, when this is done by clicking on the "ok" button, the names of the file is supposed to be display in the...

how to implement this process in xwpython?

in wxpython, is there a event that can occur when one of the function of the panel or frame is called? thanks; for example, self.Bind(wx.EVT_Onfunctioncalled, self.OnDoSomething) Well, I have to changed this question to a more specific one as follows: I mean, well, the following process: I click on the menu "file" on the main window (a...