wxpython

wxpython中设置radiobox相关使用

别来无恙 提交于 2020-01-08 07:18:47
#coding=utf-8 import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,"Wxpython Radiobox 演示",size = (800,600)) panel = wx.Panel(self) #第一种方法使用wx.RadioButton类 #RadioButton(parent, id=ID_ANY, label=EmptyString, # pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=RadioButtonNameStr) self.check1 = wx.RadioButton(panel,-1,"Value1",pos = (50,20),style = wx.RB_GROUP) self.check2 = wx.RadioButton(panel, -1, "Value2", pos=(150,20)) self.check3 = wx.RadioButton(panel, -1, "Value3", pos=(250,20)) self.check1.Bind(wx.EVT_RADIOBUTTON,self.Event1)

Run __init__ after panel is created?

僤鯓⒐⒋嵵緔 提交于 2020-01-07 07:16:08
问题 Is there a way, from a button to reinitialize a specific panel? I have a section of an app that looks for specific files in the OS and then creates some checkboxes and textctrls and then adds them to the sizer dynamically: for db in numDB: if xIndex >= 12: pass xIndex += 1 else: check = wx.CheckBox(self, -1, db) sizer.Add(check, pos=(xIndex,0), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=10) label = wx.StaticText(panel, label="") sizer.Add(label, pos=(xIndex,1), flag=wx.LEFT|wx.ALIGN_CENTER

Run __init__ after panel is created?

筅森魡賤 提交于 2020-01-07 07:16:05
问题 Is there a way, from a button to reinitialize a specific panel? I have a section of an app that looks for specific files in the OS and then creates some checkboxes and textctrls and then adds them to the sizer dynamically: for db in numDB: if xIndex >= 12: pass xIndex += 1 else: check = wx.CheckBox(self, -1, db) sizer.Add(check, pos=(xIndex,0), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=10) label = wx.StaticText(panel, label="") sizer.Add(label, pos=(xIndex,1), flag=wx.LEFT|wx.ALIGN_CENTER

Looping in the GUI

假如想象 提交于 2020-01-07 06:39:26
问题 I have a panel in wxPython where I want to take a button enable monitor and when clicked start a loop of the below, but also free up the GUI again and thusly update the button label to disable monitor . Once disable is clicked, it would stop the loop entirely. I've looked at threading , but I am not sure that is what I should be doing in this case? The entire loop runs within a def startStop(self) declaration and is run within the wxPanel's class . I'm in way over my head, but I've been

I want to install wxpython_phoenix on raspberrypi3

为君一笑 提交于 2020-01-07 04:42:06
问题 I am trying to run the gui program on raspberrypi3 using python3.6.1 and the wx module I'm looking for wxpython_phoenix for the raspbian operating system, but not at https://wxpython.org/Phoenix/snapshot-builds/linux/. Do you mind installing debian8? I am trying to install this by referring to the manual. sudo pip3 install --upgrade --pre -f https://wxpython.org/Phoenix/snapshotbuilds/linux/gtk3/debian-8/wxPython-4.0.0a3.dev3059+4a5c5d9-cp34-cp34m-linux_x86_64.whl But is not it because it is

Adding a button to every row in ListCtrl WxPython

天涯浪子 提交于 2020-01-07 02:44:31
问题 I want to add a radio button / Normal button for every row in ListControl. Can anyone provide some useful hints in doing that ? So, the basic functionality I want to achieve is like this. Against every item added in the list, I want to add a valid / invalid flag which will be populated by user. So every row will have one radio button. Any information in this regard will be helpful 回答1: No, that is not supported by the ListCtrl. You can add a checkbox via the CheckListCtrlMixin though.

How to set the GenericDirCtrl to show custom folder as top directory in wxpython?

隐身守侯 提交于 2020-01-07 01:52:28
问题 I want to show my folder as top directory in wxPython's GenericDirCtrl component. I tried SetPath() and path in my code but it only focuses the selected folder , not making it the top of the tree. In my form's constructor i create it like that: self.folder_tree_project = wx.GenericDirCtrl(self.pnl_edit, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(200, -1), wx.DIRCTRL_3D_INTERNAL | wx.SUNKEN_BORDER, wx.EmptyString, 0) self.folder_tree_project.ShowHidden(False) bSizer5.Add(self

Python: Right click on objectlistview not showing item name selected

浪子不回头ぞ 提交于 2020-01-07 01:50:09
问题 I have been working with example stated under http://wiki.wxpython.org/PopupMenuOnRightClick . The output expected when right clicking on an item would be Perform <action> on <item selected> . However the output I get is Perform <action> on "." The code I used to test the example is: import wx import sys sys.path.append("..") from ObjectListView import ObjectListView, ColumnDefn ### 2. Launcher creates wxMenu. ### menu_titles = [ "Open", "Properties", "Rename", "Delete" ] menu_title_by_id = {

Python: Right click on objectlistview not showing item name selected

旧时模样 提交于 2020-01-07 01:49:29
问题 I have been working with example stated under http://wiki.wxpython.org/PopupMenuOnRightClick . The output expected when right clicking on an item would be Perform <action> on <item selected> . However the output I get is Perform <action> on "." The code I used to test the example is: import wx import sys sys.path.append("..") from ObjectListView import ObjectListView, ColumnDefn ### 2. Launcher creates wxMenu. ### menu_titles = [ "Open", "Properties", "Rename", "Delete" ] menu_title_by_id = {

Instantiating a new WX Python GUI from spawn thread

我的梦境 提交于 2020-01-06 15:48:09
问题 I have main thread that runs a WX Python GUI. The main GUI gives a user a graphical interface to select scripts (which are mapped to python functions) and a 'Start' button, which spawns a second thread (Thread #2) to execute the selected scripts. The problem I am having is I cannot get a new WX GUI (GUI2) to popup and give the user the ability to enter data. # Function that gets invoked by Thread #2 def scriptFunction(): # Code to instantiate GUI2; GUI2 contains wx.TextCtrl fields and a 'Done