File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def main(win):
2323 curses .init_pair (2 , curses .COLOR_CYAN , 0 )
2424
2525 textbox = DialogBox (1 , 1 , # Position 1;1 in win.
26- 30 , 6 , # Height and width of textbox.
26+ 30 , 5 , # Height and width of textbox.
2727 "Tim-ats" , # Title of textbox.
2828 1 ) # Curses color_pair used to colored title.
2929
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def __init__(
4242 pos_y : int ,
4343 height : int ,
4444 width : int ,
45- title : str = "" ,
45+ title : Optional = None ,
4646 title_colors_pair_nb : int = 0 ,
4747 title_text_attr : Union [CursesTextAttribute ,
4848 CursesTextAttributes ] = curses .A_BOLD ,
@@ -66,7 +66,11 @@ def __init__(
6666
6767 self .text_wrapper = textwrap .TextWrapper (width = self .nb_char_max_line )
6868
69- def __enter__ (self ):
69+ def __repr__ (self ) -> str :
70+ """Return repr(self)."""
71+ return f"DialogBox(title={ self .title } )"
72+
73+ def __enter__ (self ) -> "DialogBox" :
7074 return self
7175
7276 def __exit__ (self , type , value , traceback ):
You can’t perform that action at this time.
0 commit comments