wxpython

How to control a frame from another frame?

自古美人都是妖i 提交于 2019-12-24 10:58:13
问题 I'm writing a small app which has 2 separate frames. The first frame is like a video player controller. It has Play/Stop/Pause buttons etc. It's named controller.py. The second frame contains OpenGL rendering and many things inside it, but everything is wrapped inside a Frame() class as the above. It's named model.py. I'm up to the final part where I have to "join" these two together. Does anyone know how to control a frame (model.py) from another frame (controller.py)? I would like to do

Draw on image buffer (MemoryDC) in separate thread

混江龙づ霸主 提交于 2019-12-24 10:35:38
问题 I have: A Panel with an image buffer where the forms are drawn on using Cairo. The buffer is realized just like the example here: http://wiki.wxpython.org/BufferedCanvas I want: A thread which does all the drawing when the buffer is updated (on creating/resizing/zooming) The question: What is a nice way to solve this? I have tried doing the drawing itself in the thread and got an assertation error because the dc is not finished. Do I have to create the dc in the thread or where? Is there some

Is wxpython progressdialog cancel event possible?

谁说我不能喝 提交于 2019-12-24 09:48:27
问题 if I declare wxProgressDialog with wxPD_CAN_ABORT, "Cancel" button will be provided in ProgressDialog. Normally, to know if user pressed "Cancel", wxProgressDialog::Update needs to be called. Is there a way to get an event, if "Cancel" is pressed in wxProgressDialog? 回答1: You could do this by defining a custom Dialog instead of the stock ProgressDialog: class MyProgressDialog(wx.Dialog): def __init__(self, parent, id, title, text=''): wx.Dialog.__init__(self, parent, id, title, size=(200,150)

Python, Using wxPython to get multiple input from user

﹥>﹥吖頭↗ 提交于 2019-12-24 08:23:17
问题 From this question I found out how to ask the user for an input using wxPython. But how can I ask for multiple information at the same time? Basicly I want to create a message box with three input fields under each other asking for "Name" "Surname" "Nickname". I also want to have the code really simple like: name,surname,nick = askInfo("Name","Surname","Nickname") It doesn't have to be wxPython but it MUST not be using Tkinter. 回答1: Build a wx.Dialog there are numerous examples out there.

wxPython WebView: how to reload on error?

寵の児 提交于 2019-12-24 07:57:00
问题 I'm using wx.html2.WebView to load a Website in a Dialog, which is working fine. Problem : If the Website can't be reached for any reason, the output will be Could not connect: Connection refused . Desired behaviour : Try to reload the URL after x seconds on every fail. import wx import wx.html2 import time URL = "http://mydomain.tld" class MyBrowser(wx.Frame): def __init__(self, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) self.browser = wx.html2.WebView.New(self) self.browser.Bind

How to Update progress bar as well as Download File using Multi-Threading

孤街醉人 提交于 2019-12-24 07:56:36
问题 I'm trying to download files using the Request module using Multi threading and simultaneously need to Update a Progress bar as well. But while doing so, whenever I press submit button, my GUI stops working and in the background the files start to download and only after Downloading, my Progress bar updates and GUI continues to work Normal. I have tried to apply multi-threading to the GUI as well so that the progress of downloaded files will be displayed, but it is only updating the progress

Side effects of handling EVT_PAINT event in wxPython

别等时光非礼了梦想. 提交于 2019-12-24 07:36:06
问题 Whenever I handle EVT_PAINT event by binding it to a function some problem occures the frame/window opens up but it cannot be closed when I click on the close option on the top-right corner of the frame. Can any one tell me what can be the reason for this ??? Apart form that there is a lot of flicker that occures. The purpose of the code is somewhat like this. I have a Main Frame class which holds a panel. In that panel I have a wxPython Notebook. There are two pages in the notebook. Each

Wxpython How to change the colour of Gauge Progress bar in windows

早过忘川 提交于 2019-12-24 07:28:10
问题 I am designing a software in Python using WxPython as GUI in Windows.I want to change the default colour of Gauge Progress bar in my application. Please help... Thanks in advance.. 回答1: You can try something like SetForegroundColour or SetBackgrounColour, but since the gauge wraps the native widget, I'm not sure that those will have any effect. Fortunately, there is a generic gauge widget called PyGauge: wx.lib.agw.pygauge I don't think it's quite as pretty as the native one, but you can

Python: Decide which scrollbar is moving in ScrolledPanel

ぃ、小莉子 提交于 2019-12-24 06:58:21
问题 This question continue the question on the link : wxPython Event for ScrolledPanel. I edited the code a little bit so that OnScroll function get the x position of the content's scrollbar and use that to set x position of the header's scrollbar. My problem is I cannot decide when the horizontal scrollbar is rolled. So my program now has the header's horizontal scrollbar rolled whenever any of the content's scrollbars is rolled while I want the header's h-scrollbar rolled when the content's h

Give wx.StaticBitmap a transparent background? wxpython

ε祈祈猫儿з 提交于 2019-12-24 06:44:10
问题 I have an image that has a white background, how can I make this background invisible? Its in a wx.StaticBitmap wx.StaticBitmap(self, bitmap=wx.Bitmap('images/myimage.png'),pos=(0,0)) 回答1: By invisible, I assume you mean transparent so that whatever is behind the image shines through. This is not a function of widgets, but whatever you use to edit your image. You don't say! I use microsoft visual studio. Here's a screenshot. Notice how the background, shown in a sort of blue-green in the