wxpython

onclick method on a colorbar matplotlib python

穿精又带淫゛_ 提交于 2019-12-21 21:58:53
问题 I have a colorbar and a graph. I was wondering if you can use the onclick method on a colorbar that will then do something on the graph. So click on a particular color portion of the colorer then something happens I know how to do the bit that i want to happen. I just want to know how to set the colorbar to allow on click 回答1: Sure! Just do something like cbar.ax.set_picker(tolerance) . As a quick example, this will highlight values in the image near the value you click on the colorbar:

using travis-ci with wxpython tests

若如初见. 提交于 2019-12-21 21:29:16
问题 I'm trying to add some wxPython tests to work with travis-ci, but I can't figure out how to install wxPython in the build environment. I used brew to install wxPython on my computer, but I can't get brew to work with travis-ci. In the travis-ci docs, it appears that brew should come built-in: http://docs.travis-ci.com/user/installing-dependencies/#Installing-Mac-Packages, but as far as I can tell it doesn't. If I try to use brew, I get this error message: $ brew update /home/travis/build.sh:

Embedding a networkx graph into wxPython with matplotlib

試著忘記壹切 提交于 2019-12-21 20:39:31
问题 I've created a graph with networkx. G=nx.DiGraph() # ... building the graph ... # and I can display it with matplotlib like this: nx.draw(G) matplotlib.pyplot.show() But what I would like to do is, starting from the following example, to embed the created graph into wxPython. For the beginning I would like just to print it; no user interaction at all. from numpy import arange, sin, pi import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as

How to make a .exe for Python with good graphics?

岁酱吖の 提交于 2019-12-21 19:58:48
问题 I have a Python application and I decided to do a .exe to execute it. This is the code that I use to do the .exe: # -*- coding: cp1252 -*- from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "SoundLog.py"}], zipfile = None, packages=[r"C:\Users\Public\SoundLog\Code\Código Python\SoundLog\Auxiliar", r"C:\Users\Public\SoundLog\Code\Código Python\SoundLog\Plugins"], ) But when I run my

Running wxPython after closing Tkinter

▼魔方 西西 提交于 2019-12-21 19:58:47
问题 We have two apps, one developed with a Tkinter interface and another built using wxPython. Both are fairly sophisticated. When finished running the Tkinter app, I would like to have the wxPython app run after selecting a button in the Tkinter app. Is there away to switch event loops so that the Tkinter app can switch to the wxPython GUI seamlessly? While the following does work after root.destroy in the Tkinter app: os.system('python wxGUI.py') The final program needs to be bundled into a

Fullscreen Python TKinter or wxPython window, but 'stay at the bottom' of all windows?

余生长醉 提交于 2019-12-21 16:49:57
问题 I want to create a fullscreen panel that visually blocks access to everything on the screen (desktop, menu, Unity Panel, etc in Ubuntu (11.10)), but stays below other applications' opened windows. This is mainly to make the laptop child proof. I want the kid (4 years old) to have access to some selected apps ie. gcompris, childs play, tux math, etc. but not really to other apps and settings. Something like custom desktop + launcher panel without anything to break, no access to files, etc. I

Efficient Image Thumbnail Control for Python?

浪尽此生 提交于 2019-12-21 05:42:09
问题 What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently visible to user. 回答1: In wxPython you can use wxGrid for this as it supports virtual mode and custom cell renderers. This is the minimal interface you have to implement for a wxGrid "data provider": class GridData(wx.grid.PyGridTableBase):

Double buffering with wxpython

此生再无相见时 提交于 2019-12-21 04:16:50
问题 I'm working on an multiplatform application with wxpython and I had flickering problems on windows, while drawing on a Panel. I used to draw on a buffer (wx.Bitmap) during mouse motions events and my OnPaint method was composed of just on line: dc = wx.BufferedPaintDC(self, self.buffer) Pretty standard but still I had flickering problems on Windows, while everything worked fine on Linux. I solved my problem calling SetDoubleBuffered(True) in the __init__ method. The strange thing is that now

How to create a custom GUI for a python program?

不羁岁月 提交于 2019-12-20 23:26:45
问题 I want to create a GUI for a python program with a custom design, I have a mock-up in Photoshop and I'm looking for a library that supports theme or any other library that can do the job. My GUI design contains gradients, borders, border radius, and a custom title bar with custom minimize and close buttons, for example take a look at the Github client for Windows, or any Adobe software installer. I tried wxPython, I used style=wx.NO_BORDER to remove the title bar and the default border added

Getting String from A TextCtrl Box

折月煮酒 提交于 2019-12-20 10:38:30
问题 How to get the strings from a TextCtrl box? Here is the practice code: import wx class citPanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id) wx.StaticText(self, -1, "Choose put you would like:", (45, 15)) self.quote = wx.StaticText(self, -1, "1:", wx.Point(275, 180), wx.Size(200, -1)) self.quote = wx.StaticText(self, -1, "2:", wx.Point(275, 230), wx.Size(200, -1)) self.quote = wx.StaticText(self, -1, "3:", wx.Point(275, 280), wx.Size(200, -1)) class