je cherche des infos sur NSTextView et HTML càd quel est le html supporté (avec ou sans css, avec ou sans js) ???
Je ne suis pas sûr qu'il y en ait...
une.bevueVOTEZ
gilles wrote:
Je ne suis pas sûr qu'il y en ait...
si, ça marche, des extraits :
public void appendHtmlText(String theText) { NSData htmlData = new NSData(theText.getBytes()); NSAttributedString s = new NSAttributedString(((NSData) htmlData), new NSMutableDictionary()); myText.textStorage().setAttributedString(s); }
public static String open() { String line = "<html>n"; line += " <head>n"; line += " <title>Liste des bouteilles</title>n"; line += " <meta http-equiv='Content-type' content='text/html; charset=utf-8' />n"; line += " <style type='text/css'>n"; line += " h1 {color : red;}n"; line += " </style>n"; line += " </head>n"; line += " <body>n"; return line; }
public static String close() { String line = " </body>n</html>n"; return line; }
-- une bévue
gilles <gillesrobert@free.fr> wrote:
Je ne suis pas sûr qu'il y en ait...
si, ça marche, des extraits :
public void appendHtmlText(String theText) {
NSData htmlData = new NSData(theText.getBytes());
NSAttributedString s = new NSAttributedString(((NSData)
htmlData),
new NSMutableDictionary());
myText.textStorage().setAttributedString(s);
}
public static String open() {
String line = "<html>n";
line += " <head>n";
line += " <title>Liste des bouteilles</title>n";
line += " <meta http-equiv='Content-type'
content='text/html; charset=utf-8' />n";
line += " <style type='text/css'>n";
line += " h1 {color : red;}n";
line += " </style>n";
line += " </head>n";
line += " <body>n";
return line;
}
public static String close() {
String line = " </body>n</html>n";
return line;
}
public void appendHtmlText(String theText) { NSData htmlData = new NSData(theText.getBytes()); NSAttributedString s = new NSAttributedString(((NSData) htmlData), new NSMutableDictionary()); myText.textStorage().setAttributedString(s); }
public static String open() { String line = "<html>n"; line += " <head>n"; line += " <title>Liste des bouteilles</title>n"; line += " <meta http-equiv='Content-type' content='text/html; charset=utf-8' />n"; line += " <style type='text/css'>n"; line += " h1 {color : red;}n"; line += " </style>n"; line += " </head>n"; line += " <body>n"; return line; }
public static String close() { String line = " </body>n</html>n"; return line; }