Programmer Reference : Common Widgets : Fonts : Using the system browser font
Using the system browser font
All of the browsers in VA Smalltalk are subclasses of EtWindow. This class keeps one font that every browser uses. You can find the browser font name by evaluating:
EtWindow fontName.
You can change the browser font from the File menu. If the browser font has not been changed, then the EtWindow class method fontName returns nil. If your window will use the browser font, then you can make the window a subclass of EtWindow. Your subclass should provide the instance method fontSettableWidgets, which answers a collection of all the widgets to be notified in case the font changes. EtWindow calls all of these widgets for you and tells them to change to the new font.
You can still use the browser font, even if your window does not subclass EtWindow. The following example creates a new window with the system font. The class method fontList in EtWindow returns either the current CwFontList, or nil if the font has not been changed.
|shell text fontList|
shell := CwTopLevelShell
createApplicationShell: 'shell'
argBlock: [:w | w title: 'Browser Font'].
fontList := EtWindow fontList.
fontList isNil ifTrue: [
fontList := CwFontList fontStruct:
(CgDisplay default defaultFontStruct) ].
text := shell
createText: 'text'
argBlock: [:w | w
columns: 60;
editMode: XmMULTILINEEDIT;
fontList: fontList].
text setString: 'This font is the system browser font.'.
text manageChild.
shell realizeWidget
Last modified date: 01/29/2015