def __init__(self, master): self.root = master # console widget disable = lambda *e: None Menu.__init__(self, master.root, tearoff=0, postcommand=self.update) self.add_command(label="Undo", command=disable, accelerator="Ctrl+Z", state=DISABLED) self.add_command(label="Redo", command=disable, accelerator="Ctrl+Y", state=DISABLED) self.add_separator() self.add_command(label="Copy", command=self.root.copy, accelerator="Ctrl+C") self.add_command(label="Cut", command=disable, accelerator="Ctrl+X", state=DISABLED) self.add_command(label="Paste", command=disable, accelerator="Ctrl+V", state=DISABLED) self.add_separator() self.add_command(label="Select All", command=self.root.select_all, accelerator="Ctrl+A") self.bind("<FocusOut>", self.hide) # hide when clicked off
def __init__(self, root): Menu.__init__(self, root) menu_about = Menu(self, tearoff=0) menu_about.add_command(label=u"说明", command=self.showIntro) menu_about.add_command(label=u"关于", command=self.showAbout) self.add_command(label=u"部署", command=self.showDeploy) self.add_cascade(label=u"帮助", menu=menu_about)
def __init__(self, master): self.root = master Menu.__init__(self, master.root, tearoff=0, postcommand=self.update) self.add_command(label="Undo", command=self.root.undo, accelerator="Ctrl+Z") self.add_command(label="Redo", command=self.root.redo, accelerator="Ctrl+Y") self.add_separator() self.add_command(label="Copy", command=self.root.copy, accelerator="Ctrl+C") self.add_command(label="Cut", command=self.root.cut, accelerator="Ctrl+X") self.add_command(label="Paste", command=self.root.paste, accelerator="Ctrl+V") self.add_separator() self.add_command(label="Select All", command=self.root.select_all, accelerator="Ctrl+A") self.bind("<FocusOut>", self.hide) # hide when clicked off
def __init__(self, master, **kwargs): self.root = master Menu.__init__(self, master.root, tearoff=0) self.add_command(label="Undo", state=DISABLED) self.add_command(label="Redo", state=DISABLED) self.add_separator() self.add_command(label="Copy", command=self.root.edit_copy) self.add_command(label="Cut", state=DISABLED) self.add_command(label="Paste", state=DISABLED) self.add_separator() self.add_command(label="Select All", command=self.root.select_all)
def __init__(self, master=None, andInside=False, binder=None, **args): try: del args["tearoff"] except: pass if not binder: binder = master if not hasattr(master, "tk"): master = master.canvas self.binder = binder Menu.__init__(self, master, tearoff=0, **args) self.binder.bind("<Button-3>", self.right_menu_event) self.__bind_inside_of(binder)
def __init__(self, root, gui): Menu.__init__(self) self.filemenu = Menu(self, tearoff=0) self.filemenu.add_command(label="Logout") self.filemenu.add_command(label="Print...") self.filemenu.add_separator() self.filemenu.add_command(label="Exit", command=root.destroy) self.add_cascade(label="File", menu=self.filemenu) self.adminmenu = Menu(self, tearoff=0) self.adminmenu.add_command(label="Database") self.adminmenu.add_command(label="Users") self.add_cascade(label="Admin", menu=self.adminmenu) self.helpmenu = Menu(self, tearoff=0) self.helpmenu.add_command(label="About") self.helpmenu.add_command(label="Help") self.add_cascade(label="Help", menu=self.helpmenu)
def __init__(self, master, **kwargs): self.root = master Menu.__init__(self, master.root, tearoff=0) self.add_command(label="Undo", state=DISABLED, accelerator="{}+Z".format(ctrl)) self.add_command(label="Redo", state=DISABLED, accelerator="{}+Y".format(ctrl)) self.add_separator() self.add_command(label="Copy", command=self.root.edit_copy, accelerator="{}+C".format(ctrl)) self.add_command(label="Cut", state=DISABLED, accelerator="{}+X".format(ctrl)) self.add_command(label="Paste", state=DISABLED, accelerator="{}+V".format(ctrl)) self.add_separator() self.add_command(label="Select All", command=self.root.select_all, accelerator="{}+A".format(ctrl)) self.bind("<FocusOut>", self.hide) # hide when clicked off
def __init__(self, *args, **kwargs): Menu.__init__(self, *args, **kwargs) self.create_widgets() self.master = args[0]
def __init__(self, master, visible=True): self.root = master Menu.__init__(self, master.root) # "ticked" menu options self.sc3_plugins = BooleanVar() self.sc3_plugins.set(SC3_PLUGINS) self.cpu_usage = IntVar() self.cpu_usage.set(CPU_USAGE) self.latency = IntVar() self.latency.set(CLOCK_LATENCY) # File menu filemenu = Menu(self, tearoff=0) filemenu.add_command(label="New Document", command=self.root.newfile, accelerator="Ctrl+N") filemenu.add_command(label="Open", command=self.root.openfile, accelerator="Ctrl+O") filemenu.add_command(label="Save", command=self.root.save, accelerator="Ctrl+S") filemenu.add_command(label="Save As...", command=self.root.saveAs) self.add_cascade(label="File", menu=filemenu) # Edit menu editmenu = Menu(self, tearoff=0) editmenu.add_command(label="Undo", command=self.root.undo, accelerator="Ctrl+Z") editmenu.add_command(label="Redo", command=self.root.redo, accelerator="Ctrl+Y") editmenu.add_separator() editmenu.add_command(label="Cut", command=self.root.edit_cut, accelerator="Ctrl+X") editmenu.add_command(label="Copy", command=self.root.edit_copy, accelerator="Ctrl+C") editmenu.add_command(label="Paste", command=self.root.edit_paste, accelerator="Ctrl+V") editmenu.add_command(label="Select All", command=self.root.select_all, accelerator="Ctrl+A") editmenu.add_separator() editmenu.add_command(label="Increase Font Size", command=self.root.zoom_in, accelerator="Ctrl+=") editmenu.add_command(label="Decrease Font Size", command=self.root.zoom_out, accelerator="Ctrl+-") editmenu.add_separator() editmenu.add_command(label="Clear Console", command=self.root.clear_console) editmenu.add_command(label="Export Console Log", command=self.root.export_console) editmenu.add_command(label="Toggle Console", command=self.root.toggle_console) editmenu.add_separator() editmenu.add_command(label="Toggle Menu", command=self.root.toggle_menu, accelerator="Ctrl+M") editmenu.add_checkbutton(label="Toggle Window Transparency", command=self.root.toggle_transparency, variable=self.root.transparent) editmenu.add_checkbutton(label="Toggle Auto-fill Prompt", command=self.root.toggle_prompt, variable=self.root.show_prompt) self.add_cascade(label="Edit", menu=editmenu) # Note: Alt renders properly to look like Option, so we don't need a # conditional for those shortcuts codemenu = Menu(self, tearoff=0) codemenu.add_command(label="Evaluate Block", command=self.root.exec_block, accelerator="{}+Return".format(ctrl)) codemenu.add_command(label="Evaluate Line", command=self.root.exec_line, accelerator="Alt+Return") codemenu.add_command(label="Clear Scheduling Clock", command=self.root.killall, accelerator="{}+.".format(ctrl)) codemenu.add_separator() codemenu.add_checkbutton(label="Use SC3 Plugins", command=self.root.toggle_sc3_plugins, variable=self.sc3_plugins) codemenu.add_separator() codemenu.add_checkbutton(label="Listen for connections", command=self.root.allow_connections, variable=self.root.listening_for_connections) self.add_cascade(label="Language", menu=codemenu) # Help helpmenu = Menu(self, tearoff=0) helpmenu.add_command(label="Display help message", comman=self.root.help, accelerator="{}+{}".format( ctrl, self.root.help_key)) helpmenu.add_command(label="Visit FoxDot Homepage", command=self.root.openhomepage) helpmenu.add_command(label="Documentation", command=self.root.opendocumentation) helpmenu.add_separator() cpu_menu = Menu(self, tearoff=0) cpu_menu.add_radiobutton(label="Low", variable=self.cpu_usage, value=0, command=self.set_cpu_usage) cpu_menu.add_radiobutton(label="Medium", variable=self.cpu_usage, value=1, command=self.set_cpu_usage) cpu_menu.add_radiobutton(label="High", variable=self.cpu_usage, value=2, command=self.set_cpu_usage) helpmenu.add_cascade(label="CPU Usage", menu=cpu_menu) lat_menu = Menu(self, tearoff=0) lat_menu.add_radiobutton(label="Low", variable=self.latency, value=0, command=self.set_latency) lat_menu.add_radiobutton(label="Medium", variable=self.latency, value=1, command=self.set_latency) lat_menu.add_radiobutton(label="High", variable=self.latency, value=2, command=self.set_latency) helpmenu.add_cascade(label="Clock Latency", menu=lat_menu) helpmenu.add_separator() helpmenu.add_command(label="Open Samples Folder", command=self.root.open_samples_folder) helpmenu.add_command(label="Open config file (advanced)", command=self.root.open_config_file) self.add_cascade(label="Help & Settings", menu=helpmenu) # Tutorials tutorialmenu = Menu(self, tearoff=0) for tutorial in GET_TUTORIAL_FILES(): filename = os.path.basename(tutorial) if filename.endswith(".py"): filename = filename.replace(".py", "") data = filename.split("_") num = data[0] name = " ".join(data[1:]).title() tutorialmenu.add_command( label="Load Tutorial {}: {}".format(num, name), command=partial(self.root.loadfile, tutorial)) self.add_cascade(label="Tutorials", menu=tutorialmenu) # Add to root self.visible = visible if self.visible: master.root.config(menu=self)
def __init__(self, label_command_pairs): Menu.__init__(self, tearoff=0) self.context = None for label, callback in label_command_pairs: self.add_command(label=label, command=lambda: callback(self.context))
def __init__(self, master, visible=True): self.root = master Menu.__init__(self, master.root) # Set font self.config(font="CodeFont") # File menu filemenu = Menu(self, tearoff=0) filemenu.add_command(label="New Document", command=self.root.newfile, accelerator="Ctrl+N") filemenu.add_command(label="Open", command=self.root.openfile, accelerator="Ctrl+O") filemenu.add_command(label="Save", command=self.root.save, accelerator="Ctrl+S") filemenu.add_command(label="Save As...", command=self.root.saveAs) self.add_cascade(label="File", menu=filemenu) # Edit menu editmenu = Menu(self, tearoff=0) editmenu.add_command(label="Undo", command=self.root.undo, accelerator="Ctrl+Z") editmenu.add_command(label="Redo", command=self.root.redo, accelerator="Ctrl+Y") editmenu.add_separator() editmenu.add_command(label="Cut", command=self.root.edit_cut, accelerator="Ctrl+X") editmenu.add_command(label="Copy", command=self.root.edit_copy, accelerator="Ctrl+C") editmenu.add_command(label="Paste", command=self.root.edit_paste, accelerator="Ctrl+V") editmenu.add_command(label="Select All", command=self.root.selectall, accelerator="Ctrl+A") editmenu.add_separator() editmenu.add_command(label="Increase Font Size", command=self.root.zoom_in, accelerator="Ctrl+=") editmenu.add_command(label="Decrease Font Size", command=self.root.zoom_out, accelerator="Ctrl+-") editmenu.add_separator() editmenu.add_command(label="Toggle Menu", command=self.root.toggle_menu, accelerator="Ctrl+M") self.add_cascade(label="Edit", menu=editmenu) # Code menu codemenu = Menu(self, tearoff=0) codemenu.add_command(label="Evaluate Block", command=self.root.exec_block, accelerator="Ctrl+Return") codemenu.add_command(label="Evaluate Line", command=self.root.exec_line, accelerator="Alt+Return") codemenu.add_command(label="Clear Scheduling Clock", command=self.root.killall, accelerator="Ctrl+.") codemenu.add_command(label="Toggle Console", command=self.root.toggle_console) self.add_cascade(label="Code", menu=codemenu) # Settings ## settingsmenu = Menu(self, tearoff=0) ## settingsmenu.add_command(label="Preferences...", command=self.root.toggleMenu) ## settingsmenu.add_command(label="Change Colours...", command=self.root.toggleMenu) ## settingsmenu.add_command(label="Open Samples Folder", command=self.root.toggleMenu) ## self.add_cascade(label="Settings", menu=settingsmenu) # Help helpmenu = Menu(self, tearoff=0) helpmenu.add_command(label="Visit FoxDot Homepage", command=self.root.openhomepage) helpmenu.add_command(label="Documentation", command=self.root.opendocumentation) self.add_cascade(label="Help", menu=helpmenu) # Add to root self.visible = visible if self.visible: master.root.config(menu=self)
def __init__(self, master, visible=True): self.root = master Menu.__init__(self, master.root) # File menu filemenu = Menu(self, tearoff=0) filemenu.add_command(label="New Document", command=self.new_file, accelerator="Ctrl+N") filemenu.add_command(label="Save", command=self.save_file, accelerator="Ctrl+S") filemenu.add_command(label="Open", command=self.open_file, accelerator="Ctrl+O") filemenu.add_separator() filemenu.add_command(label="Start logging performance", command=lambda: "break") filemenu.add_command(label="Import logged performance", command=self.root.ImportLog) self.add_cascade(label="File", menu=filemenu) # Edit menu editmenu = Menu(self, tearoff=0) editmenu.add_command(label="Cut", command=self.root.Cut, accelerator="Ctrl+X") editmenu.add_command(label="Copy", command=self.root.Copy, accelerator="Ctrl+C") editmenu.add_command(label="Paste", command=self.root.Paste, accelerator="Ctrl+V") editmenu.add_command(label="Select All", command=self.root.SelectAll, accelerator="Ctrl+/") editmenu.add_separator() editmenu.add_command(label="Increase Font Size", command=self.root.IncreaseFontSize, accelerator="Ctrl+=") editmenu.add_command(label="Decrease Font Size", command=self.root.DecreaseFontSize, accelerator="Ctrl+-") editmenu.add_separator() editmenu.add_command(label="Toggle Menu", command=self.root.ToggleMenu, accelerator="Ctrl+M") editmenu.add_separator() editmenu.add_command(label="Edit Colours", command=self.root.EditColours) editmenu.add_checkbutton(label="Toggle Window Transparency", command=self.root.ToggleTransparency, variable=self.root.transparent) self.add_cascade(label="Edit", menu=editmenu) # Code menu codemenu = Menu(self, tearoff=0) codemenu.add_command(label="Evaluate Code", command=self.root.Evaluate, accelerator="Ctrl+Return") codemenu.add_command(label="Evaluate Single Line", command=self.root.SingleLineEvaluate, accelerator="Alt+Return") codemenu.add_command(label="Stop All Sound", command=self.root.stopSound, accelerator="Ctrl+.") codemenu.add_command(label="Re-sync text", command=self.root.syncText) codemenu.add_command(label="Font colour merge", command=self.root.beginFontMerge) codemenu.add_separator() # Allow choice of interpreter langmenu = Menu(self, tearoff=0) for name, interpreter in langnames.items(): langmenu.add_checkbutton(label=langtitles[name], command=partial(self.root.set_interpreter, interpreter), variable=self.root.interpreters[name]) codemenu.add_cascade(label="Choose language", menu=langmenu) self.add_cascade(label="Code", menu=codemenu) # Creative constraint menu constraintmenu = Menu(self, tearoff=0) # Get the names of constraints from . import constraints constraints = vars(constraints) for name in constraints: if not name.startswith("_"): constraintmenu.add_checkbutton( label=name.title(), command=partial(self.root.set_constraint, name), variable=self.root.creative_constraints[name]) self.add_cascade(label="Constraints", menu=constraintmenu) # Help helpmenu = Menu(self, tearoff=0) helpmenu.add_command(label="Documentation", command=self.root.OpenGitHub) self.add_cascade(label="Help", menu=helpmenu) # Add to root self.visible = visible if self.visible: master.root.config(menu=self)
def __init__(self, parent, **kwargs): Menu.__init__(self, parent, **kwargs) parent.config(menu=self) self.menus = {}
def __init__(self, master, visible=True): self.root = master Menu.__init__(self, master.root) self.sc3_plugins = BooleanVar() self.sc3_plugins.set(SC3_PLUGINS) self.listening = BooleanVar() self.listening.set(False) # Set font self.config(font="CodeFont") # File menu filemenu = Menu(self, tearoff=0) filemenu.add_command(label="New Document", command=self.root.newfile, accelerator="Ctrl+N") filemenu.add_command(label="Open", command=self.root.openfile, accelerator="Ctrl+O") filemenu.add_command(label="Save", command=self.root.save, accelerator="Ctrl+S") filemenu.add_command(label="Save As...", command=self.root.saveAs) self.add_cascade(label="File", menu=filemenu) # Edit menu editmenu = Menu(self, tearoff=0) editmenu.add_command(label="Undo", command=self.root.undo, accelerator="Ctrl+Z") editmenu.add_command(label="Redo", command=self.root.redo, accelerator="Ctrl+Y") editmenu.add_separator() editmenu.add_command(label="Cut", command=self.root.edit_cut, accelerator="Ctrl+X") editmenu.add_command(label="Copy", command=self.root.edit_copy, accelerator="Ctrl+C") editmenu.add_command(label="Paste", command=self.root.edit_paste, accelerator="Ctrl+V") editmenu.add_command(label="Select All", command=self.root.selectall, accelerator="Ctrl+A") editmenu.add_separator() editmenu.add_command(label="Increase Font Size", command=self.root.zoom_in, accelerator="Ctrl+=") editmenu.add_command(label="Decrease Font Size", command=self.root.zoom_out, accelerator="Ctrl+-") editmenu.add_separator() editmenu.add_command(label="Toggle Menu", command=self.root.toggle_menu, accelerator="Ctrl+M") editmenu.add_checkbutton(label="Toggle Window Transparency", command=self.root.toggle_transparency, variable=self.root.transparent) self.add_cascade(label="Edit", menu=editmenu) # Code menu ctrl = "Command" if SYSTEM == MAC_OS else "Ctrl" # Note: Alt renders properly to look like Option, so we don't need a # conditional for those shortcuts codemenu = Menu(self, tearoff=0) codemenu.add_command(label="Evaluate Block", command=self.root.exec_block, accelerator="{}+Return".format(ctrl)) codemenu.add_command(label="Evaluate Line", command=self.root.exec_line, accelerator="Alt+Return") codemenu.add_command(label="Clear Scheduling Clock", command=self.root.killall, accelerator="{}+.".format(ctrl)) codemenu.add_separator() codemenu.add_command(label="Toggle Console", command=self.root.toggle_console) codemenu.add_command(label="Export Console Log", command=self.root.export_console) codemenu.add_separator() codemenu.add_checkbutton(label="Use SC3 Plugins", command=self.root.toggle_sc3_plugins, variable=self.sc3_plugins) codemenu.add_separator() codemenu.add_checkbutton(label="Listen for connections", command=self.allow_connections, variable=self.listening) self.add_cascade(label="Language", menu=codemenu) # Help helpmenu = Menu(self, tearoff=0) helpmenu.add_command(label="Visit FoxDot Homepage", command=self.root.openhomepage) helpmenu.add_command(label="Documentation", command=self.root.opendocumentation) helpmenu.add_separator() helpmenu.add_command(label="Open Samples Folder", command=self.root.open_samples_folder) helpmenu.add_command(label="Open config file (advanced)", command=self.root.open_config_file) ## settingsmenu.add_command(label="Change Colours...", command=self.root.toggleMenu) self.add_cascade(label="Help & Settings", menu=helpmenu) # Tutorials tutorialmenu = Menu(self, tearoff=0) for tutorial in GET_TUTORIAL_FILES(): filename = os.path.basename(tutorial).replace(".py", "") data = filename.split("_") num = data[0] name = " ".join(data[1:]).title() tutorialmenu.add_command(label="Load Tutorial {}: {}".format( num, name), command=partial(self.root.loadfile, tutorial)) self.add_cascade(label="Tutorials", menu=tutorialmenu) # Add to root self.visible = visible if self.visible: master.root.config(menu=self)
def __init__(self, master, visible=True): self.root = master Menu.__init__(self, master.root) # File menu filemenu = Menu(self, tearoff=0) filemenu.add_command(label="New Document", command=self.new_file, accelerator="Ctrl+N") filemenu.add_command(label="Save", command=self.save_file, accelerator="Ctrl+S") filemenu.add_command(label="Open", command=self.open_file, accelerator="Ctrl+O") filemenu.add_separator() filemenu.add_command(label="Start logging performance", command=lambda: "break") filemenu.add_command(label="Import logged performance", command=self.root.ImportLog) self.add_cascade(label="File", menu=filemenu) # Edit menu editmenu = Menu(self, tearoff=0) editmenu.add_command(label="Cut", command=self.root.cut, accelerator="Ctrl+X") editmenu.add_command(label="Copy", command=self.root.copy, accelerator="Ctrl+C") editmenu.add_command(label="Paste", command=self.root.paste, accelerator="Ctrl+V") editmenu.add_command(label="Select All", command=self.root.select_all, accelerator="Ctrl+/") editmenu.add_separator() editmenu.add_command(label="Increase Font Size", command=self.root.increase_font_size, accelerator="Ctrl+=") editmenu.add_command(label="Decrease Font Size", command=self.root.decrease_font_size, accelerator="Ctrl+-") editmenu.add_separator() editmenu.add_command(label="Toggle Menu", command=self.toggle, accelerator="Ctrl+M") editmenu.add_separator() editmenu.add_command(label="Edit Colours", command=self.root.edit_colours) editmenu.add_checkbutton(label="Toggle Window Transparency", command=self.root.toggle_transparency, variable=self.root.transparent) self.add_cascade(label="Edit", menu=editmenu) # Code menu codemenu = Menu(self, tearoff=0) codemenu.add_command(label="Evaluate Code", command=self.root.evaluate, accelerator="Ctrl+Return") codemenu.add_command(label="Evaluate Single Line", command=self.root.single_line_evaluate, accelerator="Alt+Return") codemenu.add_command(label="Stop All Sound", command=self.root.stop_sound, accelerator="Ctrl+.") codemenu.add_command(label="Font colour merge", command=self.root.text.merge.start) # Constraints constmenu = Menu(self, tearoff=0) for i, name in self.root.text.constraint.items(): constmenu.add_checkbutton( label=str(name).title(), command=partial(self.root.set_constraint, i), variable=self.root.text.constraint.using[i]) codemenu.add_cascade(label="Set Constraint", menu=constmenu) codemenu.add_separator() # Allow choice of interpreter langmenu = Menu(self, tearoff=0) for name, interpreter in langnames.items(): langmenu.add_checkbutton(label=langtitles[name], command=partial(self.root.set_interpreter, interpreter), variable=self.root.interpreters[name]) codemenu.add_cascade(label="Choose language", menu=langmenu) self.add_cascade(label="Code", menu=codemenu) # Help helpmenu = Menu(self, tearoff=0) helpmenu.add_command(label="Documentation", command=self.root.OpenGitHub) self.add_cascade(label="Help", menu=helpmenu) # Add to root self.visible = visible if self.visible: master.root.config(menu=self)
def __init__(self, master, tree, iid, num, all_trees, logit): Menu.__init__(self, master, tearoff=0) self.tree = tree self.iid = iid self.num = num self.all_trees = all_trees self.logit = logit self.row = self.tree.item(self.iid) self.key = self.row["values"][0] self.name = all_values[self.num][0][self.key] self.add_command(label="Отправить канал в ремонт до распоряжения", command=lambda: ChangeStatement( self.tree, self.iid, self.num, self.all_trees, self.logit).on_agreement(), font=tkFont.Font(family=main_font, size=size_font)) self.add_command( label="Отправить канал в ремонт по времени", command=lambda: ChangeStatement(self.tree, self.iid, self.num, self .all_trees, self.logit).on_time(), font=tkFont.Font(family=main_font, size=size_font)) self.add_command( label="Выключить звук", command=lambda: ControlSound(self.tree, self.iid, self.num, self. all_trees, self.logit).mute(), font=tkFont.Font(family=main_font, size=size_font)) self.add_command(label="Показать лог по данному каналу", command=lambda: ChannelLog(self.tree, self.iid, self. num).read_log(), font=tkFont.Font(family=main_font, size=size_font)) self.add_command( label="Добавить/Изменить комментарий", command=lambda: Comment_Widget(self.name, self.key).start(), font=tkFont.Font(family=main_font, size=size_font)) # self.add_command(label="ТЕСТ", command =comment) remont = load_file('remont', num) mute = load_file('mute', num) self.bind("<FocusOut>", self.focusOut) if self.key in remont.keys(): self.delete(2) self.delete(1) self.delete(0) self.add_command( label="Вернуть канал в работу", command=lambda: ChangeStatement(tree, iid, num, all_trees, logit).return_channel(), font=tkFont.Font(family=main_font, size=size_font)) if mute[self.key] == 1: self.delete(2) self.delete(1) self.delete(0) self.add_command(label="Включить звук", command=lambda: ControlSound( self.tree, self.iid, self.num, self.all_trees, self.logit).loud(), font=tkFont.Font(family=main_font, size=size_font)) if os.path.isfile('comments/comment_%s_%s.txt' % (self.num, self.key)): self.add_command(label="Удалить комментарий", command=self.delete_comment, font=tkFont.Font(family=main_font, size=size_font))
def __init__(self, parent): def donothing(): filewin = Toplevel(root) button = Button(filewin, text="Do nothing button") button.pack() def about(): tkMessageBox.showinfo( "About Software", """ About FaDeIP :- This software version 1.0.0. + FaDeIP is a python based software for video and image analysis. This Software Can Be used in Malls ,Banks ,Institutes ,Public Places for Surveillance and Security purposes. This Software is Using Open CV For Python And Developed on Python. This Software is developed as a project of TCS Internship Program Which Is Guided By Mr.Shudhanshu Sharma TCS-Delhi And Prof.Jyoti Gajrani GEC,Ajmer. Developed BY :- FadeIP Team """) def about2(): tkMessageBox.showinfo( "About Us", """ About Us: As a TCS Intern We Developed This Software. Our Team Consist of 3 Members 1) Rahul Kumar Gupta Computer Science B.Tech(2013-2017) Govt. Engineering College ,Ajmer 2) Rahul Sharma Computer Science B.Tech(2013-2017) Govt. Engineering College ,Ajmer 3) Kailash Suthar(CTO) Computer Science B.Tech(2013-2017) Govt. Engineering College ,Ajmer """) def learn(): tkMessageBox.showinfo( "Learn Software", """ FaDeIP:- A Solution Of Multimedia World This software is used for Surveillance and Security purposes and consists of many applications HOW TO USE FaDeIP :- 1) please click any of the below buttons to perform the specific Application. 2) Another pop-up will be opened for choosing Image or Video (Live Or Browse). 3) After Choosing the option the specific operation is performed. 4) Result will be displayed in the main frame.""") def OpenUrl(): webbrowser.open_new(url) Menu.__init__(self, parent) filemenu = Menu(self, tearoff=0) filemenu.add_command(label="About Software", command=about) filemenu.add_command(label="About Us", command=about2) #filemenu.add_command(label="Save", command=donothing) #filemenu.add_command(label="Save as...", command=donothing) #filemenu.add_command(label="Close", command=donothing) filemenu.add_separator() filemenu.add_command(label="Exit", command=parent.quit) self.add_cascade(label="About", menu=filemenu) editmenu = Menu(self, tearoff=0) editmenu.add_command(label="Learn the Software", command=learn) self.add_cascade(label="Learn", menu=editmenu) helpmenu = Menu(self, tearoff=0) helpmenu.add_command(label="Visit Website", command=OpenUrl) #helpmenu.add_command(label="About...", command=donothing) self.add_cascade(label="Help", menu=helpmenu) parent.config(menu=self)