Skip to content

Commit

Permalink
Merge 3d60381 into 3c16666
Browse files Browse the repository at this point in the history
  • Loading branch information
kdschlosser committed Oct 31, 2017
2 parents 3c16666 + 3d60381 commit 702032d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions eg/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,23 @@ def EnsureVisible(window):
# set the new position and size
window.SetRect((left, top, right - left, bottom - top))

def EqualizeWidths(ctrls):
maxWidth = max((ctrl.GetBestSize()[0] for ctrl in ctrls))
for ctrl in ctrls:
ctrl.SetMinSize((maxWidth, -1))
def EqualizeWidths(*args):

def iter_ctrls(ctrls):
maxWidth = -99
for ctrl in ctrls:
if isinstance(ctrl, (list, tuple)):
iter_ctrls(ctrl)
continue
else:
maxWidth = max((ctrl.GetBestSize()[0], maxWidth))

if maxWidth != -99:
for ctrl in ctrls:
if not isinstance(ctrl, (list, tuple)):
ctrl.SetMinSize((maxWidth, -1))

iter_ctrls(args)

def ExecFile(filename, globals=None, locals=None):
"""
Expand Down

0 comments on commit 702032d

Please sign in to comment.