11# confrontation.py
2- #
3- # A concrete example exploiting the possibilities of Visual-dialog.
2+ # A concrete example exploiting the possibilities of Visual-dialog.
43
54import curses
65
1110# 10 and 32 correspond to enter and space keys.
1211PASS_DIALOG_KEY = (10 , 32 )
1312
13+
1414def main (stdscr ):
15- # Makes the cursor invisible.
15+ # Makes the cursor invisible.
1616 curses .curs_set (False )
1717
1818 # Definition of several colors pairs.
1919 curses .init_pair (1 , curses .COLOR_BLUE , curses .COLOR_BLACK )
2020 curses .init_pair (2 , curses .COLOR_MAGENTA , curses .COLOR_BLACK )
2121 curses .init_pair (3 , curses .COLOR_RED , curses .COLOR_BLACK )
2222
23- width , height = 6 , 35 # Width and height (in character).
23+ width , height = 6 , 35 # Width and height (in character).
2424
2525 max_y , max_x = stdscr .getmaxyx ()
2626
27- left_x = 2 # Left alignment.
28- right_x = max_x - height - 4 # Calculation of right alignment.
29- center_x = max_x // 2 - height // 2 # Calculation of center alignment.
30- bottom_y = max_y - width - 4 # Calculation of bottom alignment.
27+ left_x = 2 # Left alignment.
28+ right_x = max_x - height - 4 # Calculation of right alignment.
29+ center_x = max_x // 2 - height // 2 # Calculation of center alignment.
30+ bottom_y = max_y - width - 4 # Calculation of bottom alignment.
3131
3232 phoenix_wright = DialogBox (left_x , bottom_y ,
3333 height , width ,
3434 title = "Phoenix" ,
35- title_colors_pair_nb = 1 ) # Title and color_pair used to colored title.
35+ title_colors_pair_nb = 1 ) # Title and color_pair used to colored title.
3636
3737 april_may = DialogBox (center_x , bottom_y ,
3838 height , width ,
@@ -44,14 +44,14 @@ def main(stdscr):
4444 title = "Edgeworth" ,
4545 title_colors_pair_nb = 3 )
4646
47- # Definition of accepted key codes to pass a dialog.
47+ # Definition of accepted key codes to pass a dialog.
4848 phoenix_wright .confirm_dialog_key = PASS_DIALOG_KEY
4949 april_may .confirm_dialog_key = PASS_DIALOG_KEY
5050 miles_edgeworth .confirm_dialog_key = PASS_DIALOG_KEY
5151
5252 phoenix_wright .char_by_char (stdscr ,
5353 "This testimony is a pure invention !" ,
54- delay = 0.03 ) # Set delay between writting each characters to 0.03 seconde.
54+ delay = 0.03 ) # Set delay between writting each characters to 0.03 seconde.
5555
5656 phoenix_wright .char_by_char (stdscr ,
5757 "You're lying April May !" ,
0 commit comments