[TKinter]How to set LabelFrames font and color from option file

Gene Heskett gheskett at shentel.net
Thu Dec 14 13:30:35 EST 2017


On Thursday 14 December 2017 11:29:03 Beppe wrote:

> Il giorno giovedì 14 dicembre 2017 16:36:24 UTC+1, Peter Otten ha 
scritto:
> > Beppe wrote:
> > > Il giorno giovedì 14 dicembre 2017 15:18:31 UTC+1, Peter Otten ha 
scritto:
> > >> Beppe wrote:
> > >> > I don't succeed in planning the value of the font and color in
> > >> > the LabelFrames using the option_db file, such as
> > >> >
> > >> > *LabelFrame*font: Helvetica 14
> > >> > *LabelFrame*foreground: red
> > >> >
> > >> > exist a list of the keywordses to use?
> > >> >
> > >> >>> import tkinter as tk
> > >> >>> root = tk.Tk()
> > >> >>> lf = tk.LabelFrame(root)
> > >> >>> lf["class"]
> > >>
> > >> 'Labelframe'
> > >>
> > >> Do you spot the difference? The class of the LabelFrame widget is
> > >> Labelframe with a lowercase f. Once you change your database
> > >> entries to
> > >>
> > >> *Labelframe*font: Helvetica 14
> > >> *Labelframe*foreground: red
> > >>
> > >> everything should work as expected.
> > >
> > > perfect, it works too much well, even my buttons now are helvetica
> > > 14 and red  ;(
> >
> > I does what you tell it to do. Remove the second wildcard if you
> > only want to change the Labelframe style:
> >
> > *Labelframe.font: Helvetica 14
> > *Labelframe.foreground: red
>
> Does that mean buttons  inerith text from labelframe?!?! it looks so.

They do if you do not specify differently within the 
<button>
....content
</button>
Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>



More information about the Python-list mailing list