[Wxsqueak] Changing Default Fonts
Rob Gayvert
rtg at rochester.rr.com
Fri Aug 15 01:49:32 UTC 2008
Most of the dev tools use WxPluggableTextWidget, which is a subclass of
WxStyledTextCtrl, which in turn is a wrapper around the Scintilla
editor. This gives it a lot of capabilities, but at the expense of
making some simple things non-obvious. In this case, #setFont: doesn't
do anything; instead, you need to change the "default style". Try
something like
textPane styleSetFont: wxStcStyleDefault font: (WxFont pointSize:
... etc ...)
.. Rob
Rob Rothwell wrote:
> On Sat, Aug 9, 2008 at 8:06 PM, Rob Gayvert <rtg at rochester.rr.com
> <mailto:rtg at rochester.rr.com>> wrote:
>
> Being able to set this via the Options dialog is certainly the plan,
> but unfortunately it's not there yet. For now, you'll need to set
> the font in the #createView method of each window.
>
>
> Ok...I hate to ask this one, but can you point me in the right direction
> with a seemingly straightforward window like the Transcript? I assume
> you need to add something like:
>
> textPane setFont: (WxFont pointSize: 28 family: wxDefault style:
> wxNormal weight: wxNormal underline: false faceName: 'Tahoma').
>
> to:
>
> WxTranscriptPresenter>>createView
>
> | textPane |
>
> self model: Transcript.
>
> view := WxFrame title: 'Transcript'.
> view setIcon: WxIcon sample.
> textPane := WxPluggableTextWidget parent: view.
>
> textPane
> on: model
> text: #contents
> accept: #acceptContents:
> readSelection: nil
> menu: #codePaneMenu:shifted:.
>
> But I'm not doing so good...!
>
> Rob
More information about the Wxsqueak
mailing list