pygtk

Making rows in a GTK TreeView unselectable

人走茶凉 提交于 2021-02-18 08:48:09
问题 I want to make select rows of a PyGTK Tree-view (coupled to a List Store) un-selectable and if possible,greyed out. Is there a way to do this? 回答1: This is a bit hackish minimal code, but it will make it impossible to select the middle row ('B'). If you wish that the previous selection should be remembered it ought to be quite easy to just store which rows are selected at the end of the signal-callback and overwrite current selection if a bad row was selected. As for the individual rows and

closing of matplotlib.pyplot closes parent window also

╄→гoц情女王★ 提交于 2021-02-10 15:14:08
问题 I am a beginner with matplotlib. I am trying to generate bar chart on click of a button, which is working as expected. The problem is, I dont want the parent window i.e the window with "Hello World" button to be closed when I close the pyplot i.e bar chart window. I want only the pyplot to be closed when I click "x" on it. import pygtk pygtk.require('2.0') import gtk import matplotlib.pyplot as plt; plt.rcdefaults() import numpy as np import matplotlib.pyplot as plt class HelloWorld: def _

closing of matplotlib.pyplot closes parent window also

南笙酒味 提交于 2021-02-10 15:06:48
问题 I am a beginner with matplotlib. I am trying to generate bar chart on click of a button, which is working as expected. The problem is, I dont want the parent window i.e the window with "Hello World" button to be closed when I close the pyplot i.e bar chart window. I want only the pyplot to be closed when I click "x" on it. import pygtk pygtk.require('2.0') import gtk import matplotlib.pyplot as plt; plt.rcdefaults() import numpy as np import matplotlib.pyplot as plt class HelloWorld: def _

closing of matplotlib.pyplot closes parent window also

亡梦爱人 提交于 2021-02-10 15:06:23
问题 I am a beginner with matplotlib. I am trying to generate bar chart on click of a button, which is working as expected. The problem is, I dont want the parent window i.e the window with "Hello World" button to be closed when I close the pyplot i.e bar chart window. I want only the pyplot to be closed when I click "x" on it. import pygtk pygtk.require('2.0') import gtk import matplotlib.pyplot as plt; plt.rcdefaults() import numpy as np import matplotlib.pyplot as plt class HelloWorld: def _

Resizing gtk widgets by user

荒凉一梦 提交于 2021-02-08 07:26:51
问题 I am working on a project in python using gtk and in it the is a gtk notebook on top of a vte console. I am having trouble getting it to be resizable by the user (i.e. I want the user to be able to drag the border of the 2 up and down and resize both accordingly). Could anyone point me in the right direction on how to do this? 回答1: Try this: vpan = gtk.VPaned() vpan.show() vpan.pack1(box1, shrink=False) vpan.pack2(box2, shrink=False) 来源: https://stackoverflow.com/questions/4560048/resizing

Force background of matplotlib figure to be transparent

余生长醉 提交于 2021-02-07 14:44:26
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as

Force background of matplotlib figure to be transparent

橙三吉。 提交于 2021-02-07 14:44:25
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as

Force background of matplotlib figure to be transparent

偶尔善良 提交于 2021-02-07 14:43:19
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as

How do I install PyGObject?

耗尽温柔 提交于 2021-02-07 09:48:32
问题 I am trying to install PyGtk on windows 7 for Python 2.7, but when go to use pip to install PyGtk it says i need PyGObject (Go figure) so I installed the Visual C++ package for Python (I know I have the correct version) and tried using pip to install PyGObject but it keeps comming out with an error message saying that cairo.h is missing, and sure enough I check in the directory and it wasn't there. How on earth am I supposed to install PyGObject? 回答1: There's a quite long way, and it needs

How do I install PyGObject?

无人久伴 提交于 2021-02-07 09:47:14
问题 I am trying to install PyGtk on windows 7 for Python 2.7, but when go to use pip to install PyGtk it says i need PyGObject (Go figure) so I installed the Visual C++ package for Python (I know I have the correct version) and tried using pip to install PyGObject but it keeps comming out with an error message saying that cairo.h is missing, and sure enough I check in the directory and it wasn't there. How on earth am I supposed to install PyGObject? 回答1: There's a quite long way, and it needs