Esempio n. 1
0
	def buttonPress(self, widget, gevent):
		if gevent.button == 3:
			self.updateMenu()
			foo, x, y = self.get_window().get_origin()
			y += self.get_allocation().height
			x -= 7 ## ????????? because of menu padding
			## align menu to center:
			x -= int(
				(
					get_menu_width(self.menu) -
					self.get_allocation().width
				) // 2
			)
			self.menu.popup(
				None,
				None,
				lambda *args: (x, y, True),
				None,
				gevent.button,
				gevent.time,
			)
			ui.updateFocusTime()
			return True
		else:
			return False
Esempio n. 2
0
	def buttonPress(self, widget, gevent):
		if gevent.button == 3:
			self.updateMenu()
			foo, x, y = self.get_window().get_origin()
			y += self.get_allocation().height
			x -= 7 ## ????????? because of menu padding
			## align menu to center:
			x -= int(
				(
					get_menu_width(self.menu) -
					self.get_allocation().width
				) // 2
			)
			self.menu.popup(
				None,
				None,
				lambda *args: (x, y, True),
				None,
				gevent.button,
				gevent.time,
			)
			ui.updateFocusTime()
			return True
		else:
			return False
Esempio n. 3
0
 def buttonPress(self, widget, gevent):
     if gevent.button==3:
         self.createMenuLabels()
         foo, x, y = self.get_window().get_origin()
         ## foo == 1 FIXME
         y += self.get_allocation().height
         #if rtl:
         #    x = x - get_menu_width(self.menu) + self.get_allocation().width
         #x -= 7 ## ????????? because of menu padding
         ## align menu to center:
         x -= int((get_menu_width(self.menu) - self.get_allocation().width)//2)
         self.menu.popup(None, None, lambda widget, menu: (x, y, True), None, gevent.button, gevent.time)
         ui.updateFocusTime()
         return True
     else:
         return False