Hello
I currently migrate a GUI from tkinter to ttk and I found a problem
Here is a piece of code, with comments which explain what is
wrong.
import tkinter as tk
import tkinter.ttk as ttk
root = tk.Tk()
BITMAP0 = """
#define zero_width 24
#define zero_height 32
static char zero_bits[] = {
0x00,0x00,0x00, 0x00,0x00,0x00, 0xf0,0x3c,0x0f, 0xf0,0x3c,0x0f,
0xf0,0x3c,0x0f, 0xf0,0x3c,0x0f, 0x00,0x00,0x00, 0x00,0x00,0x00,
0xf0,0x00,0x0f, 0xf0,0x00,0x0f, 0xf0,0x00,0x0f, 0xf0,0x00,0x0f,
0x00,0x00,0x00, 0x00,0x00,0x00, 0xf0,0x00,0x0f, 0xf0,0x00,0x0f,
0xf0,0x00,0x0f, 0xf0,0x00,0x0f, 0x00,0x00,0x00, 0x00,0x00,0x00,
0xf0,0x00,0x0f, 0xf0,0x00,0x0f, 0xf0,0x00,0x0f, 0xf0,0x00,0x0f,
0x00,0x00,0x00, 0x00,0x00,0x00, 0xf0,0x3c,0x0f, 0xf0,0x3c,0x0f,
0xf0,0x3c,0x0f, 0xf0,0x3c,0x0f, 0x00,0x00,0x00, 0x00,0x00,0x00
};
"""
img = tk.BitmapImage(data=BITMAP0, foreground='white', background='black')
# This Label comes from ttk
label = ttk.Label(root, image=img)
# This Label comes from tk. To be uncommented to test behavior'difference
# label = tk.Label(root, image=img)
label.pack()
# The graphic is not refreshed after entering following commands
# when Label comes from ttk. You have to fly over the label with
# the mouse to get the right color.
# The graphic is immediately updated when Label comes from tk
# Enter these commands by hand, in a shell
img.config(foreground='red')
img.config(foreground='lime')
img.config(foreground='yellow')
It looks like a ttk bug, isn't it ?
I am using python 3.5.1
I tried a root.update_idletasks() to refresh the graphic
but it changed nothings.
--
https://mail.python.org/mailman/listinfo/python-list