示例#1
1
    def __init__(self, master, index, callback=None):
        Button.__init__(self, master)
        CellModel.__init__(self, index)

        # register a callback
        self.callback = callback
        self.config(command=self.clicked)

        self.refresh()
示例#2
0
 def __init__(self, master=None, x=0, y=0, t='', width=100, height=100, paddingX=20, paddingY=20, cnf={}, **kw):
     Button.__init__(self, master=master, text=t, cnf=cnf, **kw)
     self.x = x*width+x*paddingX
     self.y = y*height+y*paddingY
     self.width = width
     self.height = height
     self.padX = paddingX
     self.padY = paddingY
     self.place(x=self.x,y=self.y,width=self.width,height=self.height)
示例#3
0
文件: widgets.py 项目: hrchu/mtx-gui
 def __init__(self, parent, device,row):
     self._defaultcolor = parent.cget('bg')
     self._device = device
     self._text = device.device
     self._icon = PhotoImage(file='%s/%s'%(_imagepath,'mc.gif'))
     Button.__init__(self, master=parent, image=self._icon,
                     text=self._text, compound='left')
     self.grid(padx=10,pady=10, column = 0, stick='ew')
     self.bind("<Button-1>",self.onClick)
     self.master.grid_columnconfigure(0,minsize=280)
示例#4
0
    def __init__(self, parent, text, command, relx, rely):
        self.text = text
        self.command = command
        self.relx = relx
        self.rely = rely

        Button.__init__(self, parent)

        self.configure_()
        self.place_()
示例#5
0
    def __init__(self, parent, bgcolor, img, command, relx, rely):
        self.bgcolor = bgcolor
        self.img = img
        self.command = command
        self.relx = relx
        self.rely = rely

        Button.__init__(self, parent)

        self.configure_()
        self.place_()
示例#6
0
 def __init__(self, frame=None, text='', command=None):
     if frame and not (isinstance(frame, Window) and text):
         raise TypeError
     if command:
         pass
     elif not command and frame:
         command = frame.quit
     else:
         command = None
     Button.__init__(self, frame, text='', fg='red', command=command)
     self.pack()
 def __init__(self, parent=None, server_id=0, handler=[], **kw):
     '''
     Constructor
     '''
     self.server_id = server_id
     self.start = False
     Button.__init__(self, parent, kw)
     self.func = handler
     #(lambda sid=self.server_id: handler(sid))
     
     self.config(command=self.switch_state_and_exec)
示例#8
0
 def __init__(self, master=None, cnf={}, **kw):
     Button.__init__(self, master, cnf, **kw)
     self.config(
         compound=TOP,
         relief=FLAT,
         bd=0,
         bg="#b91d47",  # dark-red
         fg="white",
         activebackground="#b91d47",  # dark-red
         activeforeground="white",
         highlightthickness=0
     )
    def __init__(self, root, master, cnf={}, **kw):
        self.__bindMap = []  # bind map to be bound once toggled
        self.isToggled = False  # internal var to keep track of toggling
        self.__root = root  # root variable for setting the cursor
        self.__cursor = ''  # cursor private var
        self.__destructor = None  # destructor var called when untoggled
        self.__cid_stack = []
        self.__master = master

        Button.__init__(self, master, cnf, **kw)  # call button constructor
        self.configure(command=self.toggle)  # button command is always toggle
        toggleContainer.append(self)  # push button to static container
示例#10
0
    def __init__(self, root, master=None, func=None, cnf={}, **kw):
        if not cnf:
            cnf = {}
        self.isToggled = False  # internal var to keep track of toggling
        self.__root = root  # root variable for setting the cursor
        self.__cursor = ''  # cursor private var
        self.__master = master
        self.__func = func

        Button.__init__(self, master, cnf, **kw)  # call button constructor
        self.configure(command=self.toggle)  # button command is always toggle
        toggleContainer.append(self)  # push button to static container
示例#11
0
文件: pimenu.py 项目: u53r55/pimenu
    def __init__(self, master=None, cnf=None, **kw):
        Button.__init__(self, master, cnf, **kw)

        self.config(
            compound=TkC.TOP,
            relief=TkC.FLAT,
            bd=0,
            bg="#b91d47",  # dark-red
            fg="white",
            activebackground="#b91d47",  # dark-red
            activeforeground="white",
            highlightthickness=0)
示例#12
0
文件: board.py 项目: Avox3/Chess
    def __init__(self, parent, row, col, bg, *args, **kwargs):
        """
        Create square.
        :param parent: the layer on which it exists
        :param row: x coordinate on the board
        :param col: y coordinate on the board
        """

        Button.__init__(self, parent, bg=bg, *args, **kwargs)
        self.row = row
        self.col = col
        self.bg = bg
示例#13
0
    def __init__(self, master=None, cnf=None, **kw):
        Button.__init__(self, master, cnf, **kw)

        self.config(
            compound=TkC.TOP,
            relief=TkC.FLAT,
            bd=0,
            bg="#004E66",  # petrol blue - Button background
            fg="#BABFD1",  # light grey - text color
            activebackground="#006787",  # light petrol blue - Button background highlight level 2
            activeforeground="#ffffff",  # white - text highlight level 2
            highlightthickness=0 # button border size
        )
示例#14
0
文件: pimenu.py 项目: dmpop/pimenu
 def __init__(self, master=None, cnf={}, **kw):
     Button.__init__(self, master, cnf, **kw)
     # self.pack()
     self.config(
         compound=TkC.TOP,
         relief=TkC.FLAT,
         bd=0,
         bg="#b91d47",  # dark-red
         fg="white",
         activebackground="#b91d47",  # dark-red
         activeforeground="white",
         # height=118,
         #width=104,
         highlightthickness=0
     )
示例#15
0
文件: pimenu.py 项目: senspix/medimi
    def __init__(self, master=None, cnf={}, **kw):
        Button.__init__(self, master, cnf, **kw)
        # self.pack()
        self.config(compound=TkC.TOP,
            relief=TkC.RAISED,
            bd=6,
            bg="#E1E0E0",  # dark-red default vale
            fg="black",
            activebackground="#E1E0E0",  # dark-red default value
#            activeforeground="white",
            activeforeground="black",
            #height=80,
            #width=90,
            highlightthickness=0,
            font=('Sans',14),
        )
示例#16
0
 def __init__(self, parent, passivetext, activetext, clbPlaying = None):
     """Initiate
     
     Arguments
     parent -- the parent tkinter item
     passivetext -- text to display when the sound is not playing
     activetext -- text to display when the sound is playing
     clbPlaying -- callback to call whenever the state changes
     
     """
     #Set the width of the button explicitly to avoid a resize when the test is changed
     bwidth = max(len(passivetext), len(activetext))
     Button.__init__(self, parent, text = passivetext, width = bwidth, state = DISABLED, 
                     command = self._ehPressed)
     self._texts = dict()
     self._texts[True] = activetext
     self._texts[False] = passivetext
     self._sound = ''
     self._playing = False
     self._soundplayer = _SoundPlayer(self, self._clbEnd)
     self._clbPlaying = clbPlaying
示例#17
0
 def __init__(self,master,var,**kwargs):
     
     if not isadatatype(var):
         raise Exception('arg datatype must be a valid type')
     
     _tkbutton.__init__(self,master,**kwargs)
示例#18
0
 def __init__(self, *args, **kwargs):
     Button.__init__(self, *args, **kwargs)
     self["command"] = self.press_num
示例#19
0
文件: ui.py 项目: Battleroid/3ttt
 def __init__(self, master=None, pos=None, **kwargs):
     Button.__init__(self, master, **kwargs)
     self.pos = pos
示例#20
0
文件: ui.py 项目: cltnschlosser/3ttt
 def __init__(self, master=None, pos=None, **kwargs):
     Button.__init__(self, master, **kwargs)
     self.pos = pos
示例#21
0
 def __init__(self, parent):
     Button.__init__(self, parent, text="Get movie data")
示例#22
0
 def __init__(self, master, no_bg=False, **kwargs):
     if (not no_bg) and 'bg' not in kwargs:
         kwargs['bg'] = "#ccc"
     kwargs['relief'] = FLAT
     Button.__init__(self, master, **kwargs)
示例#23
0
 def __init__(self, master=None, title='', command=None):
     Button.__init__(self, master=master, text=title, command=command)
     self.__name = title
示例#24
0
 def __init__(self, master, controller, sr_map, **kw):
     Button.__init__(self, master, **kw)
     self.master = master
     self.controller = controller
     self.sr_map = sr_map
示例#25
0
 def __init__(self, master=None, color=None, cnf={}, **kw):
     Button.__init__(self, master, kw)
     self['border'] = 1
     self.bgc = self['bg']
     self.set_color(color)
 def __init__(self, master, controller, checkerboard, **kw):
     Button.__init__(self, master, **kw)
     self.master = master
     self.controller = controller
     self.checkerboard = checkerboard
     self.chosen = False
示例#27
0
 def __init__(self, parent):
     Button.__init__(self, parent, text="Get movie data")
示例#28
0
	def __init__(self,root,**kwargs):
		Button.__init__(self,root,**kwargs)

		self.store_initial_state()
示例#29
0
 def __init__(self, *args, **kwargs):
     Button.__init__(self, *args, **kwargs)
     self["command"] = self.press_num
示例#30
0
	def __init__(self, master=None, color=None, cnf={}, **kw):
		Button.__init__(self, master, kw)
		self['border'] = 1
		self.bgc = self['bg']
		self.set_color(color)
示例#31
0
    def __init__(self, master, var, **kwargs):

        if not isadatatype(var):
            raise Exception('arg datatype must be a valid type')

        _tkbutton.__init__(self, master, **kwargs)