wxpython

How can I make a wxPython app constantly update and execute code?

Given the following simple program: import wx class TestDraw(wx.Panel): def __init__(self,parent=None,id=-1): wx.Panel.__init__(self,parent,id,style=wx.TAB_TRAVERSAL) self.SetBackgroundColour("#FFFFFF") self.Bind(wx.EVT_PAINT,self.onPaint) self.SetDoubleBuffered(True) self.circleX=320 ...

How can I draw to a MemoryDC using the GraphicsContext, and then blit that to a PaintDC?

I'm looking to add double buffering to a drawing function like this. dc = wx.PaintDC(self) gc = wx.GraphicsContext.Create(dc) #draw GraphicsPaths to the gc I tried to first draw to a MemoryDC and then blit that back to the PaintDC: dc = wx.MemoryDC() dc.SelectObject(wx.NullBitmap) gc = wx.GraphicsContext.Creat...

Why does my buffered GraphicsContext application have a flickering problem?

import wx class MainFrame(wx.Frame): def __init__(self,parent,title): wx.Frame.__init__(self, parent, title=title, size=(640,480)) self.mainPanel=DoubleBufferTest(self,-1) self.Show(True) class DoubleBufferTest(wx.Panel): def __init__(self,parent=None,id=-1): wx.Panel.__init__(self,parent,id,st...

wxpython PyGridTableBase

Hi, I want to use editable choice editor with PyGridTableBase. When I edit a cell it is crashing What is error in my code? My python code: import wx import wx.grid as gridlib class MyTableBase(gridlib.PyGridTableBase): def __init__(self): gridlib.PyGridTableBase.__init__(self) self.data = {0:["value 1", "value 2"], ...

How to get the width of a string in pixels?

I am using wxPython's HyperTreeList and I want to set the column width exactly equal to length of the largest string in it. To accomplish that, I'd like to to convert a python string size into pixels. For Example: If we have a string like str = "python" len(str) = 6 How could I convert the above string length/size into pixels? Is ...

how to set wxPython main frame bottom right on screen?

For better description, +-----------------------+ | Desktop (screen) | | | | | | +----------+ | | | wxPython | | | | App. | | | | | | | | | | | +----------+ | +-----------------------+ Look at WxPython App., whi...

Python: wxpython wx.media.MediaCtrl - millisecond seek capability

I've been searching for a media player that can display sub-second resolution in videos. Some pointed me to the Frame stepping functionality in MPC, but I'd like even more than that. I know from previous experience with wxPython that the wx.media.MediaCtrl both displays and (as fast as i can click with the mouse anyway) stops the video ...

Resulting .exe from PyInstaller with wxPython crashing

I'm trying to compile a very simple wxPython script into an executable by using PyInstaller on Windows Vista. The Python script is nothing but a Hello World in wxPython. I'm trying to get that up and running as a Windows executable before I add any of the features that the program needs to have. But I'm already stuck. I've jumped throu...

How to set the size of a wx.aui.AuiManager Pane that is centered?

Hello, I have three panes with the InfoPane center option. I want to know how to set their size. Using this code: import wx import wx.aui class MyFrame(wx.Frame): def __init__(self, parent, id=-1, title='wx.aui Test', pos=wx.DefaultPosition, size=(800, 600), style=wx.DEFAULT_FRAME_STYLE): ...

Put an AuiManager inside a AuiNotebook page.

Is it possible ho put an AuiManager inside an AuiNotebook page? Have tested with a small sample code, but I only get a 'Segmentation fault'. Is this possible to begin with? The reason why I want this is to split a notebook page in two parts and get the caption field and the maximize field in the top of each part of the two parts. A sim...

WxPython, popup menus, callbacks and Windows XP

My goal: the user clicks a button. From the button pops up a two-level menu. The user clicks on something, and this triggers a callback which does stuff. Here is a minimal example: import wx class MyApp(wx.App): def OnInit(self): frame = TestFrame(None, -1, "Hello from wxPython") frame.Show(True) self.Set...

How to resize and draw an image using wxpython?

Hello, I want to load an image, resize it to a given size and after draw it in a specific position in a panel. All this using wxpython. How can I do it? Thanks in advance! ...

wx Menu disappears from frame when shown as a popup

I'm trying to create a wx.Menu that will be shared between a popup (called on right-click), and a sub menu accessible from the frame menubar. The following code demonstrates the problem. If you open the "MENU>submenu" from the menubar the item "asdf" is visible. If you right click on the frame content area, "asdf" will be visible fr...

Need Help with wxPython & pyGame

Hi Guys, I'm actually in need of your help and advice here on my assignment that I am working on. First of all, I was task to do a program that runs langton's ant simulation. For that, I've managed to get the source code (from snippets.dzone.com/posts/show/5143) and edited it accordingly to my requirements. This was done and ran in pygam...

Is there a way to change lookandfeel for wx Python?

Hi, i was curious if there is some sort of way to change the look and feel of wxpython to something that is more standardized. I am writing a small application for windows and mac os x. And i noticed that Mac formats the layout and look of my application pretty terribly. I looked around online and could not find anything. Any ideas? ...

Once I know the basic elements and syntax of Python, what should I do?

Well, I have read several user guides and watched dozens and dozens of video tutorials on how to program with Python, and feel pretty confident about writing simple applications for it. My main point in my question is, where would I be able to learn more advanced programming knowledge about Python? ...

How to copy matplotlib figure?

I have FigureCanvasWxAgg instance with a figure displayed on a frame. If user clicks on the canvas another frame with a new FigureCanvasWxAgg containing the same figure will be shown. By now closing the new frame can result in destroying the C++ part of the figure so that it won't be available for the first frame. How can I save the fi...

sizer.replace() paints "over" old sizercontent

hi. I am rather new to wx/python so please excuse if this is stupid or ill described. I am substituting a nested sizer with a new one as shown in the snippet below. after some tinkering everything seems to work out but the re-drawing of the parent-sizer. the content of the old nested sizer remains and gets "painted" over with the new si...

cx-freeze + linux + python 2.6 + wxpython

Hi All, Not able to create standalone python binary package 1) The binary package works only on the machine on which it is build 2) There is always an error with respect console.py dependent on cx_freeze and wx libraries (.so files). 3) Tried the rpath trick suggested at this link http://wiki.wxpython.org/CreatingStandaloneExecutable...

Access is denied error with pregenerated .pyc or .pyo files

Hi All, I am getting an Access is denied error while I am trying to run the .pyo file by double click or from the command prompt. Lets say I have abc.py (keeping main method entry point) which imports files xyz.py and imports wx etc. I generate the .pyo file. But once I try to run abc.pyo I get the access is denied error. I am not ge...