LoginSignup
3
1

More than 5 years have passed since last update.

[Python + tkinter] ttk.LabelFrame のスタイル変更

Last updated at Posted at 2018-08-02

英語サイトにも困っている人が多かったので、拙い英語で書いておこう。
TLabelframeの"f"は小文字。
Character "f" in [ style.configure("TLabelframe",... ] must be lower case.
"TLabelFrame" does not work.

本題。ttk.LabelFrame のスタイル変更でハマってました。

style = ttk.Style()
style.configure('Test.TLabelFrame.Label', font=('', 16,''))
lframe1 = ttk.LabelFrame(root,text="LabelFrame1", style='Test.TLabelFrame')

としていましたが、なぜか反映されず。どうやら

NG:style.configure('Test.TLabelFrame.Label', ...
OK:style.configure('Test.TLabelframe.Label', ...

のように、TLabelframeの"f"は小文字なんですね。

割とよく参照するサイト によると、fは大文字で書かれているのですが、これは誤字かも。
バージョンに依るのかな!?

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1