wxpython

Disable the 'Next' button until condition is met on single page of wx.WizardPageSimple

最后都变了- 提交于 2019-12-12 05:32:09
问题 Using self.GetParent().FindWindowById(wx.ID_FORWARD).Disable() I am able to disable the next button altogether, but I only want my second page in the Wizard to have a disabled button until a condition is met. How can I prevent the next button from being disabled until I reach the second page if all pages are created at once? 回答1: The wizard is pretty cool until you actually want to modify stuff like this. I am guessing you will have to keep track of which page you're on and then call

wxpython: How to make a tab active once it is opened via an event handler?

女生的网名这么多〃 提交于 2019-12-12 05:27:40
问题 I am making this GUI tool using wxpython. For that I have a menu and a few menu-items. Now, when I click on a particular menu-item, I have written the code for the event that handles the menu-item click. It creates a new sheet(panel, and a listctrl inside it) and adds the page to the already-created wx.Notebook object. Now, when I click on one menu-item after another, I want the tabs opened successively to be active (that is, the one that is shown to the user at that moment), whereas what

wxpython: 'Example' object has no attribute 'OnClick'

依然范特西╮ 提交于 2019-12-12 05:24:55
问题 I am making a GUI of the periodic table of elements with wxpython, I have added all the buttons. So now what I want is when the user selects multiple buttons it should give me output same as the labeled on the button. Trying to run this code but getting the error. Don't know what's wrong, I am doing here. import wx class Example(wx.Frame): def __init__(self, parent, title): super(Example, self).__init__(parent, title=title, size=(1000, 800)) self.InitUI() self.Centre() self.Show() def InitUI

Wx Matplotlib Event Handling

故事扮演 提交于 2019-12-12 05:23:13
问题 I am working on a WX-MPL app to display and interactively process data based on user input. I am having a difficulties setting up the MPL mouse events to work within the WX app. The goal is to have a series of editable vertical lines that delineate the begin and end times for features which have been identified in earlier processing. Users should be able to drag the lines along the x-axis, delete unwanted lines, and insert new lines. So far I have been able to achieve this functionality using

How to create a TaskBarIcon-only application in wxpython?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 05:19:42
问题 I'm trying to create an application in wxpython that only uses a TaskBarIcon and no frames. There is a question on this here, but that example doesn't work for me; it just exits with no error. The code I've written below is a much simplified version of the code I'm working with: import wx class Systray_Icon(wx.TaskBarIcon): def __init__(self): icon = wx.Icon('yellow.ico', wx.BITMAP_TYPE_ICO) self.SetIcon(icon, "Test") self.Bind(wx.EVT_MENU, self.Destroy(), id=wx.ID_EXIT) def CreatePopupMenu

wxpython threading textctrl delay

核能气质少年 提交于 2019-12-12 04:45:11
问题 I have any issue with wxpython's textctrl and threading. Would appreciate any help in resolving this issue. My program processes files, as and when each file is processed it is listed within the textctrl as being completed. When working with just a few files the textctrl is responsive and displays itself immediately and does not disappear. Even if these files are large. Did a test on a 700mb file and textctrl worked perfectly. The problem occurs when workin on many files, say 20+ for exmaple.

wxPython: wx.PyControl layout problem when it is a child of a wx.Panel

浪尽此生 提交于 2019-12-12 04:25:47
问题 This is a continuation from this question: wxPython: Can a wx.PyControl contain a wx.Sizer? The main topic here is using a wx.Sizer inside a wx.PyControl . I had problems Fit() ting my CustomWidget around its child widgets. That problem was solved by calling Layout() after Fit() . However , as far as I have experienced, the solution only works when the CustomWidget is a direct child of a wx.Frame . It breaks down when it becomes a child of a wx.Panel . EDIT: Using the code below, the

wx.TextCtrl.LoadFile()

喜夏-厌秋 提交于 2019-12-12 04:00:03
问题 I am trying to display search result data quickly. I have all absolute file paths for files on my network drive(s) in a single, ~50MB text file. The python script makes a single pass over every line in this file [kept on the local drive] in a second or less, and that is acceptable. That is the time it takes to gather results. However, the results are given in a wx.TextCtrl widget. Appending them line by line to a wx TextCtrl would be ridiculous. The best method I have come up with is to write

wxPython — StaticBox Sizer resizing Static Boxes

本小妞迷上赌 提交于 2019-12-12 03:58:54
问题 Here is a minimal example of my code that should run by itself -- run as is, everything is laid out how I want, 3 rows of nodes spaced evenly: import wx def createBoxes(): outVSizer = wx.BoxSizer(wx.VERTICAL) outHSizer = wx.BoxSizer(wx.HORIZONTAL) outVSizer.AddStretchSpacer(1) outHSizer.AddStretchSpacer(1) sizer = wx.FlexGridSizer(rows=3, cols=3, vgap=35, hgap=20) box = {} boxSizer = {} text = wx.StaticText(panel, wx.ID_ANY, "This is a test") for i in range(6): box[i] = wx.StaticBox(panel, wx

wx python 3.0.2 classic - disable the Cancel button of wx.ProgressDialog

女生的网名这么多〃 提交于 2019-12-12 03:57:10
问题 More problems with my lovely custom Progress class moving on to wx python 3 (see wx python 3.0.2 classic SetFocus blows for part I) This: def setCancel(self, enabled=True): cancel = self.dialog.FindWindowById(wx.ID_CANCEL) cancel.Enable(enabled) used to work just fine in 2.8.12.1 unicode, while crashes in 3.02 with: Traceback (most recent call last): File "bash\balt.py", line 419, in <lambda> if onButClick: self.Bind(wx.EVT_BUTTON, lambda __event: onButClick()) File "bash\balt.py", line 1565,