Malédictions: Quelle est la bonne façon d'ajouter des attributs à la fonction ADDSTR?
-
12-11-2019 - |
Question
Cela marche:
#!/usr/bin/env perl
use warnings;
use 5.012;
use Curses;
initscr();
addstr( 5, 5, 'Hello, World!' );
refresh();
sleep 2;
endwin();
Mais si j'ajoute un attribut à la fonction "addstr", cela ne fonctionne plus:
addstr( 5, 5, 'Hello, World!', A_BOLD );
De quoi dois-je changer, pour obtenir un "Hello World" audacieux?
La solution
addstr()
n'accepte pas les attributs. Utilisation attron()
/ attroff()
Au lieu:
attron(A_BOLD);
addstr(5, 5, 'Hello, world!');
attroff(A_BOLD);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow