Search code examples
smalltalkspecificationspharo

Pharo4 Spec GUI: How to change font size


I am thinking of programming my next project in Pharo. For this I will need to create a status monitor that can be seen from further away. The GUI is very simple. Basically just a few labels and buttons. Here is the problem: I need the font to be rather big - so that it can be seen from further away. How can I achieve this? Here is some sample code. My two labels need their font sitze changed:

initializeWidgets
  last1 := self newLabel.
  last1 label: '88,88'.

  last2 := self newLabel.
  last2 label: '99,99'.

Thanks a lot!!!


Solution

  • Not well supported for now. You can workaround this problem be resetting the font when the widget is built:

    |lm|
    lm:=LabelModel new.
    lm label:'Hello'.
    lm whenBuiltDo: [ :w | w widget font: (LogicalFont familyName: 'Source Code Pro' pointSize: 30)].
    lm openWithSpec.