wxpython

Cannot understand how to get data from checklistbox in wxpython

こ雲淡風輕ζ 提交于 2019-12-11 04:16:27
问题 I am trying to get either the strings checked or the integers from a check list. I cannot seem to get it anywhere. In the code below, you'll see a bunch of un-commented code, those are just different ways I've tried. I thought I would leave them in case any one's suggestions have to do with it. I am very new to GUI-programming and wx. Thanks for your help. import wx class Panel1(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) allLoc = ['One', 'Two', 'Three',

Block windows key wxPython

北慕城南 提交于 2019-12-11 04:16:01
问题 I am creating an application with wxpython for writing tests in schools, and it needs to be able to block the windows key, alt-tab and so on to prevent cheating. Is this possible and if it is, how do you do it? I know that you can't block ctrl + alt + del, but is it possible to detect when it is pressed? 回答1: I came across this in a similar discussion, http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html Which provides an outline of tracking user events such as those

wxPython - drawing on transparent/alpha background (for custom widgets/panels)

蹲街弑〆低调 提交于 2019-12-11 03:57:32
问题 I'm learning wxPython on Ubuntu Linux - and I would like to define my own widget, which is basically a line, which I'd like to move around the window.. I'm getting somewhere, but the problem is that I cannot get the 'widget' to 'draw' on a transparent background; best I can get is something like this ( the yellow line should be an independent widget with a transparent background - but the background there is black with noise ): The code I came up with is below. I don't want the whole window

Changing WxPython app Mac menu bar title?

人盡茶涼 提交于 2019-12-11 03:47:11
问题 I've made a .app with my WxPython script, and it's just about finished. The problem is, the menu bar title reads "Python". How can this be changed? Would I use wx.Menu()/wx.MenuBar(), or is this a problem with the .app file itself? 回答1: Be sure to use Py2app, and make sure the .plist is filled out correctly, IE CFBundleName and CFBundleDisplayName. 回答2: Edit: My old answer does not work. This question is related to yours, though they are asking about QT: Setting Mac OSX Application Menu menu

wxPython hide and show panel

僤鯓⒐⒋嵵緔 提交于 2019-12-11 03:36:42
问题 I am creating a Python application that requires a login on start up. I want to have a main panel that will hold my login panel and on successful login the login panel will hide and the main wx.Notebook will show. The following code works, but if in the login panel I re-size the application, after I successfully login and go to the main wx.Notebook the wx.Notebook does not fit the size of the screen. If I resize again while in the main wx.Notebook the main wx.Notebook will fit the window. How

wxPython: Can a wx.PyControl contain a wx.Sizer?

旧城冷巷雨未停 提交于 2019-12-11 03:06:00
问题 Can a wx.PyControl contain a wx.Sizer ? Note that what I am ultimately trying to do here (spinner with float values) is already answered in another question. I am particularly interested in layouting widgets within a wx.PyControl , a skill which might prove useful if I come across a need to make my own custom widgets. I already read through CreatingCustomControls, but it didn't use sizers within the wx.PyControl subclass. Using my code below, my CustomWidget just doesn't look right. I'm not

Is DatePickerCtrl been update to work with Python 3.4, wxPython_Phoenix 3.0.3 and Windows 7

北城以北 提交于 2019-12-11 02:48:57
问题 I am using Python 3.4, wxPython_Phoenix-3.0.3 and windows 7 (64 bit). I posted a prior issue with my system not recognizing wx.DatePickerCtrl providing the following message: test8010.py", line 10, in init self.datepick = wx.DatePickerCtrl(self.panel,-1, pos=(20,15), AttributeError: 'module' object has no attribute 'DatePickerCtrl'. The it occurred to me that maybe DatePickerCtrl does not work with Python 3.4. Does anyone know? Thanks a bunch from a newby. Michael 回答1: Yes, but in Phoenix it

Why does this wxPython/PyOpenGL code raise an error on glPushMatrix?

扶醉桌前 提交于 2019-12-11 02:43:17
问题 I was dusting off some wxPython/PyOpenGL code that used to run but does not any more -- apparently it stopped working after some update in one module or another, I have no idea when. Here is a teeny sample app that reproduces the error. import wx from wx import glcanvas from OpenGL.GLUT import * from OpenGL.GL import * class WxMyTestApp(wx.App): def __init__(self): wx.App.__init__(self) def OnInit(self): self.viewFrame = wx.Frame(None, -1, 'viewFrame', wx.DefaultPosition, (400,400)) self

Mouse events on text in Python using wxPython

拈花ヽ惹草 提交于 2019-12-11 02:25:20
问题 This is what I am trying to do: I create a window and there is text that is displayed on it, as a user I click on the text, example: the displayed text is. 'Hello World, I am a Python program.' So if the user clicks words, I want it to generate an event and it would go into a function and I want to do something in the function (like changing the color of that word, so I also need to track which word I clicked) I am not so sure how to do that, I could potentially make each word a button but

Logging output of external program with (wx)python

半城伤御伤魂 提交于 2019-12-11 02:15:07
问题 I'm writing a GUI for using the oracle exp/imp commands and starting sql-scripts through sqlplus. The subprocess class makes it easy to launch the commands, but I need some additional functionality. I want to get rid of the command prompt when using my wxPython GUI, but I still need a way to show the output of the exp/imp commands. I already tried these two methods: command = "exp userid=user/pwd@nsn file=dump.dmp" process = subprocess.Popen(command, stdout=subprocess.PIPE) output = process