Exemple #1
0
    def __init__(self,
                 master,
                 values,
                 command=None,
                 args=(),
                 variable=None,
                 **kw):

        kw['style'] = 'TComboSmall'
        if variable is not None:
            kw['textvariable'] = variable
        self.variable = variable
        WidgetWithCommand.__init__(self)
        Widget.__init__(self, master, "ttk::menubutton", kw)
        if command:
            self.set_command(command, args)

        entries = []
        for value in values:
            entries.append(
                ComboCommand(value, command=self.choose_opt, args=value))

        self.__menu = ComboMenu(self,
                                entries,
                                auto_update=0,
                                name="menu",
                                tearoff=0)

        menu = self.__menu.menu
        self.menuname = menu._w
        self["menu"] = menu
Exemple #2
0
	def __init__(self, master, values, command = None, args = (), variable = None, **kw):

		kw['style'] = 'TComboSmall'
		if variable is not None:
			kw['textvariable'] = variable
		self.variable = variable
		WidgetWithCommand.__init__(self)
		Widget.__init__(self, master, "ttk::menubutton", kw)
		if command:
			self.set_command(command, args)

		entries = []
		for value in values:
			entries.append(ComboCommand(value, command = self.choose_opt, args = value))
			
		self.__menu = ComboMenu(self, entries, auto_update = 0, name="menu", tearoff=0)

		menu = self.__menu.menu
		self.menuname = menu._w
		self["menu"] = menu
Exemple #3
0
 def destroy(self):
     WidgetWithCommand.clean_up(self)
     TMenubutton.destroy(self)
     self.__menu = None
Exemple #4
0
	def destroy(self):
		WidgetWithCommand.clean_up(self)
		TMenubutton.destroy(self)
		self.__menu = None