Version 0 of Shimmering in Tk

Updated 2022-11-17 04:33:37 by aplsimple

Tk has its own shimmering. It is when you have widgets with dark backrounds and try to switch between the widgets' shows.

For example, in TKE editor when you set a dark theme and try to switch between tabs of the tab bar, you see a short flash of light background before showing a text, as a rule (but not as a strict rule) seen at the first presentation of the text.

But even when you have ttk::frame styled so that it has a dark background, you can see (though mild, yet seen) shimmering. Example of this is presented by alited editor's versions before 1.3.5 (when black themed too): in its "Preferences" when you switched between tabs, you could see shimmering of two dark backgrounds. It's related to the fact that alited uses two main backgrounds: one for the base, one for the fields like entry, text etc. And you can style ttk::frame to have only one of them.

In complex layouts, overcoming this annoyance can become a tricky task, because the problem can reveal itself in most unusual places.

Perhaps, Tk would behave better if it had a couple of commands like freezeGUI / unfreezeGUI, so that you might to do all you need with GUI between those commands without the changes seen.

Still, I'd like to share my tiny experience about this "fight with shimmering".

1. You might smile but label and ttk::label both can be used as containers instead of frame and ttk::frame, though not replacing them in other aspects. At that, in my opinion, label is a more flexible type as it allows to configure a specific widget without touching others.

2. Also, frame can be used instead of ttk::frame for the same reason: it allows to configure a specific widget without touching others.