]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
more changes for buttonchice, new release
authormsw <msw>
Tue, 10 Aug 1999 03:08:09 +0000 (03:08 +0000)
committermsw <msw>
Tue, 10 Aug 1999 03:08:09 +0000 (03:08 +0000)
newt.spec
snack.py

index 344aaadcebdcd78e4631b0bf615c829a81bfd750..60e9e6ee20839489f67f9b0b57925ce0b287ada3 100644 (file)
--- 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 <msw@redhat.com>
+- added snack wrappings for checkbox flag setting
+
 * Thu Aug  5 1999 Matt Wilson <msw@redhat.com>
 - added snack bindings for setting current listbox selection
 - added argument to set default selection in snack ListboxChoiceWindow
index b30614a6a1fad0273bdace225f2accd0c1d4e4bf..3d239ce017143cb564cdefa7800a166e522486d6 100644 (file)
--- 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))