예제 #1
1
파일: Cell.py 프로젝트: edgul/game_of_life
    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
파일: testTk.py 프로젝트: intohole/pg-tool
 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
     )
예제 #9
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
파일: PButton.py 프로젝트: intohole/pg-tool
 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)