def __init__(self, **kwargs): """ Constructor root - reference to the wdiget containing this widget """ Button.__init__(self, **kwargs) self["text"] = "Start/Stop"
def __init__(self, cell, master, **kw): Button.__init__(self, master=master, text=' ', command=self.on_click, **kw) self.grid(row=cell.x, column=cell.y) self.cell = cell self.update_cell_color()
def __init__(self, master, **kw): # initialize super class Button.__init__(self, master=master, **kw) # set default background to background self.defaultBackground = self["background"] # bind self.on_enter with "<Enter>" event self.bind("<Enter>", self.on_enter) # bind self.on_leave with "<Leave>" event self.bind("<Leave>", self.on_leave)
def __init__(self, master=None): Button.__init__(self, master) self.master = master self["width"] = 4 self["height"] = 2 self["command"] = self._on_click self["background"] = 'grey' self["borderwidth"] = 1 self["font"] = (12)
def __init__(self, parent=None, exfunc=None, **configs): ''' Constructor ''' Button.__init__(self, parent, **configs) self.bind('<Button-1>', self.click_event) #bind button click event if not configs['text']: self.config(text='...') self.__exfunc = exfunc
def __init__(self, master=None, x=0, y=0, colour=None): Button.__init__(self, master, relief="flat", fg = "#444", font = ("Ariel", 10), bd=0, command=self.command) self.x, self.y = x, y self.select=False if colour: self.pile = [colour] else: self.pile = [] self.colourize() self.pile_size_display()
def __init__(self, parent=None, exFuncs=None, **configs): ''' Constructor ''' Button.__init__(self, parent, **configs) self.bind('<Button-1>', self.click_event) #bind button click event if isinstance(exFuncs, dict): self.__loadfunc = exFuncs.get('loadFunc') self.__setfunc = exFuncs.get('setFunc')
def __init__(self, master, command, file_name): Button.__init__(self, master, bg='SkyBlue4', command=command, activebackground='midnight blue', border=5) image = PhotoImage(file=file_name).subsample(x=4, y=4) self.configure(image=image) self.image = image
def __init__(self, theme, *args, **kwargs): Button.__init__(self, *args, **kwargs) self['bg'] = theme.bg2 self['fg'] = theme.fg self['borderwidth'] = 10 self['relief'] = 'flat' self['activebackground'] = theme.fg self['activeforeground'] = theme.bg self['pady'] = 0 self['padx'] = 2
def __init__(self, parent=None, exFuncs=None, btnText='Button', **configs): ''' Constructor ''' Button.__init__(self, parent, **configs) self.bind('<Button-1>', self.click_event) #bind button click event self.config(text=btnText) if isinstance(exFuncs, dict): self.__selffunc = exFuncs.get('process')
def __init__(self, *args, **kwargs): Button.__init__(self, *args, **kwargs) self['relief'] = FLAT self['fg'] = '#ddd' self['bg'] = foreground self['font'] = font self['cursor'] = 'hand1' self['highlightbackground'] = foreground self['activebackground'] = h_foreground self['activeforeground'] = '#ddd' self['pady'] = 0
def __init__(self, root=None, text="", style=None, command=None): Button.__init__(self, text=text, cursor="hand1", bg=self.__to_background_color(style), bd=0, command=command, width=300 // 4, font=Font(family=CalculatorButton.FONT_FAMILY, size=CalculatorButton.FONT_SIZE)) self.__root = root
def __init__(self, master, highlightthickness=5, bg=globals.BOARD_COLOR.get(), fg=globals.UI_OUTLINE.get(), highlightbackground=globals.UI_OUTLINE.get(), activebackground=globals.UI_OUTLINE.get(), update=True, override=None, relief="flat", *args, **kwargs): Button.__init__(self, master, highlightthickness=highlightthickness, bg=bg, fg=fg, highlightbackground=highlightbackground, activebackground=activebackground, relief=relief, *args, **kwargs) if update: globals.events.setting_change += lambda: self.config(bg=globals.BOARD_COLOR.get(), fg=globals.UI_OUTLINE.get(), highlightbackground=globals.UI_OUTLINE.get(), activebackground=globals.UI_OUTLINE.get()) else: globals.events.setting_change += lambda: self.config(bg=override.get(), fg=globals.UI_OUTLINE.get(), highlightbackground=globals.UI_OUTLINE.get(), activebackground=globals.UI_OUTLINE.get())
def __init__(self, master=None, cnf={}, **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, font=("Droid Sans Mono", "16"))
def __init__(self, master, name, port): Button.__init__(self, master, text=name, width=8, height=3, command=self.buttonEvent) self.pack() self.port = port self.connection = SerialConnection()
def __init__(self, master=None, cnf={}, **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, font=("Droid Sans Mono", "16") )
def __init__(self, master, **kw): bg = window_bg Button.__init__(self, padx = 0, pady = 0, master = master, background = bg, foreground = "black", activebackground = bg, activeforeground = "black", borderwidth = '0', highlightthickness = '0', **kw) self.defaultBackground = self["background"] self.bind("<Enter>", self.on_enter) self.bind("<Leave>", self.on_leave)
def __init__(self, currentWin, winX: int, winY: int): placeX = winX - 30 placeY = 6 fntAwes = Font(family='Font Awesome 5 Free Solid', size=12) Button.__init__(self, currentWin, text="x", command=currentWin.quit, bg=BGCOLOR, fg=FGCOLOR, width="1", padx=5, pady=2, font=fntAwes) # Button.__init__(self,currentWin, text="", command=currentWin.quit, bg=BGCOLOR, fg=FGCOLOR, width="1",padx=5,pady=2,font=fntAwes) self.place(x=placeX, y=placeY)
def __init__(self, pmaster, ptext=None, pcommand=None, pstyle="DEFAULT"): """ Initialization Function :param pmaster: Master Frame :param ptext: Text to display on button :param pcommand: Command button will execute :param pstyle: User-defined style or default as string """ Button.__init__(self, pmaster) self.config(text=ptext) self.config(command=pcommand) try: self.avkbConfigure(AVKButtonStyles[pstyle]) except KeyError: raise AVKButton.InvalidAVKButtonTypeError(pstyle)
def __init__(self, parent=None, exFuncs=None, module=None, **configs): ''' Constructor ''' Button.__init__(self, parent, **configs) self.bind('<Button-1>', self.click_event) self.__module = module if isinstance(exFuncs, dict): self.__before_click_event = exFuncs.get('before') self.__process_click_event = exFuncs.get('process') self.__cancel_click_event = exFuncs.get('cancel') else: self.__before_click_event = None self.__process_click_event = None self.__cancel_click_event = None
def __init__(self, root, chat_name, chat_id, external_id, contacts, new_msgs, client): #todo to add new_msgs parameter to this function Button.__init__(self, root, text=chat_name, command=lambda: self.chat_request(), width=10) self.client = client self.chat_name = chat_name self.chat_id = str(chat_id) self.external_id = str(external_id) self.contacts = contacts.split(',') self.new_msgs = int(new_msgs) if self.new_msgs != 0: print(f"in the boo if, new_msgs = {new_msgs}") self.new_msg_arrived() self.new_msgs = self.new_msgs - 1
def __init__(self, master, level="", **kw): Button.__init__(self, master=master, **kw) self.defaultBackground = self["background"] # default = white if self["activebackground"] == "SystemButtonFace": self["activebackground"] = tbgc # default self["background"] = self["activebackground"] self["fg"] = fc self["font"] = f if self["command"] == "": self["command"] = lambda: MainGame(level) self.bind("<Enter>", self.on_enter) self.bind("<Leave>", self.on_leave)
def __init__(self, string, root, iconstring, menu, view): self.menu = menu self.view = view if iconstring == None: Button.__init__(self, root.interface.frame, text=string, command=self.onclick, relief='flat') else: self.icon = PhotoImage(file=iconstring) Button.__init__(self, root.interface.frame, compound="right", image=self.icon, text=string, command=self.onclick, relief='flat') self.id = str(self) pass
def __init__( self, master: Tk or Frame, text: "Text to appear on Button", bind_ent: "Button background color upon entering" = 'azure', bind_leav: "Button background color upon leaving" = 'origin', height: "Any Integer; Self-explanitory" = 1, width: "Any Integer; Self-explanitory" = 20, relief: "How the button looks on the window" = 'flat', borderwidth: "Any Integer; Self-explanitory" = 0, font: "Format: (Font-family, Font-size)" = ('Papyrus', 40)): ## Init ## Button.__init__(self, master, text=text, height=height, width=width, relief=relief, borderwidth=borderwidth, font=font) self.colors = (bind_ent, bind_leav) ## Init ## ## Bindings ## self._hover(self)
def __init__(self, *args, **kwargs): Button.__init__(self, *args, **kwargs) self.operator = kwargs['text']
def __init__(self, master, **kw): Button.__init__(self, master=master, **kw) self.defaultBackground = self["background"] self.bind("<Enter>", self.on_enter) self.bind("<Leave>", self.on_leave)
def __init__(self, root, **kw): Button.__init__(self, root, command=self.switch, **kw)
def __init__(self, labels=0, parent=None, **configs): Button.__init__(self, parent, **configs) self.config(text='New Window!', command=self.__call__) self.config(bg='green', fg='yellow', padx=10, pady=2, cursor='hand2') self.pack(expand=YES, fill=BOTH) self.labels = labels
def __init__(self, master, row, column): Button.__init__(self, master) self.row = row self.column = column
def __init__(self, *args, **kwargs): Button.__init__(self, *args, **kwargs) self.value = kwargs['text']
def __init__(self, parent=None, **kwargs): Button.__init__(self, parent, **kwargs)
def __init__(self, *args, **kwargs): Button.__init__(self, *args, **kwargs) self.__configure()
def __init__(self, root, text="", width="", height="", value=""): Button.__init__(self, root, text=text, width=width, height=height) self.value = value
def __init__(self, master, label, function_callbak): Button.__init__(self, master) self._nom_fn_callback = function_callbak self._label = label self.config(text=self._label, command=self._nom_fn_callback)
def __init__(self, master, command, file_name): Button.__init__(self, master, bg="SkyBlue4", command=command, activebackground="midnight blue", border=5) image = PhotoImage(file=file_name).subsample(x=4, y=4) self.configure(image=image) self.image = image