def show(self):
"""Opens a GTK window and puts the heatmap in it. Intelligent enough to work with the GUI as well."""
window_only = 1 #What needs to be destroyed when the window is destroyed?
if HMAP_ENABLED and DISPLAY_ENABLED:
def destroy():
if window_only:
window.destroy()
else:
gtk.main_quit()
gtk.gdk.threads_enter()
window = gtk.Window()
window.set_title("Showing heatmap...")
window.set_border_width(10)
window.set_resizable(False)
window.connect("delete_event", lambda w, e: destroy())
backbone = gtk.HBox(True)
image = gtk.Image()
image.set_from_pixbuf(self._image_to_pixbuf(self.im))
backbone.pack_start(image)
window.add(backbone)
window.show_all()
gtk.gdk.threads_leave()
if gtk.main_level() == 0:
window_only = 0
gtk.main()
else:
raise "HmapError", "Error loading modules or unable to display"
评论列表
文章目录