jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

Changing fonts for individual labels? #545

Closed BadgerHobbs closed 5 years ago

BadgerHobbs commented 5 years ago

Is it possible to change the font styles of individual labels?

As I understand, you do the following to change the font of all labels: app.setLabelFont(size=16, family="Century Gothic")

However I am unable to find any code or examples in the documentation to change the font of individual labels.

My initial thought was to try the following code, but that is the incorrect syntax. app.setLabelFont("Label_1",size=16, family="Century Gothic")

Is there any method for changing these components format individually or are they only all treated under the same umbrella.

jarvisteach commented 5 years ago

Hi @BadgerHobbs , you're right originally, it was intended that all labels had the same font. But, this isn't what people wanted. If you have a look here: http://appjar.info/pythonWidgetOptions/#basic-looks there's an example of changing individual widget fonts:

app.addLabel('l3', 'demo label')
app.getLabelWidget("l3").config(font="Helvetica 20 underline")

Or, in a single line:

app.addLabel("l3", 'label 1').config(font="Helvetica 20 underline")