Skip to content

Commit

Permalink
Added horizontal scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
spavlick committed Oct 29, 2014
1 parent 29d237b commit e62cd4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ def generate_netlist(self):

def generate_netlist_errors(self):
self.generate_netlist()
'''errorfile=open('error.log','r')
for line in errorfile:
#errorfile=open('error.log','r')
'''for line in errorfile:
tkMessageBox.showerror(message=line)'''

class ScrollbarFrame(Frame):
Expand All @@ -480,12 +480,14 @@ def __init__(self, root):
Frame.__init__(self, root)
self.canvas = Canvas(root, borderwidth=0, background="#ffffff")
self.frame = GUI(root)
self.hsb = Scrollbar(root, orient="horizontal", command=self.canvas.xview)
self.vsb = Scrollbar(root, orient="vertical", command=self.canvas.yview)
self.canvas.configure(yscrollcommand=self.vsb.set)
self.canvas.configure(xscrollcommand=self.hsb.set,yscrollcommand=self.vsb.set)

self.vsb.pack(side="right", fill="y")
self.canvas.pack(side="left", fill="both", expand=True)
self.canvas.create_window((4,4), window=self.frame, anchor="nw",
self.hsb.pack(side="bottom",fill="x")
self.canvas.pack(side="top", fill="both", expand=True)
self.canvas.create_window((6,6), window=self.frame, anchor="nw",
tags="self.frame")

self.frame.bind("<Configure>", self.OnFrameConfigure)
Expand Down
14 changes: 8 additions & 6 deletions gui.py~
Original file line number Diff line number Diff line change
Expand Up @@ -470,22 +470,24 @@ class GUI(Frame):

def generate_netlist_errors(self):
self.generate_netlist()
'''errorfile=open('error.log','r')
for line in errorfile:
#errorfile=open('error.log','r')
'''for line in errorfile:
tkMessageBox.showerror(message=line)'''

class ScrollbarFrame(Frame):
def __init__(self, root):

Frame.__init__(self, root)
self.canvas = Canvas(root, borderwidth=0, background="#ffffff")
self.frame = GUI(self.root)
self.frame = GUI(root)
self.hsb = Scrollbar(root, orient="horizontal", command=self.canvas.xview)
self.vsb = Scrollbar(root, orient="vertical", command=self.canvas.yview)
self.canvas.configure(yscrollcommand=self.vsb.set)
self.canvas.configure(xscrollcommand=self.hsb.set,yscrollcommand=self.vsb.set)

self.vsb.pack(side="right", fill="y")
self.canvas.pack(side="left", fill="both", expand=True)
self.canvas.create_window((4,4), window=self.frame, anchor="nw",
self.hsb.pack(side="bottom",fill="y")
self.canvas.pack(side="top", fill="both", expand=True)
self.canvas.create_window((6,6), window=self.frame, anchor="nw",
tags="self.frame")

self.frame.bind("<Configure>", self.OnFrameConfigure)
Expand Down

0 comments on commit e62cd4d

Please sign in to comment.