wxpython

Drawing to Panel inside of Frame in wxPython

╄→гoц情女王★ 提交于 2019-12-18 08:43:22
问题 Below, I have a panel inside of a frame. Why am I not able to draw to the panel? I just get a plain white screen. If I get rid of the panel and draw directly to the frame...it works. any help would be appreciated. import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,'window',(200,200),(600,600)) self.Center() self.panel=wx.Panel(self) self.panel.SetBackgroundColour('white') self.firstpoint=wx.Point(300,300) self.secondpoint=wx.Point(400,400) self.Bind(wx.EVT

DLL load failed: 1% is not valid win32 application

眉间皱痕 提交于 2019-12-18 03:54:59
问题 import wx Traceback (most recent call last): File "", line 1, in import wx File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in from wx._core import * File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in import _core_ ImportError: DLL load failed: %1 is not a valid Win32 application I have tried python2.6 and python2.7 with several wxpython versions,they all turned out to be like this.All the versions are win64 as well as my OS,please

Nice IDE with GUI designer for wxPython or Tkinter [closed]

让人想犯罪 __ 提交于 2019-12-17 23:47:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have a little experience developing small command-line applications with Python. I want to move on to developing GUIs with Python. From the available GUI toolkits for Python, the ones I feel the most inclined to are wxPython and Tkinter ; but I don't want to code all of the GUI by myself all of the time. Are

How can I hide the console window when freezing wxPython applications with cxFreeze?

旧巷老猫 提交于 2019-12-17 21:47:11
问题 I'm developing a Python application using wxPython and freezing it using cxFreeze. All seems to be going fine apart from this following bit: When I run the executable created by cxFreeze, a blank console window pops up. I don't want to show it. Is there any way I could hide it? It doesn't seem to be documented on the cxFreeze site and Googling didn't turn up much apart from some similar sorta problems with Py2Exe. Thanks. 回答1: This worked to some extent but it has issues. My program runs in

wx.TextCtrl and wx.Validator

北城余情 提交于 2019-12-17 19:24:27
问题 I need to validate the textboxes with wx.Textvalidator. Any please help me to do this? How can i use wx.FILTER_ALPHA with validators and if the user is giving a wrong input how can i give them a message? i need to validate all the inputs when clicking on the save button? can any one provide me a sample code for this? 回答1: This is a feature of wxWidgets, and is not implemented in wxPython. http://www.wxpython.org/docs/api/wx.TextValidator-class.html - not found while: http://docs.wxwidgets.org

Undefined variable from import when using wxPython in pydev

岁酱吖の 提交于 2019-12-17 18:54:59
问题 I just downloaded wxPython, and was running some of the sample programs from here. However, on every line that uses a variable from wx.*, I get a "Undefined variable from import error" For example, the following program generates five errors on lines 1,4,8, and two on line 5: import wx class MyFrame(wx.Frame): """ We simply derive a new class of Frame. """ def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(200,100)) self.control = wx.TextCtrl(self, style=wx

How to kill a WxPython application when user clicks a frame's close

£可爱£侵袭症+ 提交于 2019-12-17 18:50:06
问题 The application is supposed to close when I click the close button for the main frame. But the way I implemented it, it quits with a Segmentation fault when I click the button. I worry about safe shutdown of the program, because I will need to persist stuff to disk later. What is the proper non-violent way to terminate a WxPython application though a close button? Here is the "main" loop of the program I implemented: if __name__ == "__main__": app = wx.App(False) mf = MainFrame(None, title=

how to set a menubar icon on mac osx using wx

三世轮回 提交于 2019-12-17 18:46:16
问题 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. 回答1: You have to set wxTaskBarIconType to STATUSITEM , not DOCK . The Cocoa APIs for this are NSStatusBar and NSStatusItem ; here's the code in wxWidgets that calls

How do I install wxPython on Mac OS X?

廉价感情. 提交于 2019-12-17 18:33:09
问题 I'd like to use wxPython on my Mac OS 10.7 (Lion) computer. (I'm a Tkinter refugee.) I upgraded from Python 2.7.1, then downloaded and installed wxPython2.8-osx-unicode-2.8.12.1-universal-py2.7.dmg. Here's what I get: Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. >>> import wx Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import wx

Is it possible to pass arguments into event bindings?

夙愿已清 提交于 2019-12-17 10:21:22
问题 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 OnClick(self, event): self.log.write("Click! (%d)\n" % event.GetId()) But is it possible to have another argument passed to the method? Such that the method can tell if