[Mumps2Py:] [184] fixed text scrollbars resizing behavior. |
[ Thread Index |
Date Index
| More lists.mumps2py.org/discuss Archives
]
Revision: 184
Author: pgallot
Date: 2008-03-22 16:09:28 +0100 (Sat, 22 Mar 2008)
Log Message:
-----------
fixed text scrollbars resizing behavior.
Modified Paths:
--------------
trunk/mumps2py_ui.pyw
Modified: trunk/mumps2py_ui.pyw
===================================================================
--- trunk/mumps2py_ui.pyw 2008-03-20 22:46:49 UTC (rev 183)
+++ trunk/mumps2py_ui.pyw 2008-03-22 15:09:28 UTC (rev 184)
@@ -71,19 +71,26 @@
def create_scrolled_text(self, root, **kws):
""" created a frame with a Text widget with scrollbars"""
- new_frame = Frame(root, borderwidth = kws.get('borderwidth', 2))
- new_window = Text(new_frame, width = kws.get('width', 60),
- font = ("Consolas", 10), wrap = kws.get('wrap', NONE))
- new_vscroll = Scrollbar(new_frame, command = new_window.yview)
- new_hscroll = Scrollbar(new_frame, command = new_window.xview, \
- orient = HORIZONTAL)
- new_window.configure(yscrollcommand = new_vscroll.set, \
- xscrollcommand = new_hscroll.set)
- new_vscroll.pack(side = RIGHT, fill = Y)
- new_hscroll.pack(side = BOTTOM, fill = X)
- new_window.pack(side = LEFT, expand = YES)
- return (new_frame, new_window)
+ frame = Frame(root, borderwidth = kws.get('borderwidth', 2))
+ frame.grid_rowconfigure(0, weight=1)
+ frame.grid_columnconfigure(0, weight=1)
+
+ scrl_text = Text(frame, bd=2,
+ font = ("Consolas", 10),
+ width = kws.get('width', 60),
+ wrap = kws.get('wrap', NONE))
+ vscroll = Scrollbar(frame, command = scrl_text.yview)
+ vscroll.grid(row=0, column=1, sticky=N+S)
+ hscroll = Scrollbar(frame, command = scrl_text.xview,
+ orient = HORIZONTAL)
+ hscroll.grid(row = 1, column = 0, sticky= E + W)
+
+ scrl_text.configure(yscrollcommand = vscroll.set,
+ xscrollcommand = hscroll.set)
+ scrl_text.grid(row = 0, column = 0, sticky = N + S + E + W)
+ return (frame, scrl_text)
+
def info_window(self, msg_title = "Mumps2py", **kws):
""" generic popup for displaying a bunch of Text."""
popup = Toplevel(self.root)
@@ -863,14 +870,14 @@
b4_frame, window1 = self.create_scrolled_text(self.root,
width = text_width)
- b4_frame.pack(anchor = NW, side = LEFT, expand = YES)
+ b4_frame.pack(anchor = NW, side = LEFT, expand = YES, fill = BOTH)
self.before_window = window1
if self.show_after:
after_frame, window2 = self.create_scrolled_text(self.root, \
width = text_width)
- after_frame.pack(anchor = NE, side = RIGHT, expand = YES)
+ after_frame.pack(anchor = NE, side = RIGHT, expand = YES, fill = BOTH)
self.after_window = window2
UI = Mumps2pyUI(ROOT)