From: msw Date: Tue, 10 Aug 1999 03:08:09 +0000 (+0000) Subject: more changes for buttonchice, new release X-Git-Tag: r0-50~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dce6e54e1042ef9c1d11eb7e69ead428f8850d82;p=thirdparty%2Fnewt.git more changes for buttonchice, new release --- diff --git a/newt.spec b/newt.spec index 344aaad..60e9e6e 100644 --- a/newt.spec +++ b/newt.spec @@ -2,7 +2,7 @@ Summary: A development library for text mode user interfaces. Name: newt %define version 0.50 Version: %{version} -Release: 3 +Release: 4 Copyright: LGPL Group: System Environment/Libraries Source: ftp://ftp.redhat.com/pub/redhat/code/newt/newt-%{version}.tar.gz @@ -55,6 +55,9 @@ rm -rf $RPM_BUILD_ROOT %postun -p /sbin/ldconfig %changelog +* Mon Aug 9 1999 Matt Wilson +- added snack wrappings for checkbox flag setting + * Thu Aug 5 1999 Matt Wilson - added snack bindings for setting current listbox selection - added argument to set default selection in snack ListboxChoiceWindow diff --git a/snack.py b/snack.py index b30614a..3d239ce 100644 --- a/snack.py +++ b/snack.py @@ -100,9 +100,12 @@ class Textbox(Widget): class TextboxReflowed(Textbox): - def __init__(self, width, text, flexDown = 5, flexUp = 10): + def __init__(self, width, text, flexDown = 5, flexUp = 10, maxHeight = -1): (newtext, width, height) = reflow(text, width, flexDown, flexUp) - Textbox.__init__(self, width, height, newtext, 0) + if maxHeight != -1 and height > maxHeight: + Textbox.__init__(self, width, maxHeight, newtext, 1) + else: + Textbox.__init__(self, width, height, newtext, 0) class Label(Widget): @@ -449,7 +452,7 @@ def ButtonChoiceWindow(screen, title, text, buttons = [ 'Ok', 'Cancel' ], width = 40): bb = ButtonBar(screen, buttons) - t = TextboxReflowed(width, text) + t = TextboxReflowed(width, text, maxHeight = screen.height - 12) g = GridForm(screen, title, 1, 2) g.add(t, 0, 0, padding = (0, 0, 0, 1))