wxpython

wxPython Window ID

馋奶兔 提交于 2019-12-13 03:47:56
问题 I'm trying to write a photo frame app utilizing wxPython. To view videos as well as photos I started off using wx.media but found the gstreamer backend to insufficient. So I turned to mplayerctrl and ported it over to Python3/Phoenix. The thing I've been struggling with to get it working is programmatically retrieving the window id to pass into mplayer so that the video plays inside the frame. I've verified that this works if I get the window id from xwininfo however if I use GetHandle() it

wx python how to place a button on a frame

别等时光非礼了梦想. 提交于 2019-12-13 03:47:19
问题 I have two buttons on a panel. I want one on the left and one on the right. There must be a simple way but I can't see it (the (400, 0) spacer is just an example; it should work on any panel) import wx class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, 'Demonstrate wxPython button') self.panel = MainPanel(self) self.Fit() self.Centre() self.Show() class MainPanel(wx.Panel): def __init__(self, frame): wx.Panel.__init__(self, frame) # Button button_sizer = self.

wxPython popup from calling imported function

我的未来我决定 提交于 2019-12-13 03:35:29
问题 I have a GUI made with wxPython that calls a function that I imported from a separate Python file when I press a button, and shows the output of that function in a text box. I want to improve it so that if the function asks for user input mid-execution (like a raw_input()), I want a new popup window to appear instead of the raw_input waiting in the text box. I've been looking through the wxPython documentation but can't seem to find anything that resembles what I want, so I was wondering if

Embedding mayaVI within wxPython

爱⌒轻易说出口 提交于 2019-12-13 03:20:57
问题 UPDATE: I've placed print commands within the code to isolate the moment of error. The output for the below code is a b c d . I ended up switching to pyqt/pyside using the alternative code provided, but please let me know if I can help in any other way from my current setup in debugging this issue. from numpy import ogrid, sin from traits.api import HasTraits, Instance from traitsui.api import View, Item from mayavi.sources.api import ArraySource from mayavi.modules.api import IsoSurface from

wxPython & pyGame Assignment

雨燕双飞 提交于 2019-12-13 03:03:41
问题 I'm actually in need of your help and advice here on my assignment that I am working on. First of all, I was task to do a program that runs langton's ant simulation. For that, I've managed to get the source code (from snippets.dzone.com/posts/show/5143) and edited it accordingly to my requirements. This was done and ran in pygame module extension. In addition, my task requires a GUI to interface for users to run and navigate through the screens effectively with the langton's ant program

Error with on click event in wxpython

巧了我就是萌 提交于 2019-12-13 02:55:51
问题 I want to collect input from the user in test box. So when I click a button it should give me name of that button in test box Error: you should omit either rows of column for i in A: hbox1=wx.BoxSizer(wx.HORIZONTAL) btn = wx.Button(p, -1, i, (10,20)) btn.myname = I gs.Add(btn,0,) self.Bind(wx.EVT_BUTTON, self.OnClick, btn) self.t1=wx.TextCtrl(p) gs.Add(btn,0,) self.t1.Bind(wx.EVT_BUTTON, self.OnClick, btn) gs.Add(hbox1) p.SetSizer(gs) def OnClick(self, event): #When the button is clicked name

Spacing/empty border for wxWidgets

筅森魡賤 提交于 2019-12-13 02:55:44
问题 Is there anything you can use to add space around the edges of a window or between components with wxWidgets/wxPython? I want something to prevent components from being squished up against the window border or each other, similar to what can be done with Java Swing's EmptyBorder or Insets. (I know you can set horizontal/vertical gaps with some sizers, but I'd like something more flexible.) 回答1: See the border parameter in the Sizer's Add method. You can use the flag parameter to tell it where

Transparent images in wxPython {Mask}

 ̄綄美尐妖づ 提交于 2019-12-13 02:37:50
问题 I'm tired of searching this on the net and i cant get it to work. I need to turn green pixels into transparent ones, no half transparency needed. Wondering how can effectively use a mask, but the wx docs doesn't help much really... Hope someone can give me a tip, regards. Related code png = wx.Image('sun2.png', wx.BITMAP_TYPE_PNG).ConvertToBitmap() #print png.HasMask() fail png.SetMaskColour((0,255,0)) #mask=wx.Mask(png,wx.Colour(0,255,0)) #png.SetMask(mask) imge=wx.StaticBitmap(self, -1, png

wx.PyTextDataObject with drag and drop results in extra characters

给你一囗甜甜゛ 提交于 2019-12-13 02:22:34
问题 I'm using wx.PyTextDataObject as the data object for a drag and drop setup in wxPython. When the user selects an item to drag the text is copied into a wx.PyTextDataObject and on drop the PyTextDataObject is copied into another (this is internal to wx, I don't control this). The problem i'm having is that occasionally the copied text will contain a bit of garbage on the end. It looks like some kind of buffer overflow problem in wx. I've narrowed the problem down to the following example. The

Plot freezing because of fast input stream to a GNU Radio block

浪子不回头ぞ 提交于 2019-12-13 02:17:37
问题 I have implemented a sync block which plots inside its work function using the input_items values. Now the problem is that the plotting mechanism isn't fast enough for the input stream ( the value of input_items keeps on changing ). I have tried to simplify the code as much as possible and added comments. Here it is: .... import matplotlib from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from