def show_univers(self): i = 0 for cities in self.univers: label = tk.Label(self.top_frame, text=cities[0]['city']) label.grid(row=i, column=0) label.label = False label.collapsed = True label.bind('<1>', self.switch_univers) i += 1 for univer in cities: var = tk.IntVar() checkbutton = tk.Checkbutton(self.top_frame, text=univer['name'], variable=var) checkbutton.var = var checkbutton.grid(row=i, column=0) checkbutton.label = label checkbutton.bind('<1>', self.gen_univers_chosen) i += 1 self.widget_univers = self.top_frame.grid_slaves() for widget in self.widget_univers: if ~str(widget.winfo_class).find('checkbutton'): widget.grid_remove()
def crtChkLstItms(self, itmCllctn, ifRadio = False): self.txtWdgtDelete(False) self._selctdItemsLst_.clear() [wdg.destroy() for wdg in self.frOutRslts.subwidgets_all() if (isinstance(wdg, tk.CheckList))] #self.dctItmsChkLst.destroy() ## Список чекбоксов для вывода в текстовом окне self.dctItmsChkLst = tk.CheckList(self.frOutRslts, radio = ifRadio) ## self.jmscdObj.setEntity(self.entStrVar.get()) indx = 1.0 ## self.dctItmsVar = tk.BooleanVar() self.dctItmsVar.set(not ifRadio) tmpChkLst = self.getSubWgts(self.dctItmsChkLst, tk._dummyHList) self.styles["new"] = tk.DisplayStyle(itemtype = tk.IMAGETEXT, refwindow = tmpChkLst) self.styles["edited"] = tk.DisplayStyle(itemtype = tk.IMAGETEXT, refwindow = tmpChkLst, fg = '#CC4125') self.styles["inProgress"] = tk.DisplayStyle(itemtype = tk.IMAGETEXT, refwindow = tmpChkLst, fg = '#38761D') if (self.jmscdObj.platf.startswith('linux')): widthFrInSymb = int(self.tstOutText.winfo_width() / 7 - 3) elif (self.jmscdObj.platf.startswith('win')): widthFrInSymb = int(self.tstOutText.winfo_width() / 6 - 4) else: widthFrInSymb = int(self.tstOutText.winfo_width() / 7 - 3) heightTstInSymb = int(round(self.tstOutText.cget("height") / 2, 0)) tmpChkLst.config(header = True, width = widthFrInSymb, height = heightTstInSymb, borderwidth=1) tmpChkLst.header_create(col = 0, itemtype = tk.TEXT, text = self.jmscdObj._selctdKey_) self.chkBtnTst = tk.Checkbutton(tmpChkLst, command = self.testCmd, variable = self.dctItmsVar) self.chkBtnTst.config(text = "Авто выбор/Все знач.") tmpChkLst.add('dctItm_0', itemtype = tk.WINDOW, window = self.chkBtnTst) entrCnt = 0 for lnNum in range(len(itmCllctn)): if not (isinstance(itmCllctn[lnNum], tuple)): entrCnt += 1 entrTxt = itmCllctn[lnNum] entrVal = itmCllctn[lnNum] self.chkLstAdd(tmpChkLst, entrCnt, entrTxt, entrVal) else: for entr in itmCllctn[lnNum][1]: entrCnt += 1 tmpVar = entr[:2] if isinstance(entr, tuple) else entr entrTxt = (itmCllctn[lnNum][0] + ': ' + str(tmpVar)) entrVal = (itmCllctn[lnNum][0], ((entr),)) self.chkLstAdd(tmpChkLst, entrCnt, entrTxt, entrVal) self.tstOutText.window_create(tk.END, window = self.dctItmsChkLst, align = tk.TOP) tmpIfMode = 'off' if (ifRadio) else 'on' for i in tmpChkLst.info_children(): self.dctItmsChkLst.setstatus(i, mode=tmpIfMode) self.tstOutText.config(state = tk.DISABLED) del tmpChkLst del tmpIfMode self.logger.info("Checklist of dictionary entries created in Text Widget") return 0
def show_filters(self): for i, (key, value) in enumerate(self.filters.items()): label = tk.Label(self.top_frame, text=key) label.grid(row=0, column=i) for j, name in enumerate(value['names']): var = tk.IntVar() btn = tk.Checkbutton(self.top_frame, text=name, variable=var) btn.var = var btn.label = label['text'] btn.grid(row=j + 1, column=i) btn.bind('<1>', self.gen_filter_url) self.widget_filters = self.top_frame.grid_slaves()
def _createWidgets_(self): self.fsFrame = tk.Frame(self.mFrame) self.tk_setPalette(background = '#F2D7D5') ##F2D7D5 self.btQuit = tk.Button(self.mFrame) self.btQuit.config(text = 'Завершить', command = self.root.destroy) self.btQuit.pack(side =tk.BOTTOM) ##self.loadFrame = tk.LabelFrame(self.fsFrame) ##self.listBMsg = tk.Listbox(self.loadFrame, relief='flat') self.topElemsFrame = tk.Frame(self.fsFrame) self.btnLstFrame = tk.LabelFrame(self.topElemsFrame) self.smplUnqOptFrame = tk.Frame(self.topElemsFrame) self.smplUnqOptLabelF = tk.LabelFrame(self.smplUnqOptFrame) self._lbSmplUnqOptLabelF_ = self.getSubWgts(self.smplUnqOptLabelF, tk._dummyLabel) self._lbSmplUnqOptLabelF_.config(text = "Уник. сэмпл.") self._frSmplUnqOptLabelF_ = self.getSubWgts(self.smplUnqOptLabelF, tk._dummyFrame) self.cbIfCutUrl = tk.Checkbutton(self._frSmplUnqOptLabelF_, text = "Сократ. Url в назв. сэмпл.", variable = self._varIfCutUrlInSmpl_) self.smplThruNum = tk.LabelFrame(self._frSmplUnqOptLabelF_) self._lbSmplThruNum_ = self.getSubWgts(self.smplThruNum, tk._dummyLabel) self._lbSmplThruNum_.config(text = "Скозн. нумер.") self._frSmplThruNum_ = self.getSubWgts(self.smplThruNum, tk._dummyFrame) self.smplThruNumCntrl = tk.Radiobutton(self._frSmplThruNum_, text = "Контроллер", variable = self._varRbSmplThruNum_, value = "Controller") self.smplThruNumThGr = tk.Radiobutton(self._frSmplThruNum_, text = "ТредГрупп", variable = self._varRbSmplThruNum_, value = "ThreadGroup") self.smplThruNumTstPl = tk.Radiobutton(self._frSmplThruNum_, text = "ТестПлан", variable = self._varRbSmplThruNum_, value = "TestPlan") self.smplThruNumCntrl.pack(side = tk.TOP, anchor = tk.W) self.smplThruNumThGr.pack(side = tk.TOP, anchor = tk.W) self.smplThruNumTstPl.pack(side = tk.TOP, anchor = tk.W) self.cbIfNotRstrUnqInSmpl = tk.Checkbutton(self._frSmplUnqOptLabelF_, text = "Не восст. ориг. назв. сэмпл.", variable = self._varCbIfNotRstrUnqInSmpl_) self.cbIfCutUrl.pack(side = tk.TOP, anchor = tk.W) self.smplThruNum.pack(side = tk.TOP, anchor = tk.W) self.cbIfNotRstrUnqInSmpl.pack(side = tk.TOP, anchor = tk.W) self.smplUnqOptLabelF.pack(anchor = tk.E) self.smplUnqOptFrame.config(width = self.smplThruNum.winfo_reqwidth(), padx = 100) self.paramVolatilFrame = tk.Frame(self.topElemsFrame) self.update_idletasks() leftCornerWidth = self._frSmplUnqOptLabelF_.winfo_reqwidth() + int(self.smplUnqOptLabelF.cget("borderwidth")) * 2 leftCornerHeight = self.smplUnqOptLabelF.winfo_reqheight() + 2 self.paramVolatilFrame.config(width = leftCornerWidth + 202, height = leftCornerHeight) self.paramVolatilFrame.pack_propagate(0) self.paramVolatilLabel = tk.LabelFrame(self.paramVolatilFrame) self._lbParamVolatilLabel_ = self.getSubWgts(self.paramVolatilLabel, tk._dummyLabel) self._lbParamVolatilLabel_.config(text = "Статистика") self._frParamVolatilLabel_ = self.getSubWgts(self.paramVolatilLabel, tk._dummyFrame) self.frBtGetVolatilPrm = tk.Frame(self._frParamVolatilLabel_) self.btBtGetVolatilPrm = tk.Button(self.frBtGetVolatilPrm, text="Получ. стат. по парам.") self.rBtGetVolatilPrm = tk.Radiobutton(self.frBtGetVolatilPrm, text = 'Волатил. ', variable = self._volatilPrm_, value = True) self.rBtGetNonVolatilPrm = tk.Radiobutton(self.frBtGetVolatilPrm, text = 'Не волатил.', variable = self._volatilPrm_, value = False) self.btBtGetVolatilPrm.config(relief='groove') self.btBtGetVolatilPrm.config(command = self.prcdfGetVolatilPrms) self.frBtGetVolatilPrm.pack(side = tk.TOP, anchor = tk.W) self.btBtGetVolatilPrm.pack(side = tk.LEFT) self.rBtGetVolatilPrm.pack(side = tk.TOP, anchor = tk.W) self.rBtGetNonVolatilPrm.pack(side = tk.TOP, anchor = tk.W) self.paramVolatilLabel.pack(anchor = tk.W) ##self.msgsToAscFrame = tk.Listbox(self.loadFrame, relief='flat', selectmode='multiple') ##self.vScroll = tk.Scrollbar(self.loadFrame, orient=tk.VERTICAL) ##self.msgsToAscFrame.config( yscrollcommand=self.vScroll.set) self.consFrame = tk.LabelFrame(self.mFrame) #self.varsFrame = tk.LabelFrame(self.fsFrame) ##self.btnCollctnFrame = tk.LabelFrame(self.fsFrame) self.mCllctnFrame = tk.Frame(self.mFrame) self._lbBtnLstFrame_ = self.getSubWgts(self.btnLstFrame, tk._dummyLabel) self._lbBtnLstFrame_.config(text = 'Раб. с исх. Xml-дер.') self._frBtnLstFrame_ = self.getSubWgts(self.btnLstFrame, tk._dummyFrame) self.varsFrame = tk.Frame(self._frBtnLstFrame_, borderwidth=2, bg = 'blue') self.vrSPathFrame = tk.Label(self.varsFrame) self.vrFnameFrame = tk.Label(self.varsFrame) self.vrUnqFNmFrame = tk.Label(self.varsFrame) #self.vrPileCllctnFrame = tk.Label(self.varsFrame) self.vrRestreFNmFrame = tk.Label(self.varsFrame) self._btnLstFrame_ = tk.Frame(self._frBtnLstFrame_, borderwidth = 2) self.btCatchJMXFiles = tk.Button(self._btnLstFrame_, text="Собрать все \n.jmx файлы", fg="green") #self.btCatchJMXFiles.config(command = self.testFrame) self.btCatchJMXFiles.config(command = self.prcdCatchJMXFiles) self.btCatchJMXFiles.config(relief='raised') self.btCatchJMXFiles.pack(fill = 'x') #self.jmscdObj.setFName = 'toParce.jmx' self.btGetJMXMkTree = tk.Button(self._btnLstFrame_, text="Получить дерево из \n.jmx файла", fg="green") self.btGetJMXMkTree.config(command = self.prcdGetJMXMkTree) self.btGetJMXMkTree.config(relief='raised') self.btGetJMXMkTree.pack(fill = 'x') self.btTreeUnqNms = tk.Button(self._btnLstFrame_, text="Сген. колл. \nс уник. именами") self.btTreeUnqNms.config(command = self.prcdTreeUnqNms) self.btTreeUnqNms.config(relief='raised', state = tk.DISABLED) self.btTreeUnqNms.pack(fill = 'x') self.btRstrOrigNms = tk.Button(self._btnLstFrame_, text="Восст. ориг. имена\nдля получен. колл.") self.btRstrOrigNms.config(command = self.prcdRstrOrigNms) self.btRstrOrigNms.config(relief='raised') self.btRstrOrigNms.pack(fill = 'x') self.vrSPathLabel = tk.Label(self.vrSPathFrame) self.vrSPathValue = tk.Entry(self.vrSPathFrame, bg='white') self.vrSPathLabel.config(text='Каталог с (*.jmx) файл.:', justify = tk.LEFT) self.vrSPathValue.config(justify = tk.LEFT) self.vrSPathValue.insert(0, self.jmscdObj.setPATH) self.vrSPathLabel.pack(side = tk.LEFT) self.vrSPathValue.pack(side = tk.LEFT) self.vrSPathFrame.pack(side = tk.TOP) self.vrFnameLabel = tk.Label(self.vrFnameFrame) self.vrFnameValue = tk.Entry(self.vrFnameFrame, bg='white') self.vrFnameLabel.config(text='Файл(*.jmx) для парам.:', justify = tk.LEFT) self.vrFnameValue.config(justify = tk.LEFT) self.vrFnameValue.insert(0, self.jmscdObj.setFName) self.vrFnameLabel.pack(side = tk.LEFT) self.vrFnameValue.pack(side = tk.LEFT) self.vrFnameFrame.pack(side=tk.TOP) self.vrUnqFNmLabel = tk.Label(self.vrUnqFNmFrame) self.vrUnqFNmValue = tk.Entry(self.vrUnqFNmFrame, bg = 'white') self.vrUnqFNmLabel.config(text='Файл(*.jmx), униф. элм.:', justify = tk.LEFT) self.vrUnqFNmValue.config(justify = tk.LEFT) self.vrUnqFNmValue.insert(0, self.jmscdObj.outFileUniqueNames) self.vrUnqFNmLabel.pack(side = tk.LEFT) self.vrUnqFNmValue.pack(side = tk.LEFT) self.vrUnqFNmFrame.pack(side=tk.TOP) self.vrRestreFNmLabel = tk.Label(self.vrRestreFNmFrame) self.vrRestreFNmValue = tk.Entry(self.vrRestreFNmFrame, bg = 'white') self.vrRestreFNmLabel.config(text='Файл(*.jmx), восcт. элм.:', justify = tk.LEFT) self.vrRestreFNmValue.config(justify = tk.LEFT) self.vrRestreFNmValue.insert(0, self.jmscdObj.outFileRestrdOrig) self.vrRestreFNmLabel.pack(side = tk.LEFT) self.vrRestreFNmValue.pack(side = tk.LEFT) self.vrRestreFNmFrame.pack(side=tk.TOP) self._btnLstFrame_.pack(side = tk.TOP) self.varsFrame.pack(side=tk.TOP) ## self.frPileOptns = tk.LabelFrame(self.mCllctnFrame) self._lbFrPileOptns_ = self.getSubWgts(self.frPileOptns, tk._dummyLabel) self._lbFrPileOptns_.config(text = 'Получ. осн. колл.') self._frPileOptns_ = self.getSubWgts(self.frPileOptns, tk._dummyFrame) self.scrollPileMCllt = tk.Scrollbar(self._frPileOptns_, orient = tk.VERTICAL) self.scrollPileMCllt.pack(side = tk.RIGHT, fill = 'y') self.lsbxPileMCllct = tk.Listbox(self._frPileOptns_, height = 4, width = 34, yscrollcommand = self.scrollPileMCllt.set) for itm in range(4): self.lsbxPileMCllct.insert(tk.END, '--') self.btPileMCllct = tk.Button(self._frPileOptns_, text="Аккумул. раб. коллекц.") self.btPileMCllct.config(command = self.prcdPileMCllct, relief='groove') self.lsbxPileMCllct.pack(side = tk.TOP) self.btPileMCllct.pack(side = tk.TOP) self.frPileOptns.pack(side = tk.LEFT) self.scrollPileMCllt.config(command = self.lsbxPileMCllct.yview) self.frOutRslts = tk.LabelFrame(self.mCllctnFrame) self._lbFrOutRslts_ = self.getSubWgts(self.frOutRslts, tk._dummyLabel) self._lbFrOutRslts_.config(text = 'Текущ. знач.') self._frOutRslts_ = self.getSubWgts(self.frOutRslts, tk._dummyFrame) self.entStrVar = tk.StringVar(self._frOutRslts_) #self.entStrVar.set(self.jmscdObj.entityNames[2]) # default value self.lstWrkEnts = tk.OptionMenu(self._frOutRslts_, variable = self.entStrVar) for ent in self.jmscdObj.entityNames: self.lstWrkEnts.add_command(ent) self.entStrVar.set(self.jmscdObj.entityNames[2]) #self.lstWrkEnts = tk.Listbox(self.mCllctnFrame) ##Опция выбора сущности на данный момент выключена ####self.lstWrkEnts.pack(side = tk.TOP) self.tstOutText = tk.Text(self._frOutRslts_, state = tk.DISABLED, bg='#FFEFD5')#, width=64) self.tstOutText.pack(side = tk.TOP) self.txtWdgtDelete(False) self.txtWdgtInsert(self._initText_) # self.frWrInfExtCntrlElm = tk.Frame(self._frOutRslts_) self.btWriteChngsToF = tk.Button(self.frWrInfExtCntrlElm, text='Запис. изм.\nв файл') self.btWriteChngsToF.config(command = self.prcdWrtXmlTree) self.btUpdateXMLTree = tk.Button(self.frWrInfExtCntrlElm, text='Обнов. \nxml-дерево') self.btUpdateXMLTree.config(command = self.prcdUpdtXMLTree, state = tk.DISABLED) self.btUpdateXMLTree.pack(side = tk.LEFT) self.btWriteChngsToF.pack(side = tk.LEFT) self.frWrInfExtCntrlElm.pack(side = tk.BOTTOM) # self.frOutRslts.pack(side = tk.LEFT) ### self.frGetCollctnData = tk.Frame(self.mCllctnFrame) # self.frGetListKeys = tk.LabelFrame(self.frGetCollctnData) self._frGetListKeys_ = self.getSubWgts(self.frGetListKeys, tk._dummyFrame) self.frBtGetLstKeys = tk.Frame(self._frGetListKeys_) self.btGetListKeys = tk.Button(self.frBtGetLstKeys, text="Список получ. ключей:") self.varRBtLstKeys = tk.IntVar() self.varRBtLstKeys.set(1) self.rBtLstKeysPrms = tk.Radiobutton(self.frBtGetLstKeys, text = 'Парам. ', variable = self.varRBtLstKeys, value = 1) self.rBtLstKeysLnks = tk.Radiobutton(self.frBtGetLstKeys, text = 'Ссылки', variable = self.varRBtLstKeys, value = 2) self.btGetListKeys.config(relief='groove') self.btGetListKeys.config(command = self.prcdfGetListKeys) self._lbGetListKeys_ = self.getSubWgts(self.frGetListKeys, tk._dummyLabel) self._lbGetListKeys_.config(text = 'Раб. с осн. коллекц.') self.frBtGetLstKeys.pack(side = tk.TOP, anchor = tk.W) self.btGetListKeys.pack(side = tk.LEFT) self.rBtLstKeysPrms.pack(side = tk.TOP, anchor = tk.E) self.rBtLstKeysLnks.pack(side = tk.TOP, anchor = tk.E) self.frGetListKeys.pack(side = tk.TOP, fill = 'x') # self.frGetDictData = tk.Frame(self._frGetListKeys_) self.frGetDictData.config(borderwidth = 2, bg = 'green') ## self.frGetDataDictItem = tk.Frame(self.frGetDictData) self.vlGetDataDictItem = tk.Entry(self.frGetDataDictItem, bg='white') self.vlGetDataDictItem.insert(0, '<знач.ключа>') self.btGetDataDictItem = tk.Button(self.frGetDataDictItem, text="Все знач.\nпо задан. ключу:") self.btGetDataDictItem.config(command = self.prcdGetDataDictItem) self.btGetDataDictItem.config(relief='groove') self.btGetDataDictItem.pack(side= tk.LEFT) self.vlGetDataDictItem.pack(side = tk.RIGHT, fill = 'y') self.frGetDataDictItem.pack(side = tk.TOP) ## self.frGetScrLstByNm = tk.Frame(self.frGetDictData) self.btGetScrLstByNm = tk.Button(self.frGetScrLstByNm, text="Все контрлр.\nпо задан. ключу:") self.btGetScrLstByNm.config(command = self.prcdGetScrLstByNm) self.btGetScrLstByNm.config(relief='groove') self.vlGetScrLstByNm = tk.Entry(self.frGetScrLstByNm, bg='white') self.vlGetScrLstByNm.insert(0, '<знач.ключа>') self.chkBtVar = tk.BooleanVar(self.frGetScrLstByNm) self.chkBtVar.set(False) self.chkGetScrLstByNm = tk.Checkbutton(self.frGetScrLstByNm, text='Вывод сэмплр.', variable=self.chkBtVar) self.btGetScrLstByNm.pack(side= tk.LEFT) self.vlGetScrLstByNm.pack(side = tk.TOP) self.chkGetScrLstByNm.pack(side = tk.LEFT) self.frGetScrLstByNm.pack(side = tk.TOP) ## self.frGetScrFncByKeyVal = tk.Frame(self.frGetDictData) self.btGetScrFncByKeyVal = tk.Button(self.frGetScrFncByKeyVal, text="Все контрлр.\nпо паре кл.-зн.:") self.btGetScrFncByKeyVal.config(command = self.prcdGetScrFncByKeyVal) self.btGetScrFncByKeyVal.config(relief='groove') self.vlGetScrFncByKeyVal = tk.Entry(self.frGetScrFncByKeyVal, bg='white') self.vlGetScrFncByKeyVal.insert(0, '<знач.ключа>') self.vrGetScrFncByKeyVal = tk.Entry(self.frGetScrFncByKeyVal, bg='white') self.vrGetScrFncByKeyVal.insert(0, '<знач.парам.>') self.chkKeyVlVar = tk.BooleanVar(self.frGetScrFncByKeyVal) self.chkKeyVlVar.set(False) self.chkGetScrFncByKeyVal = tk.Checkbutton(self.frGetScrFncByKeyVal, text='Вывод сэмплр.', variable=self.chkKeyVlVar) self.btGetScrFncByKeyVal.pack(side= tk.LEFT, fill='y') self.vlGetScrFncByKeyVal.pack(side = tk.TOP) self.vrGetScrFncByKeyVal.pack(side = tk.TOP) self.chkGetScrFncByKeyVal.pack(side = tk.LEFT) self.frGetScrFncByKeyVal.pack(side = tk.TOP, fill='x') ## self.frGetValByKSF = tk.Frame(self.frGetDictData) self.frGetValByKSF.config(borderwidth = 1, bg = 'red') self.blnMsg = tk.Balloon(self.frGetValByKSF, initwait = 350, bg='yellow') self.blnMsgText = 'Внимание!\nНазвания контроллеров и сэмплеров (возможно) были изменены,\nследует сверять в jmeter по файлу "(*.jmx) униф. эл"' self.blnMsg.bind_widget(self.frGetValByKSF, msg = self.blnMsgText) self.btGetValByKSF = tk.Button(self.frGetValByKSF, text="Значен. для\n кл.-кнтр.-смпл.:") self.btGetValByKSF.config(command = self.prcdGetValByKSF) self.btGetValByKSF.config(relief='groove') self.vlGetValByKSF = tk.Entry(self.frGetValByKSF, bg='white') self.vlGetValByKSF.insert(0, '<знач.ключа>') self.ctGetValByKSF = tk.Entry(self.frGetValByKSF, bg='white') self.ctGetValByKSF.insert(0, '<назв. контрлр.>') self.smGetValByKSF = tk.Entry(self.frGetValByKSF, bg='white') self.smGetValByKSF.insert(0, '<назв. сэмплр.>') self.btGetValByKSF.pack(side= tk.LEFT, fill='y') self.vlGetValByKSF.pack(side = tk.TOP) self.ctGetValByKSF.pack(side = tk.TOP) self.smGetValByKSF.pack(side = tk.TOP) self.frGetValByKSF.pack(side = tk.TOP, fill='x') ## self.frSetValsToSlctn = tk.Frame(self._frGetListKeys_, pady = 2) self.btSetValsToSlctn = tk.Button(self.frSetValsToSlctn, text = 'Установ.\n для дан.\n элемен.\n словар.') self.btSetValsToSlctn.config(command = self.prcdSetValsToSlctn, state = tk.DISABLED, relief = "groove") self.lblSetValsToSlctn = tk.Label(self.frSetValsToSlctn, text = ' <==> ') self.entSetValsToSlctn = tk.Entry(self.frSetValsToSlctn, bg='white') self.entSetValsToSlctn.insert(0, '*новое знач.*') self.btSetValsToSlctn.pack(side = tk.LEFT, anchor=tk.W) self.lblSetValsToSlctn.pack(side = tk.LEFT) self.entSetValsToSlctn.pack(side = tk.RIGHT, anchor=tk.E) ### self.frGetDictData.pack(side = tk.TOP) self.frSetValsToSlctn.pack(side = tk.TOP, anchor = tk.W) # self.frGetCollctnData.pack(side = tk.LEFT) #for lstEntr in self.jmscdObj.entityNames: # self.lstWrkEnts.insert(tk.END, lstEntr) self.fsFrame.pack(side="top", fill='x') self.mCllctnFrame.pack(side=tk.LEFT, fill='x') ##self.loadFrame.pack(side="top", fill='x') self.smplUnqOptFrame.pack(side = tk.RIGHT, anchor = tk.E) self.btnLstFrame.pack(side = tk.RIGHT) self.paramVolatilFrame.pack(side = tk.RIGHT) self.topElemsFrame.pack(side="top", fill='y')
def refresh(self, bundle): # Nustatomas lango pavadinimas self._controller.title(Constants.TITLE_HOME) # Isvalomi pries tai lange buve elementai pasinaudojant elementu is klases WindowUtils (paveldejimas) self.clearWindow() infoLabel = tkx.Label( self, text= "Iveskite didesni uz 0 sveika skaiciu \nis kurio bus sugeneruotas jusu nurodyto dydzio teigiamu skaiciu masyvas" ) infoLabel.pack() self._numberValue = tkx.StringVar(self) self._numberValue.trace("w", self.entryChangeListener) self._threadValue = tkx.StringVar(self) self._threadValue.trace("w", self.entryChangeListener) self._numberEntry = tkx.Entry(self, textvariable=self._numberValue) self._numberEntry.pack() threadInfoLabel = tkx.Label( self, text= "Iveskite sveika skaiciu, kuris nurodys pasirinktu giju kieki (maziausiai 1, daugiausiai 3)" ) threadInfoLabel.pack() self._threadsEntry = tkx.Entry(self, textvariable=self._threadValue) self._threadsEntry.pack() typeInfoLabel = tkx.Label( self, text="Pasirinkite programos veiksmu vykdymo budus") typeInfoLabel.pack() self._choicesFrame = tkx.Frame(self) self._choicesFrame.pack() # CheckBoxes arba kitaip veiksmu vykdymo tipu pasarinkimas self._choices = ("Nuoseklus vykdymas", "Gijomis paremtas vykdymas") self._optionsMenuValue = [] self._optionsMenuButtons = [] for i in range(len(self._choices)): # Nustatoma mygtuko reiksme. 1 - pasirinkta, 0 - nepasirinkta self._optionsMenuValue.append(tkx.IntVar(value=1)) self._optionsMenuValue[i].trace("w", self.entryChangeListener) self._optionsMenuButtons.append( tkx.Checkbutton(self._choicesFrame, text=self._choices[i], variable=self._optionsMenuValue[i], onvalue=1, offvalue=0)) self._optionsMenuButtons[i].pack() self._buttonsFrame = tkx.Frame(self) self._buttonsFrame.pack() self._submitButton = tkx.Button(self._buttonsFrame, text="Vykdyti") self._submitButton.pack( side="left", anchor=tkx.NW, expand=True, ) # Veiksmu vykdyma perkeliu i atskira Thread'a, kad neatsitiktu taip, jog esant dideliam duomenu kiekiui # programa taps "not responding" self._submitButton.config( command=lambda: threading.Thread(target=self.doActions).start(), state='disabled') self._clearButton = tkx.Button(self._buttonsFrame, text="Isvalyti") self._clearButton.pack( side="left", anchor=tkx.NW, expand=True, ) self._clearButton.config(command=partial(self._actionClear)) self._exitButton = tkx.Button(self._buttonsFrame, text="Uzdaryti") self._exitButton.pack( side="left", anchor=tkx.NW, expand=True, ) self._exitButton.config(command=lambda: self._controller.exit()) self._errorLabel = tkx.Label(self, text="") self._errorLabel.pack() self._progressLabel = tkx.Label(self, text="") self._progressLabel.pack()
def daily_rec(self): def cal(c): import sys import calendar root = tkinter.Toplevel() root.title('Ttk Calendar') root.grab_set() w = c.winfo_reqheight() h = c.winfo_reqheight() print(w, h) root.geometry('+%d+%d' % (w, h)) tkinter.Label(root, text='NEW').pack() root.mainloop() def check(): for e, i in enumerate(v1): if i.get() == 1: for j in v2[e]: j.set(1) else: for j in v2[e]: j.set(0) def cur_enter(ev, t1, t2, t3, t4): t1.config(fg='red') t2.config(fg='red') t4.config(fg='red') t3.config(foreground='red') def cur_leave(ev, t1, t2, t3, t4): t1.config(fg='black') t2.config(fg='black') t4.config(fg='black') t3.config(foreground='black') def log_out(): m = messagebox.askyesno('Alert', 'Do you want to Log Out ?') if m: l.log(self.n1) frame = tkinter.Frame(self.f1) frame.pack(pady=20, fill='x', expand=True) back = ttk.Button(frame, text='<- Log Out', command=log_out) back.grid(padx=20) f = ttk.Frame(frame) f.grid(row=0, column=1, padx=400) ttk.Label(f, text='Date : ', font=(14)).grid(row=0, column=0) e = ttk.Entry(f, font=(14), width=9) e.grid(row=0, column=1) e.insert(0, time.strftime('%d/%m/%Y')) #e.config(state='disable') '''c = ttk.Button(f, text='Calender') c.config(command=lambda c=c: cal(c)) c.grid(row=0, column=2, padx=5)''' submit = ttk.Button(f, text="Submit ->") submit.grid(row=0, column=3, padx=435) data = teachers.lec() if data is []: for _ in data: if _[0] == self.user: c = _[1].split(',') c.sort() break else: pass else: c = ["CSE", "ECE", "ELECTRICAL", "CIVIL", "MECHANICAL"] c.sort() n2 = ttk.Notebook(self.f1, width=1200, height=600) n2.pack(fill='both', expand=True) v1 = [] v2 = [] for i in range(0, len(c)): f = ttk.Frame(n2) n2.add(f, text=' ' + c[i] + ' ') canvas1 = tkinter.Canvas(f) scrolly = tix.Scrollbar(f, command=canvas1.yview, orient='vertical') canvas1.pack(side='left', fill='both', expand=True) scrolly.pack(side='right', fill='y') f2 = tkinter.Frame(canvas1, width=1100, height=550) ttk.Label(f2, text='S.No.', font=('times', 14)).grid(row=0, column=0, padx=80, pady=20) ttk.Label(f2, text='Roll No.', font=('times', 14)).grid(row=0, column=1, padx=80, pady=20) ttk.Label(f2, text='Name', font=('times', 14)).grid(row=0, column=2, padx=80, pady=20) ttk.Label(f2, text='Total Attended', font=('times', 14)).grid(row=0, column=4, padx=80, pady=20) '''e = tix.Entry(f2) e.insert(0, '01/01/2018') e.grid(row=0, column=3, padx=80, pady=20)''' v11 = tkinter.Variable() v11.set(0) v1.append(v11) v21 = [] v2.append(v21) for j in range(0, 50): v21.append(tkinter.Variable()) v21[j].set(0) t1 = tkinter.Label(f2, text=j + 1, font=('helvatica', 12)) t1.grid(row=j + 3, column=0, padx=20) t2 = tkinter.Label(f2, text='181' + str(j), font=('helvatica', 12)) t2.grid(row=j + 3, column=1, padx=70) t3 = ttk.Label(f2, text='Student-' + str(j + 1), font=('helvatica', 12), wraplength=100) t3.grid(row=j + 3, column=2, columnspan=2, padx=70) t4 = tkinter.Label(f2, text=str(random.randrange(10)) + '/10', font=('helvatica', 12)) t4.grid(row=j + 3, column=4) t5 = tix.Checkbutton(f2, onvalue=1, offvalue=0, variable=v21[j], font=('helvatica', 20)) t5.grid(row=j + 3, column=5, padx=70) t1.bind('<Enter>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_enter( ev, t1, t2, t3, t4)) t2.bind('<Enter>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_enter( ev, t1, t2, t3, t4)) t3.bind('<Enter>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_enter( ev, t1, t2, t3, t4)) t4.bind('<Enter>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_enter( ev, t1, t2, t3, t4)) t5.bind('<Enter>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_enter( ev, t1, t2, t3, t4)) t1.bind('<Leave>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_leave( ev, t1, t2, t3, t4)) t2.bind('<Leave>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_leave( ev, t1, t2, t3, t4)) t3.bind('<Leave>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_leave( ev, t1, t2, t3, t4)) t4.bind('<Leave>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_leave( ev, t1, t2, t3, t4)) t5.bind('<Leave>', lambda ev, t1=t1, t2=t2, t3=t3, t4=t4: cur_leave( ev, t1, t2, t3, t4)) '''for k in range(3, 200): tix.Label(f2, text=k).grid(row=1, column=k)''' tix.Checkbutton(f2, text='All', onvalue=1, offvalue=0, variable=v11, command=check).grid(row=0, column=5) canvas1.create_window(0, 0, window=f2) f2.update_idletasks() canvas1.itemconfigure("frame") canvas1.config(scrollregion=canvas1.bbox("all")) canvas1.config(yscrollcommand=scrolly.set)