wxpython

How do I stop artifacts from WXWidgets sizer being redrawn?

不打扰是莪最后的温柔 提交于 2020-01-24 00:28:49
问题 I have a setup like this: Frame->Panel->BoxSizer The BoxSizer has 2 BoxSizers that are hidden at launch: EditBoxSizer->FlexSizer with some inputs. GridBoxSizer->Grid GridBoxSizer has a grid. EditBoxSizer is simply a few static texts and input boxes. GridBoxSizer and EditBoxSizer are never shown at the same time. So each always gets 100% of the sizer space. When EditBoxSizer is displayed, GridBoxSizer is hidden. It works perfect. When EditBoxSizer is hidden, GridSizer is shown. However I can

wxPython won't close Frame with a parent who is a window handle

巧了我就是萌 提交于 2020-01-23 17:59:10
问题 I have a program in Python that gets a window handle via COM from another program (think of the Python program as an addin) I set this window to be the main Python frame's parent so that if the other program minimizes, the python frame will too. The problem is when I go to exit, and try to close or destroy the main frame, the frame.close never completes it's execution (although it does disappear) and the other program refuses to close unless killed with TaskManager. Here are roughly the steps

Place a Button in ListCtrl - wxPython

家住魔仙堡 提交于 2020-01-23 09:45:12
问题 Is is possible to place a button inside of a ListCtrl item with wxPython? Right now I have a ListCtrl that has data with a file name and size, and I want the user to be able to click a button, to download the file. If this isn't possible, is there a way to display an image in the ListCtrl, and then make it clickable so that I can bind an action to it? 回答1: No. You will have to use "UltimateListControl", a generic list implementation that can attach any kind of widget to rows. Check its demo

Best Canvas for WxPython

我只是一个虾纸丫 提交于 2020-01-23 08:02:16
问题 I am a Java programmer working on a project in Python and the latest version of WxPython. In Java Swing, you can draw on JPanel elements by overriding their paint method. I am looking for a similar class in WxPython for a GUI application. I saw this question here: Best canvas for drawing in wxPython? but the fact that the projects are not being updated has me worried. Three years later, is there anything else I should look into other than FloatCanvas or OGL? The end use case i drawing a sound

Matplotlib: animation for audio player cursor (sliding vertical line) with blitting looks broken on WxPython

♀尐吖头ヾ 提交于 2020-01-22 16:35:23
问题 I am building up a project that requires an audio player for very specific purposes. I'm currently using WxPython, Matplotlib and PyAudio packages. I'm also using Matplotlib's WXAgg backend ( backend_wxagg ). The basic idea is very simple: the audio data will be plotted on the main window and simultaneously played through PyAudio while showing playback progress on the plot — which I intend to do with an animated vertical line ( horizontally sliding cursor ), pretty much the type that you see

Best canvas for drawing in wxPython?

南笙酒味 提交于 2020-01-21 09:03:54
问题 I have to draw a graph of elements composing a topological model of a physical network. There would be nodes and arches, and the latter could be unidirectional or bidirectional. I would like to capture the clicking events for the nodes and the arches (to select the element and show its properties somewhere), and the dragging events for the nodes (to move them around) and arches (to connect or disconnect elements). I've done some research and I've narrowed the alternatives down to OGL (Object

wxPython学习Day2

主宰稳场 提交于 2020-01-21 05:58:44
概述 在我们的程序中,完成相应的点击,移动或者其他操作中最重要的一项就是事件处理。 学习一套新的图形库就需要我们对其页面设计,事件处理非常熟悉。 wxPython事件处理过程 wxpython也是通过对事件的绑定来实现事件的响应,通过其bind函数将控件和事件绑定再一起。例如: #事件绑定 self.m_button1.Bind(wx.EVT_BUTTON, self.ButtonClicked) m_button1通过与事件绑定,点击后会产生wx.EVT_BUTTON,通过调用.ButtonClicked来实现对事件的响应。 完整实例 通过wxPython,点击按钮后会产生一个新的窗口: class MyFrame1(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHints(wx.DefaultSize, wx.DefaultSize) bSizer2 = wx.BoxSizer(wx

wxpython-can we add ok button on pybusyinfo dialog?

ぃ、小莉子 提交于 2020-01-17 07:47:21
问题 I have created pybusyinfo dialog to display message and after 30 secs of sleep it will automatically close. Now i need to add ok button in that dialog to get user input and they are not pressed the button the dialog should close in 30secs. Can we add that button into wx.lib.agw.pybusyinfo dialog ? Or is there any other dialog of wx widgets will automatically close after sometime? import wx import wx.lib.agw.pybusyinfo as PBI retVal = showmsg("dialog will be closed in 30 secs...") time.sleep

Dialog's ShowModal() won't send EVT_PAINT

大城市里の小女人 提交于 2020-01-17 04:21:09
问题 wx version: 2.8.12.1 I'm trying to build a decored Dialog (Background, Buttons, Bitmap Border, etc) but on ShowModal() the Paint event is not issued. It works with Show() super seeding wx.PopupTransientWindow , but not with Show() or ShowModal() on wx.Dialog If you run the example, open the Dialog and click either of the two buttons, you'll get on the terminal: send refresh Clicked OK/CANCEL "Paint Event" or "Draw Function" won't be printed. "send refresh" indicates that a manual Refresh()

set text alignment of rich text ctrl

浪尽此生 提交于 2020-01-17 03:05:38
问题 how to align text right and center because wx.TE_RIGHT and wx.TE_CENTER is not working in the code below import wx import wx.richtext as rtc class test(wx.Dialog): def __init__(self, *args, **kwds): wx.Dialog.__init__(self, *args, **kwds) self.V=rtc.RichTextCtrl(self, size=(400,90),style=wx.TE_RIGHT|rtc.RE_MULTILINE) if __name__ == '__main__': app = wx.App() dialog = test(None, -1) dialog.Show() app.MainLoop() 回答1: Instead of trying to apply both styles I moved the center styling to a new