def set_frame_panel(self): ''' Do not mix 'self.frm_pnl' and 'self.frm_btm', otherwise, they may overlap each other. ''' self.frm_pnl = sh.Frame(parent=self.frm_btm, expand=0, fill='x') # Canvas should be created within a frame self.cvs_prm = sh.Canvas(parent=self.frm_pnl, expand=0) self.frm_btn = sh.Frame(parent=self.frm_pnl, expand=0) # A search entry field self.ent_src = sh.Entry(parent=self.frm_btn, side='left', ipady=5) self.set_buttons() self.cvs_prm.embed(obj=self.frm_btn) ''' #TODO: Updating idletasks will show the AllDic 'Please wait' message for too long, however, we need to update in order to set canvas dimensions correctly. ''' sh.objs.get_root().update_idle() height = self.frm_btn.get_height() width = self.frm_btn.get_width() self.cvs_prm.widget.config(width=self.obj.get_resolution()[0]) self.cvs_prm.widget.config(height=height) x2 = (width / 2) x1 = -x2 y2 = (height / 2) y1 = -y2 self.cvs_prm.widget.config(scrollregion=(x1, y1, x2, y2)) # The scrollbar is set at the end for some reason self.cvs_prm.widget.xview_moveto(0)
def set_frames(self): self.frm_prm = sh.Frame(parent=self, expand=1, fill='both', side='top') self.frm_sec = sh.Frame(parent=self, expand=1, fill='both', side='left') self.frm_ter = sh.Frame(parent=self, expand=1, fill='both', side='right')
def set_frames(self): self.frm_prm = sh.Frame (parent = self.parent ,expand = False ,fill = 'x' ) self.frm_lft = sh.Frame (parent = self.frm_prm ,side = 'left' ) self.frm_rht = sh.Frame (parent = self.frm_prm ,side = 'left' )
def set_frames(self): self.frm_top = sh.Frame (parent = self.parent ,side = 'top' ) self.frm_btm = sh.Frame (parent = self.parent ,side = 'bottom' ) self.frm_lft = sh.Frame (parent = self.frm_top ,side = 'left' ) self.frm_rht = sh.Frame (parent = self.frm_top ,side = 'left' )
def set_gui(self): self.obj = sh.Top(Maximize=True) self.frm_prm = sh.Frame(parent=self.obj, expand=1) self.frm_btm = sh.Frame(parent=self.frm_prm, expand=0, side='bottom') self.frm_ver = sh.Frame(parent=self.frm_prm, expand=0, fill='y', side='right') self.widget = th.TkinterHtml(self.frm_prm.widget) self.widget.pack(expand='1', fill='both') self.set_scroll() self.set_frame_panel() self.set_icon() self.set_title() self.set_bindings() self.ent_src.focus() self.obj.widget.protocol('WM_DELETE_WINDOW', self.close)
def set_frames(self): ''' This frame should be created before others, otherwise, the scrollbar will have incorrect sizes. ''' self.frm_ver = sh.Frame (parent = self.parent ,expand = False ,fill = 'y' ,side = 'right' ) self.frm_lft = sh.Frame (parent = self.parent ,expand = False ,fill = 'y' ,side = 'left' ) self.frm_rht = sh.Frame (parent = self.parent ,expand = False ,fill = 'y' ,side = 'right' ) self.frm_top = sh.Frame (parent = self.parent ,expand = False ,fill = 'x' ,side = 'top' ) self.frm_prm = sh.Frame (parent = self.parent ,fill = 'both' ) self.widget = self.frm_prm.widget self.cvs_prm = sh.Canvas(self.frm_prm) self.frm_sec = sh.Frame (parent = self.frm_prm ,fill = 'both' ) self.cvs_prm.embed(self.frm_sec) self.frm_cnt = sh.Frame (parent = self.frm_sec ,expand = True ,fill = 'both' ) if self.ScrollX: self.frm_hor = sh.Frame (parent = self.frm_prm ,expand = False ,fill = 'x' ,side = 'bottom' ) self.frm_btm = sh.Frame (parent = self.parent ,expand = False ,fill = 'x' ,side = 'bottom' )
def set_frames(self): self.frm_prm = sh.Frame (parent = self.parent ,expand = True ,fill = 'both' ) self.frm_gnr = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'top' ) self.frm_yer = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'top' ) self.frm_src = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'top' ) self.frm_trg = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'top' ) self.frm_lim = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'top' ) self.frm_btn = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'bottom' ,pady = 7 ) self.frm_btl = sh.Frame (parent = self.frm_btn ,side = 'left' ) self.frm_btr = sh.Frame (parent = self.frm_btn ,side = 'right' )
def set_frames(self): self.frm = sh.Frame(parent=self.parent) self.frm1 = sh.Frame(parent=self.frm, expand=False) self.frm2 = sh.Frame(parent=self.frm, expand=False, propag=False, height=100) self.frmy = sh.Frame(parent=self.frm2, expand=False, fill='y', side='right') self.frm3 = sh.Frame(parent=self.frm, expand=False, fill='x', side='bottom') self.frmx = sh.Frame(parent=self.frm3, expand=False, fill='x') self.frm4 = sh.Frame(parent=self.frm3, expand=False, fill='x')
def set_widgets(self): message = _( 'Enter a word to guess. Use a question mark, a dot or an underscore to set a missing character.' ) message = list(message) for i in range(len(message)): if i % 50 == 0: message.insert(i, '\n') message = ''.join(message) self.lbl1 = sh.Label(parent=self.frm1, text=message, expand=True) self.ent1 = sh.Entry(parent=self.frm1, expand=True, fill='x') self.lbl2 = sh.Label(parent=self.frm1, text=_('Guessed words:'), expand=True) self.cvs = sh.Canvas(parent=self.frm2, expand=False) self.frme = sh.Frame(parent=self.frm2, expand=False) self.cvs.embed(self.frme) self.lbl3 = sh.Label(parent=self.frme, text=_('No match'), expand=False) self.ent1.focus()
def add_frames(self): self.frm_btn = sh.Frame (parent = self.parent ,expand = False ,fill = 'x' ,side = 'bottom' )
def set_frames(self): self.frm = sh.Frame (parent = self.parent ,side = 'top' ,expand = False ,fill = 'x' ) self.frm_prm = sh.Frame (parent = self.parent ,expand = True ,fill = 'both' ,side = 'top' ) self.frm_lft = sh.Frame (parent = self.frm_prm ,expand = True ,side = 'left' ) self.frm_rht = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'x' ,side = 'left' ) self.frm_prs = sh.Frame (parent = self.frm_rht ,expand = False ,side = 'bottom' ) self.frm_img = sh.Frame (parent = self.frm_prm ,expand = True ,fill = 'both' ,side = 'right' ) self.frm_btn = sh.Frame (parent = self.parent ,expand = False ,side = 'bottom' ) self.frm_btl = sh.Frame (parent = self.frm_btn ,expand = False ,fill = 'x' ,side = 'left' ) self.frm_btr = sh.Frame (parent = self.frm_btn ,expand = False ,fill = 'x' ,side = 'right' ) self.frm_btm = sh.Frame (parent = self.parent ,expand = False ,fill = 'x' ,side = 'bottom' ) self.frmt = sh.Frame (parent = self.frm_btm ,expand = False ,fill = 'x' ,side = 'top' ) self.frmb = sh.Frame (parent = self.frm_btm ,expand = False ,fill = 'x' ,side = 'bottom' ) self.frm1 = sh.Frame (parent = self.frmb ,side = 'left' ,expand = False ,fill = 'x' ) self.frm2 = sh.Frame (parent = self.frmb ,side = 'right' ,expand = False ,fill = 'x' )
def set_frames(self): self.frm_top = sh.Frame(parent=self.parent, side='top') self.frm_btm = sh.Frame(parent=self.parent, side='bottom', expand=False) self.frm_bm1 = sh.Frame(parent=self.frm_btm, side='left') self.frm_bm2 = sh.Frame(parent=self.frm_btm, side='left') self.frm_bm3 = sh.Frame(parent=self.frm_btm, side='right', expand=False) self.frm_lft = sh.Frame(parent=self.frm_top, side='left', propag=False, width=350) self.frm_vr1 = sh.Frame(parent=self.frm_top, side='left', expand=False, fill='y') self.frm_cnt = sh.Frame(parent=self.frm_top, side='left', expand=False) self.frm_rht = sh.Frame(parent=self.frm_top, side='left', propag=False, width=350) self.frm_vr2 = sh.Frame(parent=self.frm_top, expand=False, fill='y', side='left') self.frm_bt1 = sh.Frame(parent=self.frm_cnt, side='top') self.frm_bt2 = sh.Frame(parent=self.frm_cnt, side='top', expand=False) self.frm_bt3 = sh.Frame(parent=self.frm_cnt, side='bottom')
def set_frames(self): self.frm_col = sh.Frame(parent=self.parent, expand=True, fill='both') self.frm_spc = sh.Frame(parent=self.parent, expand=True, fill='both') self.frm_scm = sh.Frame(parent=self.frm_col, side='left', expand=False, fill='both') self.frm_cl1 = sh.Frame(parent=self.frm_col, side='left', expand=False, fill='both') self.frm_cl2 = sh.Frame(parent=self.frm_col, side='left', expand=False, fill='both') self.frm_cl3 = sh.Frame(parent=self.frm_col, expand=False, side='left', fill='both') self.frm_cl4 = sh.Frame(parent=self.frm_col, side='left', expand=False, fill='both') self.frm_sp1 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_sp2 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_sp3 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_sp4 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_sp5 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_sp6 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_sp7 = sh.Frame(parent=self.frm_spc, side='left', expand=False, fill='both') self.frm_cb1 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb2 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb3 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb4 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb5 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb6 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb7 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb8 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb9 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb10 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb11 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb12 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb13 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb14 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_cb15 = sh.Frame(parent=self.parent, expand=False, fill='x') self.frm_btn = sh.Frame(parent=self.parent, expand=False, fill='x', side='bottom')