3

I'm working on a scrolling list of Checkbuttons using the technique from this post.

I've noticed that the created windows within the Text widget will sometimes "spill over" the top and bottom borders of the widget itself:

enter image description here

Obviously it doesn't stop the widget from doing its job, but it just looks sloppy, and I tend to be picky about such things.

Tweaking the height of the widget can reduce the instances of it, but doesn't stop it from happening. The pady setting doesn't help either, as it is only applied to the absolute top and bottom of the entire contents (vs. the currently-visible portion).

I even tried switching to a Canvas instead of a Text widget, but the same spillover occurs, even when I use yscrollincrement to gain full control over the scrolling behaviour.

Is this just a limitation of Tkinter, or is there some other setting or a clever approach that I'm missing?

In case it matters, my environment is Python 2.7.6, on Windows 7.

Community
  • 1
  • 1
JDM
  • 1,709
  • 3
  • 25
  • 48

1 Answers1

3

Set the borderwidth of the Text widget to zero. If you still want the "sunken" look, you can configure the outer frame.

nbro
  • 15,395
  • 32
  • 113
  • 196
Oblivion
  • 1,669
  • 14
  • 14
  • 1
    The phrase "outer frame" was the key here -- I wasn't using anything to frame-in the text widget. I did end up switching to a Canvas widget instead (configured with `tk.FLAT` relief), but put it inside a Frame widget configured with `tk.GROOVE` relief). The edges are firmly defined now with no spillover. – JDM Dec 09 '14 at 13:50