@@ -500,7 +500,7 @@ def _show_title(self):
500
500
self ._win .chgat (0 , x , 4 , curses .color_pair (12 ))
501
501
else :
502
502
self ._win .chgat (0 , x , 2 , curses .color_pair (12 ))
503
- self ._win . refresh ()
503
+ self ._refresh ()
504
504
505
505
def _show_buttons (self ):
506
506
sid = 3
@@ -1301,7 +1301,7 @@ def show(self, parent=None):
1301
1301
if parent :
1302
1302
self ._parent = parent
1303
1303
self ._get_window ()
1304
- self ._win .bkgdset (' ' , curses .color_pair (12 ))
1304
+ self ._win .bkgdset (' ' , curses .color_pair (3 ))
1305
1305
self ._win .erase ()
1306
1306
self ._win .box ()
1307
1307
self ._show_title ()
@@ -1328,12 +1328,6 @@ def show(self, parent=None):
1328
1328
self ._editor .set_global_functions (self ._global_functions )
1329
1329
self ._editor ._paste_mode = False
1330
1330
self ._editor .chars_to_accept = [ str (x ) for x in range (0 , 10 )]
1331
- self ._editor .set_local_functions (
1332
- local_functions = {
1333
- ord ('j' ): self ._toggle_selection ,
1334
- ord ('k' ): self ._toggle_selection
1335
- }
1336
- )
1337
1331
self ._editor .string = self ._the_port
1338
1332
1339
1333
@@ -1349,33 +1343,33 @@ def show(self, parent=None):
1349
1343
1350
1344
1351
1345
try :
1352
- self ._win .addstr (7 , 3 , '─' * (self .maxX - 6 ), curses .color_pair (12 ))
1346
+ self ._win .addstr (7 , 3 , '─' * (self .maxX - 6 ), curses .color_pair (3 ))
1353
1347
except :
1354
- self ._win .addstr (7 , 3 , '─' .encode ('utf-8' ) * (self .maxX - 6 ), curses .color_pair (12 ))
1355
- self ._win .addstr (7 , int ((self .maxX - 6 ) / 2 ), ' Help ' , curses .color_pair (4 ))
1356
- self ._win .addstr (8 , 8 , 'j' , curses .color_pair (4 ))
1348
+ self ._win .addstr (7 , 3 , '─' .encode ('utf-8' ) * (self .maxX - 6 ), curses .color_pair (3 ))
1349
+ self ._win .addstr (7 , int ((self .maxX - 6 ) / 2 ), ' Help ' , curses .color_pair (11 ))
1350
+ self ._win .addstr (8 , 8 , 'j' , curses .color_pair (11 ))
1357
1351
self ._win .addstr (', ' , curses .color_pair (10 ))
1358
- self ._win .addstr ('k' , curses .color_pair (4 ))
1352
+ self ._win .addstr ('k' , curses .color_pair (11 ))
1359
1353
self ._win .addstr (', ' , curses .color_pair (10 ))
1360
- self ._win .addstr ('Up' , curses .color_pair (4 ))
1354
+ self ._win .addstr ('Up' , curses .color_pair (11 ))
1361
1355
self ._win .addstr (', ' , curses .color_pair (10 ))
1362
- self ._win .addstr ('Down' , curses .color_pair (4 ))
1356
+ self ._win .addstr ('Down' , curses .color_pair (11 ))
1363
1357
self ._win .addstr (8 , 30 , 'Change selection.' , curses .color_pair (10 ))
1364
1358
1365
- self ._win .addstr (9 , 8 , 'h' , curses .color_pair (4 ))
1359
+ self ._win .addstr (9 , 8 , 'h' , curses .color_pair (11 ))
1366
1360
self ._win .addstr (', ' , curses .color_pair (10 ))
1367
- self ._win .addstr ('l' , curses .color_pair (4 ))
1361
+ self ._win .addstr ('l' , curses .color_pair (11 ))
1368
1362
self ._win .addstr (', ' , curses .color_pair (10 ))
1369
- self ._win .addstr ('Left' , curses .color_pair (4 ))
1363
+ self ._win .addstr ('Left' , curses .color_pair (11 ))
1370
1364
self ._win .addstr (', ' , curses .color_pair (10 ))
1371
- self ._win .addstr ('Right' , curses .color_pair (4 ))
1365
+ self ._win .addstr ('Right' , curses .color_pair (11 ))
1372
1366
1373
- self ._win .addstr (10 , 8 , 'Enter' , curses .color_pair (4 ))
1367
+ self ._win .addstr (10 , 8 , 'Enter' , curses .color_pair (11 ))
1374
1368
self ._win .addstr (', ' , curses .color_pair (10 ))
1375
- self ._win .addstr ('Space' , curses .color_pair (4 ))
1369
+ self ._win .addstr ('Space' , curses .color_pair (11 ))
1376
1370
self ._win .addstr (10 , 30 , 'Toggle IP.' , curses .color_pair (10 ))
1377
1371
1378
- self ._win .addstr (11 , 8 , 's' , curses .color_pair (4 ))
1372
+ self ._win .addstr (11 , 8 , 's' , curses .color_pair (11 ))
1379
1373
self ._win .addstr (11 , 30 , 'Start the Server.' , curses .color_pair (10 ))
1380
1374
1381
1375
self ._win .addstr (12 , 2 , 'Any other key will hide the window (not in editor).' , curses .color_pair (10 ))
@@ -1409,16 +1403,17 @@ def _toggle_selection(self):
1409
1403
if self ._selection == 0 :
1410
1404
self ._selection = 1
1411
1405
self ._editor .focused = True
1412
- self ._win .chgat (5 , self ._field_x , self ._field_width , curses .color_pair (6 ))
1406
+ self ._win .chgat (4 , self ._field_x , self ._field_width , curses .color_pair (10 ))
1413
1407
else :
1414
1408
if self ._validate_port ():
1415
1409
self ._selection = 0
1416
1410
self ._editor .focused = False
1417
- self ._win .chgat (5 , self ._field_x , self ._field_width , curses .color_pair (10 ))
1411
+ self ._win .chgat (4 , self ._field_x , self ._field_width , curses .color_pair (6 ))
1418
1412
else :
1419
1413
self ._port_number_error_message ()
1420
1414
self ._refresh ()
1421
1415
1416
+
1422
1417
def _validate_port (self ):
1423
1418
if self ._editor .string :
1424
1419
x = int (self ._editor .string )
@@ -1445,7 +1440,8 @@ def keypress(self, char):
1445
1440
self ._the_ip = 'LAN'
1446
1441
else :
1447
1442
self ._the_ip = 'localhost'
1448
- self ._win .addstr (5 , self ._field_x , self ._the_ip .ljust (self ._field_width ), curses .color_pair (6 ))
1443
+ self ._win .addstr (4 , self ._field_x , self ._the_ip .ljust (self ._field_width ), curses .color_pair (6 ))
1444
+ self ._refresh ()
1449
1445
1450
1446
elif char == ord ('r' ):
1451
1447
self ._the_ip = self ._cnf .active_remote_control_server_ip
0 commit comments