November 09, 2007 why cannot i change the Text control's font ? | ||||
|---|---|---|---|---|
| ||||
setfont.handleEvent(codeText, DWT.Selection, delegate(Event e){
Text txt = cast(Text)e.cData;
Font oldFont = txt.getFont();
FontDialog fontDialog = new FontDialog (shell);
if(oldFont !is null)
fontDialog.setFontList(oldFont.getFontData());
FontData fontData = fontDialog.open ();
if (fontData !is null) {
Font newFont = new Font(display, fontData) ;
txt.font = newFont;
txt.setFont( newFont );
if(oldFont !is null) oldFont.dispose();
}
});
the code runs smoothly however the text control's font doesnot change !
--
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply