- 论坛徽章:
- 0
|
回复 127# cdhigh
还有一个很奇怪的bug。我用tabstrp生成四个tab,一开始没有问题。后面不知道怎么回事每次生成的代码顺序有点问题:
- self.TabStrip1__Tab4 = Frame(self.TabStrip1)
- self.LibList = Canvas(self.TabStrip1__Tab4, takefocus=1, yscrollcommand=self.LibTabVScroll.set)
- self.LibList.place(relx=0.024, rely=0.095, relwidth=0.584, relheight=0.763)
- self.LibTabVScroll['command'] = self.LibList.yview
- self.Check3Var = IntVar(value=0)
- self.style.configure('TCheck3.TCheckbutton', font=('宋体',9))
- self.Check3 = Checkbutton(self.LibList, text='Check3', variable=self.Check3Var, style='TCheck3.TCheckbutton')
- self.Check3.place(relx=0.041, rely=0.348, relwidth=0.62, relheight=0.099)
- self.Check2Var = IntVar(value=0)
- self.style.configure('TCheck2.TCheckbutton', font=('宋体',9))
- self.Check2 = Checkbutton(self.LibList, text='Check2', variable=self.Check2Var, style='TCheck2.TCheckbutton')
- self.Check2.place(relx=0.041, rely=0.221, relwidth=0.62, relheight=0.099)
- self.Check1Var = IntVar(value=0)
- self.style.configure('TCheck1.TCheckbutton', font=('宋体',9))
- self.Check1 = Checkbutton(self.LibList, text='Check1', variable=self.Check1Var, style='TCheck1.TCheckbutton')
- self.Check1.place(relx=0.041, rely=0.095, relwidth=0.62, relheight=0.099)
- self.LibNoteFont = Font(font=('宋体',9))
- self.LibNote = Text(self.TabStrip1__Tab4, font=self.LibNoteFont)
- self.LibNote.place(relx=0.666, rely=0.095, relwidth=0.299, relheight=0.763)
- self.LibNote.insert('1.0','Library Note\n')
- self.TabStrip1.add(self.TabStrip1__Tab4, text='Library')
复制代码 这个代码的问题在于还没有先定义Scrollbar就先在Canvas里面去绑定 yscrollcommand=self.ModTabVScroll.set,结果就会出现问题了。
这个问题一开始是没有的,我不清楚怎么跑出来的。后面一直都是这个有问题的顺序。 |
|