Pysimplegui: Any tkinter experts in the house?

Created on 16 Oct 2018  路  3Comments  路  Source: PySimpleGUI/PySimpleGUI

I made a failed attempt today at background images for columns.

The idea was to take a "Container Element" and enable an image to be the background. Then other elements can be placed inside the Column.

I got VERY close. I actually had it working using Labels only to discover that drawing text over the label resulted in no alpha-blend with the text. There was a gray-box around the text.

The only way to put text over the image is to use a Canvas widget instead of a Label. Then you can use the Canvas draw-text call.

Unfortunately I was unable to get the image to fill the entire canvas. I tried everything I could think of to get the image to expand to it's full size.

So, sorry, this feature is still in the works.

There are a number of these features that I attempt behind the scenes that end up going nowhere. I'll keep trying, but if I had a tkinter expert here it sure would go smoother.

For the record, I am NOT a tkinter expert. I suck at tkinter... it's why I wrote PySimpleGUI, so I would not have to mess with tkinter :-)

help wanted

Most helpful comment

I came from a world of C... moving to Python felt like going from black and white TV to colored TV. I can't describe in words the feeling of freedom I have. I also get into compacting code using list comprehension, etc. Coding becomes a bit like solving a Sudoku puzzle. I'll write a bit of code and then step back, knowing there is a shorter way to do it, and then rewrite the 5 or 6 lines of code I'm examining. I don't always do that, but when I do it's a great feeling.

Just like Python code is much more compact than C code, my goal with PSG was to create compact GUI code. The language and PSG attempt to compliment each other.

All 3 comments

i certainly understand :) good luck...

and no, i'm no expert by far in any of this. i'm new to python3, pyglet and gui stuff in general, but i have a pretty good background in programming from years ago. i just need to adapt things to python instead of C. i have a long ways to go yet...

I came from a world of C... moving to Python felt like going from black and white TV to colored TV. I can't describe in words the feeling of freedom I have. I also get into compacting code using list comprehension, etc. Coding becomes a bit like solving a Sudoku puzzle. I'll write a bit of code and then step back, knowing there is a shorter way to do it, and then rewrite the 5 or 6 lines of code I'm examining. I don't always do that, but when I do it's a great feeling.

Just like Python code is much more compact than C code, my goal with PSG was to create compact GUI code. The language and PSG attempt to compliment each other.

@MikeTheWatchGuy

I'm no tkinter expert either, but from my experience of fiddling with it, the best resources are among:

  1. The tkinter mailinglist: https://mail.python.org/mailman/listinfo/tkinter-discuss
  2. The Tcl/Tk community: https://www.tcl.tk
  3. Well, you all know that: StackOverflow, following the above communities.

Time after time I got referred to #1 and #2 and got real experts there. A lot of "faults" of tkinter directly come from Tcl/TK or its particular versions.

Right now it "tickles" me that some of the look-and-feel of PySimpleGUI, e.g. changelookandfeel call, is broken on Mac but I think we still have a shot to improve on the microscopic level. If the ttk theming could work, it'd be fantastic!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mozesa picture mozesa  路  4Comments

MikeTheWatchGuy picture MikeTheWatchGuy  路  6Comments

xuguojun168 picture xuguojun168  路  3Comments

LBdN picture LBdN  路  6Comments

mozesa picture mozesa  路  5Comments