Python Tkinter.StringVar() Examples
The following are 30
code examples of Tkinter.StringVar().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
Tkinter
, or try the search function
.
Example #1
Source File: annotation_gui.py From SEM with MIT License | 9 votes |
def preferences(self, event=None): preferenceTop = tkinter.Toplevel() preferenceTop.focus_set() notebook = ttk.Notebook(preferenceTop) frame1 = ttk.Frame(notebook) notebook.add(frame1, text='general') frame2 = ttk.Frame(notebook) notebook.add(frame2, text='shortcuts') c = ttk.Checkbutton(frame1, text="Match whole word when broadcasting annotation", variable=self._whole_word) c.pack() shortcuts_vars = [] shortcuts_gui = [] cur_row = 0 j = -1 frame_list = [] frame_list.append(ttk.LabelFrame(frame2, text="common shortcuts")) frame_list[-1].pack(fill="both", expand="yes") for i, shortcut in enumerate(self.shortcuts): j += 1 key, cmd, bindings = shortcut name, command = cmd shortcuts_vars.append(tkinter.StringVar(frame_list[-1], value=key)) tkinter.Label(frame_list[-1], text=name).grid(row=cur_row, column=0, sticky=tkinter.W) entry = tkinter.Entry(frame_list[-1], textvariable=shortcuts_vars[j]) entry.grid(row=cur_row, column=1) cur_row += 1 notebook.pack() # # ? menu methods #
Example #2
Source File: analysis_tab.py From PCWG with MIT License | 6 votes |
def __init__(self, notebook, fileName, console): ClosableTab.__init__(self, notebook, fileName, console) self.analysis = configuration.AnalysisConfiguration(fileName) sub_tabs = ValidationTabs(self.frame) main_frame = sub_tabs.add("Main Settings") correction_frame = sub_tabs.add("Correction Settings") s1Var = tk.StringVar() s2Var = tk.StringVar() s1Var.set(self.analysis.s1) s2Var.set(self.analysis.s2) square1Label = tk.Label(main_frame.frame,textvariable=s1Var) square1Label.grid(row=0, column=7) square2Label = tk.Label(main_frame.frame,textvariable=s2Var) square2Label.grid(row=0, column=6) sub_tabs.pack() main_frame.validate(False) notebook.pack(expand=1, fill='both')
Example #3
Source File: backend_tkagg.py From matplotlib-4-abaqus with MIT License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin Tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # spacer, unhandled in Tk pass else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = Tk.StringVar(master=self) self._message_label = Tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=Tk.RIGHT) self.pack(side=Tk.BOTTOM, fill=Tk.X)
Example #4
Source File: view.py From ms_deisotope with Apache License 2.0 | 6 votes |
def configure_canvas(self): self.figure = Figure(dpi=100) self.canvas = FigureCanvasTkAgg(self.figure, master=self) self.axis = self.figure.add_subplot(111) self.canvas.draw() canvas_widget = self.canvas.get_tk_widget() canvas_widget.grid(row=0, column=0, sticky=tk.N + tk.W + tk.E + tk.S) self.canvas_cursor = Cursor(self.axis, tk.StringVar(master=self.root)) self.canvas.mpl_connect('motion_notify_event', self.canvas_cursor.mouse_move) self.span = SpanSelector( self.axis, self.zoom, 'horizontal', useblit=True, rectprops=dict(alpha=0.5, facecolor='red')) self.mz_span = None self.scan = None self.annotations = [] self.canvas.draw()
Example #5
Source File: dynOptionMenuWidget.py From oss-ftp with MIT License | 6 votes |
def _dyn_option_menu(parent): # htest # from Tkinter import Toplevel top = Toplevel() top.title("Tets dynamic option menu") top.geometry("200x100+%d+%d" % (parent.winfo_rootx() + 200, parent.winfo_rooty() + 150)) top.focus_set() var = StringVar(top) var.set("Old option set") #Set the default value dyn = DynOptionMenu(top,var, "old1","old2","old3","old4") dyn.pack() def update(): dyn.SetMenu(["new1","new2","new3","new4"], value="new option set") button = Button(top, text="Change option set", command=update) button.pack()
Example #6
Source File: Controls.py From Python-Media-Player with Apache License 2.0 | 6 votes |
def __init__(self, root=None): self.root=Tkinter.Frame(root) self.root.pack(side='top') self.path=Tkinter.StringVar() # For Song Path self.song_time=Tkinter.StringVar() # For Song Playing Time self.song_duration=Tkinter.StringVar() # For Song Duration self.volume=Tkinter.IntVar() # For Song Volume # ============= Creating Media Player ====================================================== mediaplayer=player.mediaplayer(self.path, self.song_time, self.song_duration, self.volume) # ============= Creating Display Panel ====================================================== DisplayPanel.Player(self.root, self.path, self.song_time, self.song_duration) # ============= Creating Control Panel ====================================================== lit2=Controls(self.root, self.path, mediaplayer, self.volume) self.hook2=lit2 # ============= Here Connecting List Panel ====================================================== lit=ListPanel.main(self.root, self.path) self.hook=lit.hook
Example #7
Source File: pykms_GuiMisc.py From py-kms with The Unlicense | 6 votes |
def __init__(self, master, radios, font, changed, **kwargs): tk.Frame.__init__(self, master) self.master = master self.radios = radios self.font = font self.changed = changed self.scrollv = tk.Scrollbar(self, orient = "vertical") self.textbox = tk.Text(self, yscrollcommand = self.scrollv.set, **kwargs) self.scrollv.config(command = self.textbox.yview) # layout. self.scrollv.pack(side = "right", fill = "y") self.textbox.pack(side = "left", fill = "both", expand = True) # create radiobuttons. self.radiovar = tk.StringVar() self.radiovar.set('FILE') self.create()
Example #8
Source File: dynOptionMenuWidget.py From Splunking-Crime with GNU Affero General Public License v3.0 | 6 votes |
def _dyn_option_menu(parent): # htest # from Tkinter import Toplevel top = Toplevel() top.title("Tets dynamic option menu") top.geometry("200x100+%d+%d" % (parent.winfo_rootx() + 200, parent.winfo_rooty() + 150)) top.focus_set() var = StringVar(top) var.set("Old option set") #Set the default value dyn = DynOptionMenu(top,var, "old1","old2","old3","old4") dyn.pack() def update(): dyn.SetMenu(["new1","new2","new3","new4"], value="new option set") button = Button(top, text="Change option set", command=update) button.pack()
Example #9
Source File: dialog_elements.py From Enrich2 with BSD 3-Clause "New" or "Revised" License | 6 votes |
def __init__(self, text, cfg, key, optional=False): self.entry = None self.enabled = True self.value = tk.StringVar() self.text = text self.cfg = cfg self.key = key self.optional = optional try: if self.cfg[self.key] is None: self.value.set("") else: self.value.set(self.cfg[self.key]) except KeyError: self.value.set("")
Example #10
Source File: backend_tkagg.py From Computable with MIT License | 6 votes |
def _init_toolbar(self): xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin Tk.Frame.__init__(self, master=self.window, width=int(width), height=int(height), borderwidth=2) self.update() # Make axes menu for text, tooltip_text, image_file, callback in self.toolitems: if text is None: # spacer, unhandled in Tk pass else: button = self._Button(text=text, file=image_file, command=getattr(self, callback)) if tooltip_text is not None: ToolTip.createToolTip(button, tooltip_text) self.message = Tk.StringVar(master=self) self._message_label = Tk.Label(master=self, textvariable=self.message) self._message_label.pack(side=Tk.RIGHT) self.pack(side=Tk.BOTTOM, fill=Tk.X)
Example #11
Source File: Tkinter_Widget_Examples.py From MacAdmins-2016-Craft-GUIs-with-Python-and-Tkinter with MIT License | 6 votes |
def __init__(self, master): tk.Frame.__init__(self, master) self.pack(padx=20, pady=20) self.master = master self.selection = tk.StringVar() self.selection.set('white') tk.Label(self, text="These are radiobuttons").pack() tk.Radiobutton(self, text='White', value='white', variable=self.selection, command=self.set_color).pack(anchor='w') tk.Radiobutton(self, text='Red', value='red', variable=self.selection, command=self.set_color).pack(anchor='w') tk.Radiobutton(self, text='Green', value='green', variable=self.selection, command=self.set_color).pack(anchor='w') tk.Radiobutton(self, text='Blue', value='blue', variable=self.selection, command=self.set_color).pack(anchor='w')
Example #12
Source File: __init__.py From lackey with MIT License | 6 votes |
def select(message="", title="Lackey Input", options=None, default=None): """ Creates a dropdown selection dialog with the specified message and options `default` must be one of the options. Returns the selected value. """ if options is None or len(options) == 0: return "" if default is None: default = options[0] if default not in options: raise ValueError("<<default>> not in options[]") root = tk.Tk() input_text = tk.StringVar() input_text.set(message) PopupList(root, message, title, options, default, input_text) root.focus_force() root.mainloop() return str(input_text.get())
Example #13
Source File: dicom_anonymizer_frame.py From DICAT with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent): self.parent = parent self.dirname = '' self.dir_opt = {} self.field_dict = {} self.message = StringVar() # Determine if PyDICOM python library is present. deidentifier_tool = methods.find_deidentifier_tool() if not deidentifier_tool: error = "ERROR: PyDICOM does not appear to be installed.\n " \ + "Please make sure PyDICOM has been properly installed " \ + "before using the DICOM deidentifier tab.\n " \ + "Check the README.md of the DICAT repository for " \ + "information on how to install PyDICOM." self.message.set(error) self.initialize()
Example #14
Source File: closable_Tab_with_menu.py From PCWG with MIT License | 6 votes |
def __init__(self, notebook, fileName, console): ClosableTab.__init__(self, notebook, fileName, console) self.analysis = Analysis(fileName) sub_tabs = ValidationTabs(self.frame) main_frame = sub_tabs.add("Main Settings") correction_frame = sub_tabs.add("Correction Settings") s1Var = tk.StringVar() s2Var = tk.StringVar() s1Var.set(self.analysis.s1) s2Var.set(self.analysis.s2) square1Label = tk.Label(main_frame.frame,textvariable=s1Var) square1Label.grid(row=0, column=7) square2Label = tk.Label(main_frame.frame,textvariable=s2Var) square2Label.grid(row=0, column=6) sub_tabs.pack() main_frame.validate(False) notebook.pack(expand=1, fill='both')
Example #15
Source File: test_multi.py From PCWG with MIT License | 6 votes |
def win1(): # this is the main/root window root = Tkinter.Tk() root.title("Window 1") startButton = Tkinter.Button(root, text="Start", command=win2) startButton.grid(row=9, column=7) leaveButton = Tkinter.Button(root, text="Quit", command=root.destroy) leaveButton.grid(row=1, column=1, sticky='nw') b1Var = Tkinter.StringVar() b2Var = Tkinter.StringVar() b1Var.set('b1') b2Var.set('b2') box1Label = Tkinter.Label(root,textvariable=b1Var,width=12) box1Label.grid(row=3, column=2) box2Label = Tkinter.Label(root,textvariable=b2Var,width=12) box2Label.grid(row=3, column=3) root.mainloop()
Example #16
Source File: record.py From TensorKart with MIT License | 5 votes |
def create_main_panel(self): # Panels top_half = tk.Frame(self.root) top_half.pack(side=tk.TOP, expand=True, padx=5, pady=5) message = tk.Label(self.root, text="(Note: UI updates are disabled while recording)") message.pack(side=tk.TOP, padx=5) bottom_half = tk.Frame(self.root) bottom_half.pack(side=tk.LEFT, padx=5, pady=10) # Images self.img_panel = tk.Label(top_half, image=ImageTk.PhotoImage("RGB", size=IMAGE_SIZE)) # Placeholder self.img_panel.pack(side = tk.LEFT, expand=False, padx=5) # Joystick self.init_plot() self.PlotCanvas = FigCanvas(figure=self.fig, master=top_half) self.PlotCanvas.get_tk_widget().pack(side=tk.RIGHT, expand=False, padx=5) # Recording textframe = tk.Frame(bottom_half, width=332, height=15, padx=5) textframe.pack(side=tk.LEFT) textframe.pack_propagate(0) self.outputDirStrVar = tk.StringVar() self.txt_outputDir = tk.Entry(textframe, textvariable=self.outputDirStrVar, width=100) self.txt_outputDir.pack(side=tk.LEFT) self.outputDirStrVar.set("samples/" + datetime.now().strftime('%Y-%m-%d_%H:%M:%S')) self.record_button = ttk.Button(bottom_half, text="Record", command=self.on_btn_record) self.record_button.pack(side = tk.LEFT, padx=5)
Example #17
Source File: simple_beam.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def add_load(self, *event): self.loads_gui_select_var.append([tk.IntVar(), tk.StringVar(), tk.StringVar(), tk.StringVar(), tk.StringVar(), tk.StringVar(), tk.StringVar()]) n = len(self.loads_gui_select_var) self.loads_gui_select_var[n-1][0].set(1) self.loads_gui_select_var[n-1][1].set(self.w1_gui.get()) self.loads_gui_select_var[n-1][2].set(self.w2_gui.get()) self.loads_gui_select_var[n-1][3].set(self.a_gui.get()) self.loads_gui_select_var[n-1][4].set(self.b_gui.get()) self.loads_gui_select_var[n-1][5].set(self.load_loc.get()) self.loads_gui_select_var[n-1][6].set(self.load_type.get()) self.build_loads_gui() self.build_loads()
Example #18
Source File: tkmktap.py From BitTorrent with GNU General Public License v3.0 | 5 votes |
def __init__(self, master, lines, label, desc, default, cmd, **kw): Tkinter.Frame.__init__(self, master, relief='raised', bd=1, **kw) self.lines = lines l = Tkinter.Label( self, text=label, wraplen=200, width=30, anchor='w', justify='left' ) s = Tkinter.StringVar() if default: s.set(default) self.entry = Tkinter.Entry(self, text=s, background='white') self.flag = label more = Tkinter.Button( self, text='+', command=lambda f = cmd, a = label, b = default, c = desc: f(a, b, c) ) l.pack(side=Tkinter.LEFT, fill='y') self.entry.pack(side=Tkinter.LEFT) more.pack(side=Tkinter.LEFT) l.bind("<Enter>", self.highlight) l.bind("<Leave>", self.unhighlight) l.bind("<ButtonPress-1>", self.press) l.bind("<B1-ButtonRelease>", self.release) l.bind("<B1-Motion>", self.motion)
Example #19
Source File: guiClass.py From Video-Downloader with GNU General Public License v2.0 | 5 votes |
def __configPanel (self) : self.slave = Tkinter.Toplevel(); self.slave.title("Config") self.slave.resizable(width = 'false', height = 'false') l1 = Tkinter.Label(self.slave, text = '下载目录:') l1.grid(row = 0) self.filePath = Tkinter.StringVar() self.filePath.set(self.cfg['path']) e1 = Tkinter.Entry(self.slave, textvariable = self.filePath) e1.grid(row = 0, column = 1, columnspan = 3) b1 = Tkinter.Button(self.slave, text = '选择', command = self.__chooseCfgFolder) b1.grid(row = 0, column = 4, sticky = 'e') l2 = Tkinter.Label(self.slave, text = '检查更新:') l2.grid(row = 1) self.chkUpdateTime = Tkinter.IntVar() self.chkUpdateTime.set(int(self.cfg['udrate'])) r1 = Tkinter.Radiobutton(self.slave, text="每天", variable=self.chkUpdateTime, value=1) r1.grid(row = 1, column = 1, sticky = 'e') r2 = Tkinter.Radiobutton(self.slave, text="每周", variable=self.chkUpdateTime, value=2) r2.grid(row = 1, column = 2, sticky = 'e') r3 = Tkinter.Radiobutton(self.slave, text="每月", variable=self.chkUpdateTime, value=3) r3.grid(row = 1, column = 3, sticky = 'e') b2 = Tkinter.Button(self.slave, text = '更新', command = self.__setConfig) b2.grid(row = 2, column = 1, sticky = 'e') b3 = Tkinter.Button(self.slave, text = '取消', command = self.slave.destroy) b3.grid(row = 2, column = 2, sticky = 'e')
Example #20
Source File: __main__.py From PyQuiz with MIT License | 5 votes |
def __init__(self, master=None): ''' Call to the constructor when the object is created. Variables initialized and set the grid as per need. ''' tkMessageBox.showinfo('Welcome!','Welcome to PyQuiz!\nA quiz built in Python to test your general knowledge.') tk.Frame.__init__(self, master) self.flag=0 self.grid() # declaring variables to store question and answer self.optionA = tk.StringVar() # control variable for option A self.optionB = tk.StringVar() # control variable for option B self.optionC = tk.StringVar() # control variable for option C self.optionD = tk.StringVar() # control variable for option D self.selected_answer = tk.StringVar() # variable to get the selected answer self.correct_answer = "" # to store the correct answer before randomizing options self.question = tk.StringVar() # control variable for the question to be loaded self.file = open(QUESTIONS_FILE,"r") self.questions = json.loads(self.file.read()) self.question_index = [] self.score = tk.IntVar() # to hold the score top = self.winfo_toplevel() self.createWidgets(top) # call to create the necessary widgets self.load_question(top) # load the first question
Example #21
Source File: create_root_dialog.py From Enrich2 with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, parent_window, title="Create Root Object"): self.element_tkstring = tk.StringVar() self.cfg_dict = dict() self.output_directory_tk = FileEntry( "Output Directory", self.cfg_dict, "output directory", optional=False, directory=True, ) self.name_tk = StringEntry("Name", self.cfg_dict, "name", optional=False) self.element = None tkSimpleDialog.Dialog.__init__(self, parent_window, title)
Example #22
Source File: gui.py From snn_toolbox with MIT License | 5 votes |
def select_plots_dir_rb(self): """Select plots directory.""" self.plot_dir_frame = tk.LabelFrame(self.graph_frame, labelanchor='nw', text="Select dir", relief='raised', borderwidth='3', bg='white') self.plot_dir_frame.pack(side='top', fill=None, expand=False) self.gui_log.set(os.path.join(self.settings['path_wd'].get(), 'log', 'gui')) if os.path.isdir(self.gui_log.get()): plot_dirs = [d for d in sorted(os.listdir(self.gui_log.get())) if os.path.isdir(os.path.join(self.gui_log.get(), d))] self.selected_plots_dir = tk.StringVar(value=plot_dirs[0]) [tk.Radiobutton(self.plot_dir_frame, bg='white', text=name, value=name, command=self.select_layer_rb, variable=self.selected_plots_dir).pack( fill='both', side='bottom', expand=True) for name in plot_dirs] open_new_cb = tk.Checkbutton(self.graph_frame, bg='white', height=2, width=20, text='open in new window', variable=self.settings['open_new']) open_new_cb.pack(**self.kwargs) tip = dedent("""\ If unchecked, the window showing graphs for a certain layer will close and be replaced each time you select a layer to plot. If checked, an additional window will pop up instead.""") ToolTip(open_new_cb, text=tip, wraplength=750)
Example #23
Source File: edit_dialog.py From Enrich2 with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, frame_dict): self.mode = tk.StringVar() self.frame_dict = frame_dict self.rb_fastq = None self.rb_coutns = None
Example #24
Source File: strap_beam_gui.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def strap_design_frame_builder(self): self.strap_inputs_frame = tk.Frame(self.strap_design_frame) self.strap_inputs_frame.pack(side=tk.LEFT, anchor='nw') self.strap_calc_frame = tk.Frame(self.strap_design_frame) self.strap_calc_frame.pack(side=tk.RIGHT ,anchor='ne', fill=tk.BOTH, expand=1) tk.Label(self.strap_inputs_frame, text="B = ", font=self.helv).grid(row=0, column=0, sticky = tk.E) tk.Entry(self.strap_inputs_frame, textvariable=self.bs, width=10, validate="key", validatecommand=self.reset_status).grid(row=0, column=1) tk.Label(self.strap_inputs_frame, text="in", font=self.helv).grid(row=0, column=2) tk.Label(self.strap_inputs_frame, text="H = ", font=self.helv).grid(row=1, column=0, sticky = tk.E) tk.Entry(self.strap_inputs_frame, textvariable=self.hs, width=10, validate="key", validatecommand=self.reset_status).grid(row=1, column=1) tk.Label(self.strap_inputs_frame, text="in", font=self.helv).grid(row=1, column=2) self.strap_vbar_size = tk.StringVar() self.inputs.append(self.strap_vbar_size) self.strap_vbar_size.set('3') self.strap_vbar_size_label = tk.Label(self.strap_inputs_frame, text="Shear\nBar Size (#) : ", font=self.helv) self.strap_vbar_size_label.grid(row=2,column=0, pady=2) self.strap_vbar_size_menu = tk.OptionMenu(self.strap_inputs_frame, self.strap_vbar_size, '3', '4', '5', command=self.reset_status) self.strap_vbar_size_menu.config(font=self.helv) self.strap_vbar_size_menu.grid(row=2, column=1, padx= 2, sticky=tk.W) self.strap_bar_size = tk.StringVar() self.inputs.append(self.strap_bar_size) self.strap_bar_size.set('3') self.strap_bar_size_label = tk.Label(self.strap_inputs_frame, text="Flexure\nBar Size (#) : ", font=self.helv) self.strap_bar_size_label.grid(row=4,column=0, pady=2) self.strap_bar_size_menu = tk.OptionMenu(self.strap_inputs_frame, self.strap_bar_size, '3', '4', '5','6','7','8','9','10','11','14','18', command=self.reset_status) self.strap_bar_size_menu.config(font=self.helv) self.strap_bar_size_menu.grid(row=4, column=1, padx= 2, sticky=tk.W) self.strap_calc_txtbox = tk.Text(self.strap_calc_frame, height = 25, width = 70, bg= "grey90", font= self.helv_norm, wrap=tk.WORD) self.strap_calc_txtbox.grid(row=0, column=0, sticky='nsew') self.strap_scroll = tk.Scrollbar(self.strap_calc_frame, command=self.strap_calc_txtbox.yview) self.strap_scroll.grid(row=0, column=1, sticky='nsew') self.strap_calc_txtbox['yscrollcommand'] = self.strap_scroll.set
Example #25
Source File: create_seqlib_dialog.py From Enrich2 with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, parent_window, title="New SeqLib"): self.element_tkstring = tk.StringVar() self.element_type = None tkSimpleDialog.Dialog.__init__(self, parent_window, title)
Example #26
Source File: Frame_2D_GUI_metric.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def add_cant_left_func(self,*event): if self.cantL_count == 0: self.frame_built = 0 self.frame_solved = 0 self.cantL_count +=1 self.b_remove_left_cant.configure(state=tk.NORMAL) self.b_add_left_cant.configure(state=tk.DISABLED) self.b_solve_frame.configure(state=tk.DISABLED, bg='red3') self.cantL_beam_inputs.append([tk.StringVar(),tk.StringVar(),tk.StringVar(),tk.StringVar()]) self.cantL_beam_inputs[-1][1].set(0.5) self.cantL_beam_inputs[-1][2].set(199948) self.cantL_beam_inputs[-1][3].set(1.28199e7) bm = self.cantL_beam_inputs[0] bm[0].set('CantL') self.beam_labels.append('CantL') self.refesh_span_options() a = tk.Entry(self.bm_info_tab,textvariable=bm[0], width=8, state=tk.DISABLED) a.grid(row=2,column=6) b = tk.Entry(self.bm_info_tab,textvariable=bm[1], width=8) b.grid(row=2,column=7) c = tk.Entry(self.bm_info_tab,textvariable=bm[2], width=8) c.grid(row=2,column=8) d = tk.Entry(self.bm_info_tab,textvariable=bm[3], width=8) d.grid(row=2,column=9) self.cantL_beam_gui_list.extend([a,b,c,d]) else: pass
Example #27
Source File: Frame_2D_GUI_metric.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def add_cant_right_func(self,*event): if self.cantR_count == 0: self.frame_built = 0 self.frame_solved = 0 self.cantR_count +=1 self.b_remove_right_cant.configure(state=tk.NORMAL) self.b_add_right_cant.configure(state=tk.DISABLED) self.b_solve_frame.configure(state=tk.DISABLED, bg='red3') self.cantR_beam_inputs.append([tk.StringVar(),tk.StringVar(),tk.StringVar(),tk.StringVar()]) self.cantR_beam_inputs[-1][1].set(0.5) self.cantR_beam_inputs[-1][2].set(199948) self.cantR_beam_inputs[-1][3].set(1.28199e7) bm = self.cantR_beam_inputs[0] bm[0].set('CantR') self.beam_labels.append('CantR') self.refesh_span_options() a = tk.Entry(self.bm_info_tab,textvariable=bm[0], width=8, state=tk.DISABLED) a.grid(row=2,column=11) b = tk.Entry(self.bm_info_tab,textvariable=bm[1], width=8) b.grid(row=2,column=12) c = tk.Entry(self.bm_info_tab,textvariable=bm[2], width=8) c.grid(row=2,column=13) d = tk.Entry(self.bm_info_tab,textvariable=bm[3], width=8) d.grid(row=2,column=14) self.cantR_beam_gui_list.extend([a,b,c,d]) else: pass
Example #28
Source File: simple_beam_metric.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def add_load(self, *event): self.loads_gui_select_var.append([tk.IntVar(), tk.StringVar(), tk.StringVar(), tk.StringVar(), tk.StringVar(), tk.StringVar(), tk.StringVar()]) n = len(self.loads_gui_select_var) self.loads_gui_select_var[n-1][0].set(1) self.loads_gui_select_var[n-1][1].set(self.w1_gui.get()) self.loads_gui_select_var[n-1][2].set(self.w2_gui.get()) self.loads_gui_select_var[n-1][3].set(self.a_gui.get()) self.loads_gui_select_var[n-1][4].set(self.b_gui.get()) self.loads_gui_select_var[n-1][5].set(self.load_loc.get()) self.loads_gui_select_var[n-1][6].set(self.load_type.get()) self.build_loads_gui() self.build_loads()
Example #29
Source File: bolts_IC_gui.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def send_aisc_geometry(self,xloc,yloc, *events): if self.aisc_has_run == 0: pass else: self.hasrun=0 for element in self.bolt_gui_elements: element.destroy() del self.bolt_gui_elements[:] del self.bolt_x_gui[:] del self.bolt_y_gui[:] self.bolt_count = len(xloc) for i in range(len(xloc)): self.bolt_x_gui.append(tk.StringVar()) self.bolt_y_gui.append(tk.StringVar()) x = xloc[i] y = yloc[i] self.bolt_x_gui[-1].set(x) self.bolt_y_gui[-1].set(y) for i in range(self.bolt_count): c = tk.Label(self.bolt_canvas_frame, text="Bolt {0}".format(i), font=self.helv) c.grid(row=i, column=0, sticky=tk.W) a = tk.Entry(self.bolt_canvas_frame, textvariable=self.bolt_x_gui[i], width=10) a.grid(row=i, column=1) b = tk.Entry(self.bolt_canvas_frame, textvariable=self.bolt_y_gui[i], width=10) b.grid(row=i, column=2) self.bolt_gui_elements.append(c) self.bolt_gui_elements.append(a) self.bolt_gui_elements.append(b) self.draw_bolts()
Example #30
Source File: Frame_2D_GUI.py From Structural-Engineering with BSD 3-Clause "New" or "Revised" License | 5 votes |
def add_cant_right_func(self,*event): if self.cantR_count == 0: self.frame_built = 0 self.frame_solved = 0 self.cantR_count +=1 self.b_remove_right_cant.configure(state=tk.NORMAL) self.b_add_right_cant.configure(state=tk.DISABLED) self.b_solve_frame.configure(state=tk.DISABLED, bg='red3') self.cantR_beam_inputs.append([tk.StringVar(),tk.StringVar(),tk.StringVar(),tk.StringVar()]) self.cantR_beam_inputs[-1][1].set(5) self.cantR_beam_inputs[-1][2].set(29000) self.cantR_beam_inputs[-1][3].set(30.8) bm = self.cantR_beam_inputs[0] bm[0].set('CantR') self.beam_labels.append('CantR') self.refesh_span_options() a = tk.Entry(self.bm_info_tab,textvariable=bm[0], width=8, state=tk.DISABLED) a.grid(row=2,column=11) b = tk.Entry(self.bm_info_tab,textvariable=bm[1], width=8) b.grid(row=2,column=12) c = tk.Entry(self.bm_info_tab,textvariable=bm[2], width=8) c.grid(row=2,column=13) d = tk.Entry(self.bm_info_tab,textvariable=bm[3], width=8) d.grid(row=2,column=14) self.cantR_beam_gui_list.extend([a,b,c,d]) else: pass