how can i scroll text on a python tk/tinker Label? -


i'm trying add simple log output tk window/frame.

so far found how (easily) add vertical scrollbar on canvas, entry lists , text (which fullblown text editor , has no textvariable linking support)

the label can't attached scrollbar (easily) because lacks yview attribute.

#my naive attempt:... self.lbl_log = tk.label(self, width=80, height=10, textvariable=self.string_log) self.lbl_log.pack(side="top") self.vsb = tk.scrollbar(self, orient="vertical", command=self.lbl_log.yview) self.lbl_log.configure(yscrollcommand=self.vsb.set) 

attributeerror: 'label' object has no attribute 'yview'

is there easy , convenient way scroll label widget several lines in python tk? don't have use label because simple , has textvariable convenience) i'm open alternative widgets problem.

no, there isn't easy way scroll label. if need scroll multiple lines, label wrong choice of widget. if need scroll multiple lines of text, text widget proper widget.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -