该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
刚看到个界面,试着写了一下,刚好有绑定scrollbar的:
#! /usr/bin/env python3
# coding: UTF-8
# python3.3
'''
@date: "2014-1-17"
@author: please call me lei_feng_shu_shu
@change: none
'''
from tkinter import *
import tkinter as tk
class Application():
----def __init__(self, root):
--------self.root = root
--------self.createFrameTop()
--------self.createFrameMiddle()
--------self.createFrameBottom()
----def createFrameTop(self):
--------'''top frame'''
--------self.frm_top = tk.LabelFrame(root)
--------self.text_top = tk.Text(self.frm_top, width=48, heigh=8)
--------self.text_top.grid(row = 0, column = 0)
--------self.scrollY_0 = tk.Scrollbar(self.frm_top, orient=VERTICAL, command=self.text_top.yview)
--------self.text_top["yscrollcommand"] = self.scrollY_0.set
--------self.scrollY_0.grid(row = 0, column = 1, sticky = 's'+'w'+'e'+'n')
--------self.frm_top.grid(row = 0, column = 0, sticky = 'WESN')
----def createFrameMiddle(self):
--------'''middle frame'''
--------self.frm_middle = tk.LabelFrame(root)
--------self.text_middle= tk.Text(self.frm_middle, width=48, heigh=8)
--------self.text_middle.grid(row = 0, column = 0)
--------self.scrollY_1 = tk.Scrollbar(self.frm_middle, orient=VERTICAL, command=self.text_middle.yview)
--------self.text_middle["yscrollcommand"] = self.scrollY_1.set
--------self.scrollY_1.grid(row = 0, column = 1, sticky = 's'+'w'+'e'+'n')
--------self.frm_middle.grid(row = 1, column = 0, sticky = 'WESN')