wxpython

Wxpython browse for or drag and drop folder

浪子不回头ぞ 提交于 2019-12-12 01:11:41
问题 I currently have this code below to manualy get a directory path, I would like to add drag and drop as well, so I could drag and drop the folder into the window. self.pathindir1 = wx.TextCtrl(self.panel1, -1, pos=(35, 120), size=(300, 25)) self.buttonout = wx.Button(self.panel1, -1, "Open", pos=(350,118)) self.buttonout.Bind(wx.EVT_BUTTON, self.openindir1) def openindir1(self, event): global indir1 dlg = wx.DirDialog(self, "Choose a directory:", style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR

wxPython how to put a text in TextCtrl with a button inserted by “Add” Button

99封情书 提交于 2019-12-12 00:19:28
问题 I'm using wxPython to build some GUI... Indeed it isn't an easy program... Many many user inputs and outputs to be generated... One part of the program I put an "Add" button that will dynamically add a TextCtrl field and an "Open" button to open a file. After clicking in the "Open" the user can select a file, the file pathway is therefore showed in the TextCtrl field. Indeed, using a simple example (one TextCtrl one button) I can handle it... But in a dynamically way, putting several TextCtrl

Only one button in a panel with multiple togglebuttons changes color - wxPython

馋奶兔 提交于 2019-12-11 22:05:40
问题 I want to set the color of a toggle button of my choice in the panel that I have created. The problem is that in the numerous toggle buttons that I have displayed on my panel when I want to change the color of each one only the color of the last button changes. Here's my code: import wx class Frame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None) self.panel = wx.Panel(self,wx.ID_ANY) self.sizer = wx.BoxSizer(wx.VERTICAL) self.flags_panel = wx.Panel(self, wx.ID_ANY, style = wx

Installing wxPython in Ubuntu 12.10

空扰寡人 提交于 2019-12-11 21:12:59
问题 I am trying to install wxPython on my Ubuntu 12.10 but with no success. I have gone through all the answers given on this website. Can someone please help me in this or point me in the right direction. Initially, I tried http://wxpython.org/BUILD.html but then I came to know that it is in the repository, I ran " sudo apt-get install install python-wxgtk2.8 ", it installed without any error but then, when I run it, it is still unavailable. I guess I am doing something in the running step. Also

Threading not working

痞子三分冷 提交于 2019-12-11 20:38:18
问题 I am trying to get this little file copy application working which shows a progress bar, but I am not understanding why this won't work, as it locks up the gui whilst updating the gauge. import shutil import os import threading import wx class MyFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) self.source = os.path.expanduser("~/Desktop/FolderToCopy") self.destination = os.path.expanduser("~/Desktop/BackupFolder/Temp") panel = wx.Panel(self,

How do I control the viewport of a Grid in wxPython?

我们两清 提交于 2019-12-11 18:19:59
问题 I'm trying to implement Find functionality in my grid application. I can move the cursor using SetGridCursor(self, row, col) , but I can't figure out how to move the "viewport" of the grid to the new cursor position. In other words, when the cursor is moved to the cell the user is looking for, the user still has to manually scroll around until he finds the cursor cell. How do I programmatically scroll the grid so I can centre the grid cursor in the viewport? By random, while writing this

How to use wxSpellCheckerDialog in Django?

眉间皱痕 提交于 2019-12-11 17:47:04
问题 According to pyenchant documentation usage is follows, >> import wx >> from enchant.checker import SpellChecker >> from enchant.checker.wxSpellCheckerDialog import wxSpellCheckerDialog >> >> app = wx.PySimpleApp() >> text = "This is sme text with a fw speling errors in it. Here are a fw more to tst it ut." >> dlg = wxSpellCheckerDialog(None,-1,"") >> chkr = SpellChecker("en_US",text) >> dlg.SetSpellChecker(chkr) >> dlg.Show() >> app.MainLoop() This opens spell correction dialogbox. So how can

how to set Cancel button when you press it in pyProgress

本小妞迷上赌 提交于 2019-12-11 17:08:14
问题 Hello I use wxpython 4 and windows10 .I want to integrate PyProgress (AGW) in my App with the Cancel button and I would like this button Cancel put my App Paused . except that I have add the cancel button but it is not clickable and I can not Bind a pause function with this button. import wx.lib.agw.pyprogress as PP def onButton(self, event): """ Based on the wxPython demo by the same name """ event.Skip() dlg = PP.PyProgress(None, -1, "Demo", "Demo in progress", agwStyle=wx.PD_APP_MODAL | wx

wx Import Error

半城伤御伤魂 提交于 2019-12-11 16:49:19
问题 I am trying to run this code. Previously, it was giving No module wx as an error. Then I downloaded the wx module and now it is giving this error: Traceback (most recent call last): File "C:\Python24\player.py", line 2, in -toplevel- import wx File "C:\Python24\wx__init__.py", line 45, in -toplevel- from wxPython import wx File "C:\Python24\wxPython__init__.py", line 20, in -toplevel- import wxc ImportError: DLL load failed: The specified module could not be found. Here is my code: import os

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