wxpython-phoenix

Python - Custom styling in wxPython

喜你入骨 提交于 2020-05-30 08:10:19
问题 Is there some way I can create custom styles in wxPython? I searched all the docs and websites referring to wxPython styling and could find nothing. Do I have to create the custom style using the wxPython canvas? 回答1: wxPython uses native widgets in its core widgets as much as possible. Most of the widgets are going to be "native" to the system you are using, so unfortunately you can't fully manipulate how the control paints itself. Sometimes, you can modify widgets via the methods mentioned

Python - Custom styling in wxPython

前提是你 提交于 2020-05-30 08:10:09
问题 Is there some way I can create custom styles in wxPython? I searched all the docs and websites referring to wxPython styling and could find nothing. Do I have to create the custom style using the wxPython canvas? 回答1: wxPython uses native widgets in its core widgets as much as possible. Most of the widgets are going to be "native" to the system you are using, so unfortunately you can't fully manipulate how the control paints itself. Sometimes, you can modify widgets via the methods mentioned

Has wxpython SpinCtrl/SpinButton changed between Classic and Phoenix?

十年热恋 提交于 2020-01-06 06:49:45
问题 I have started to look at converting one of my projects from python2.7/wxpython 3.0.2.0 to python3.5.2/wxpython 4.0.0b2 and have immediately hit an issue with SpinCtrl / SpinButton . I'm running on Linux Mint 18.2 Using this code: import wx class MainWindow(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.panel = wx.Panel(self) self.SetSize((200,200)) sizer=wx.BoxSizer(wx.VERTICAL) text1 = wx.StaticText(self.panel,-1,"SpinCtrl") self.spin = wx

Has wxpython SpinCtrl/SpinButton changed between Classic and Phoenix?

為{幸葍}努か 提交于 2020-01-06 06:49:27
问题 I have started to look at converting one of my projects from python2.7/wxpython 3.0.2.0 to python3.5.2/wxpython 4.0.0b2 and have immediately hit an issue with SpinCtrl / SpinButton . I'm running on Linux Mint 18.2 Using this code: import wx class MainWindow(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.panel = wx.Panel(self) self.SetSize((200,200)) sizer=wx.BoxSizer(wx.VERTICAL) text1 = wx.StaticText(self.panel,-1,"SpinCtrl") self.spin = wx

Cannot run WebGL content on WebView

旧城冷巷雨未停 提交于 2019-12-25 01:38:47
问题 I am trying to open a webpage with WebGL content from wxPython WebView. The engine used by WebView, webkit , has WebGL support. How can I render the the WebGL content inside WebView? The complete code used by me: import wx import wx.html2 class MyBrowser(wx.Frame): def __init__(self, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) sizer = wx.BoxSizer(wx.VERTICAL) self.browser = wx.html2.WebView.New(self) sizer.Add(self.browser, 1, wx.EXPAND, 10) self.SetSizer(sizer) self.Maximize() if

How to remove image in wxPython

别说谁变了你拦得住时间么 提交于 2019-12-13 10:29:19
问题 I am trying to remove an image that has been placed at some random point on a panel. This solution works but it is dependent upon the colour scheme that I am using. Is there a better way of doing this? import wx from PIL import Image import random class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "Remove image") panel = MainPanel(self) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(panel) self.SetSizerAndFit(sizer) self.Centre() self.Show() class MainPanel(wx.Panel)

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

PyGauge (wxPython Phoenyx) does not expand with Frame

ぃ、小莉子 提交于 2019-12-11 14:39:27
问题 I wanted to add a couple or marks into a wx.pyGauge to indicate min, max custom limits. This is the code: import wx from wx.lib.agw.pygauge import PyGauge as PG # # class AFrame(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.gauge = GaugeBar(self) p1 = wx.Panel(self) p2 = wx.Panel(self) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(p1, 1, wx.EXPAND) self.sizer.Add(self.gauge, 0, wx.EXPAND) self.sizer.Add(p2, 1, wx.EXPAND) self.SetSizer

How to I disable the text ctrl when I select the combo box to a particular value?

ぃ、小莉子 提交于 2019-12-11 13:36:28
问题 I want to achieve the effect that when I select the ComboBox to anonymous , the TextCtrl grays out. I want the TextCtrl object be local to the method set_name , I don't want tc be a member of the entire class. That is, how can I achieve this without change tc as self.tc ? If it is possible, I also don't want to merge the two methods select_user_type and set_name as a single one. import wx class Example(wx.Frame): def __init__(self, title): super().__init__(None, title=title) self.panel = wx