55
66import curses
77import curses .textpad
8- import functools
9- from typing import (Any , Callable , List , Literal , NoReturn , Sequence , Tuple ,
10- Union )
8+ from typing import List , Literal , NoReturn , Sequence , Tuple , Union
119
1210from .error import PanicError , ValueNotInBound
1311from .type import (CursesKey , CursesTextAttribute , CursesTextAttributes ,
@@ -43,7 +41,8 @@ def __set__(self, obj: "BaseTextBox", value: int) -> NoReturn:
4341 minimum_box_width = 4
4442
4543 if value < minimum_box_width :
46- raise ValueNotInBound (f"width must be more than { minimum_box_width } " )
44+ raise ValueNotInBound ("width must be more than "
45+ f"{ minimum_box_width } " )
4746 else :
4847 obj ._width = value
4948
@@ -63,9 +62,15 @@ class BaseTextBox:
6362
6463 :param height: Height of the dialog box in ``curses`` window object
6564 on which methods will have effects.
65+ This value is covered by a descriptor to avoid unexpected behavior.
66+ Set this value to a value lower than title length and title box borders
67+ height (``len(self.title) + 5``) raises a ``ValueError``.
6668
6769 :param width: Width of the dialog box in ``curses`` window object on
6870 which methods will have effects.
71+ This value is covered by a descriptor to avoid unexpected behavior.
72+ Set this value to a value lower than 4 (the minimum box width)
73+ raises a ``ValueError``.
6974
7075 :param title: String that will be displayed in the upper left corner
7176 of dialog box.
0 commit comments