Python tkinter note 30oct2025.

I’m not really doing any programming these days, and I haven’t made a real effort in years. But if I do, I’ll probably fall back on python and tkinter for anything involving input.

Tonight, 29-30oct2025, I’ve been pondering how to make nice jelly-bean-like buttons in standard tkinter, i.e. without the everpresent ttk theme set. I don’t like what ttk takes away from me, and I’m not a conformist, so I don’t care about what’s trendy, or that my widget form doesn’t look like the native UI.

One thing I did years ago on a half-finished data-entry widget was to raise a large, glaring orange border of absurd thickness around the currently active input field. The border was, iirc, about 5mm-wide.

So why such a large-glaring border? Because when you’ve been detailing or estimating for 16 or 20 hours – I was a rebar detailer/estimator – I wanted to be able to look away, have a brief conversation or some other distraction, and then upon turning back to my data-entry widget, to be able to instantly discern (with my weary eyes) where I needed to continue. Subtle highlights, which are favored by most designers, are exactly what I don’t want – it’s just too fussy to determine where I was before I got distracted. The difference is small, perhaps a half-a-second or so, but when you’re tired and it occurs dozens of times or more per hour, it’s frustrating and fatiguing. The ttk widget set didn’t allow me to create such a border, because of course its focus is beauty via conformity.

So anyway, back to the jelly-bean like buttons. I think one approach may be to use a typical flat button, set everything to the color of the surrounding background, eliminate any borders, to the extent that I can, and situate a jelly bean image in the center of the flat button. There are plenty of howtos on the intertubes about how to put an image on a button.

You might be wondering why I would use a limited UI toolkit like Tk or tkinter. I use tkinter because it’s good enough for what I need. If I need a spreadsheet, I’ll use a spreadsheet, but if I need simple data input, validation, and processed output which is usually what I need, I’ll use good ol’ dead-simple tkinter. I don’t much care that its text widget doesn’t offer smooth scrolling but rather jumps a couple of lines at a time. The horror! It’s good enough, and it (the underlying Tk toolkit) works on most OSes. It’s available from most languages I’ve ever considered learning. And one more thing, not everything needs to be on, or connect to the intertubes.

I really don’t know that I’ll ever do any more programming. Old age and declining energy levels have gotten a hold of my brain. I can still learn hard things, but more and more, I find myself asking, “Why?” in a tired voice. I’ve only ever been the rankest of amateurs, but even at that level, knowing a bit of programming has been useful and fun.

End.