def on_gremlin_clicked(self, widget, event, data=None):
if event.type == gtk.gdk._2BUTTON_PRESS:
self.clear_live_plotter()
# Settings
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
menu = gtk.Menu()
program_alpha = gtk.CheckMenuItem("Program alpha")
program_alpha.set_active(self.program_alpha)
program_alpha.connect("activate", self.toggle_program_alpha)
menu.append(program_alpha)
show_limits = gtk.CheckMenuItem("Show limits")
show_limits.set_active(self.show_limits)
show_limits.connect("activate", self.toggle_show_limits)
menu.append(show_limits)
show_extents = gtk.CheckMenuItem("Show extents")
show_extents.set_active(self.show_extents_option)
show_extents.connect("activate", self.toggle_show_extents_option)
menu.append(show_extents)
live_plot = gtk.CheckMenuItem("Show live plot")
live_plot.set_active(self.show_live_plot)
live_plot.connect("activate", self.toggle_show_live_plot)
menu.append(live_plot)
# lathe = gtk.CheckMenuItem("Lathe mode")
# lathe.set_active(self.lathe_option )
# lathe.connect("activate", self.toggle_lathe_option)
# menu.append(lathe)
menu.popup(None, None, None, event.button, event.time)
menu.show_all()
评论列表
文章目录