Giter Site home page Giter Site logo

Comments (82)

definite-d avatar definite-d commented on August 27, 2024 4

Drum roll please...

🎆 🎆 🥁
LookyFeely v2 is complete!
(but still undergoing testing, so it'll be out by Christmas 🎁 🎅).

For the speedsters (like you),...

For me, that was the name of the game... speed. It's why I downloaded all those pre-made palettes. They gave me a quick way to get matching colors, bypassing the need to manually dial-in colors. It meant losing a lot of the controls that you're providing. I presented myself with a much limited set of choices.

...all that's needed to make a theme is a name for the theme, 2 (minimum, I'm sorry; I'll probably have this reduced to 1 click based on saved settings) to 6 button clicks and a bit of copy pasting. The result?
A theme with nice color arrangement (could be a mono theme or randomized; your call), with dark and light extra themes, all auto generated in seconds. And, you don't even have to click "Choose Color"! Not once! If you do click it, you don't have to click it 7 more times as provided for. That one color will be used to create a theme in its entirety. Plus, I've added the ability to update PySimpleGUI from LookyFeely, display all built in PySimpleGUI themes and all 150 supported semantic color names, from black to seashell and more.

More features are welcome; I'm thinking of a new addition to the Dark/Light Mode generation part: Gray-Out. This could take the Neutral theme color formula and convert every color there to grayscale. At least, if the user must use gray windows, they should do it in style.

Side note:
I've learnt how to use emoji in GitHub comments. Mark that, M⬇️.

from themera.

definite-d avatar definite-d commented on August 27, 2024 2

Sorry about the days-old reply here. I read and re-read that review of LookyFeely, and it feels great for the creator of PySimpleGUI to provide feedback.

As for this part,

How about putting a slider next to each color that will traverse a list of colors and update a patch next to the line as you slide the slider. This will enable the user to quickly enter information.

I'm not sure how I can accomplish that, but I'll try and keep you posted.

Take another try at it as a version 2. Do out of the box stuff. Consider using some color formulas you find online to automatically make other colors based on the user entering an initial color or two.

This should be very possible to accomplish, but won't that put ThemeMaker our of business ;).
Anyway, I'm guessing this could work:

  • I make a window that appears when a color value isn't chosen.

  • That window will contain a notifier that a color wasn't chosen, three tickboxes/radios with the options...

    • Randomize colors not given.
    • Auto-fill colors based on gradients of those given (good for mono-color themes).
    • Duplicate colors given.
  • ...and put 'Continue' and 'Cancel' buttons at the bottom (tongue twister there).

I also just got this idea:
Two tickboxes could be added to the bottom of the main window that when ticked, will add code for an auto-generated dark or light mode.

Well, I guess this project isn't open source for nothing. I look forward to more ideas.

Development of LookyFeely just got a whole lot more exciting.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024 2

I liked the changes you made and have been playing with the new shuffle feature. It's working well!

I'm interested in what you're describing with the windows. I've been experimenting a great deal with multiple window positioning. It's what enabled me to create what appears to be a window with a background image, something not easily accomplished with tkinter alone.

This is the result of "locking" two windows together. The problem I faced however is that it only works correctly when I use "grab anywhere". I've not got it working when moving using the titlebar.

Move Locked Windows

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024 1

I'll probably close this issue now (as issue #1 already has some screenshots I could use), but I thought I'd ask you first; what do you think of LookyFeely? Not trying to rush you into trying it out (managing PySimpleGUI with hundreds of users "throwing" issue logs at you must be very time consuming, and your life likely doesn't revolve around lines of code alone), but If you have tried it out, please let me know how it feels to use.

I spent some time making themes with your program. It's awesome to see you want more colors! It's a good thing to see as most seem to pass this over way too often. It's why I added the "nag print" to the code recently for gray windows.

It's difficult to get the flow right for user interfaces. Your theme maker does a good job of creating the code, packaging up the colors so they can be used by users. It's the color choosing part that's slow. Because you have no control over the "Color Chooser Dialog" that tkinter makes, it ends up in awkward positions. For me, on a huge monitor, it meant mousing a foot and a half over every time I went to choose a color.

One way around this is to use your own color chooser. I recently released a simple one as a Demo Program. It's not all that bad actually. You might want to consider swapping it in and seeing how it feels.

The user interfaces that are good are created through an iterative process, even more-so than coding being iterative. For me I have to try a lot of stuff that doesn't work to get to the one that does.

You've got an interesting opportunity to make a unique user interface for making themes. Consider doing something out of the box. How about putting a slider next to each color that will traverse a list of colors and update a patch next to the line as you slide the slider. This will enable the user to quickly enter information.

For me, that was the name of the game... speed. It's why I downloaded all those pre-made palettes. They gave me a quick way to get matching colors, bypassing the need to manually dial-in colors. It meant losing a lot of the controls that you're providing. I presented myself with a much limited set of choices.

Here's what I see now when I'm making themes.... combinations of stuff based on 4 colors...

image

I can make some tweaks, but not many.

I like that you're building something.... anything.... that's the point in all this. I've written and re-written and re-written many programs over the decades. It's by doing that you improve.

Take another try at it as a version 2. Do out of the box stuff. Consider using some color formulas you find online to automatically make other colors based on the user entering an initial color or two.

The way I made my light and dark themes was that I searched and found a function that will sort colors by brightness. Then I was able to sort my 4 colors from dark to light. I didn't know and don't know how that function works, I just knew I wanted something that would sort colors by brightness.

Mix stuff up. Try completely new things for Version 2. Look at PySimpleGUI, it's on version 4. The code made today using it looks NOTHING like the code for versions 1 and 2. None of the names are the same. There was no "Window" object until version 3 I think.

You've got plenty here to feel good about accomplishing. You did the whole project, beginning to end, AND learned how to share it with the world. You're on your way :-)

Oh, and my markdown REALLY sucks.

from themera.

definite-d avatar definite-d commented on August 27, 2024 1

Hello again, @PySimpleGUI .

Well, now that ImagePalette is officially a thing and ready for use, I've decided to rewrite the Mono system (the thing that enables the user to base unspecified colors off those specified). It's a mess, from the developer perspective and the user perspective.

I'll keep you posted.

from themera.

definite-d avatar definite-d commented on August 27, 2024 1

The mono update is done, and I've even added a few things;

  • Before, using ImagePalette would mean forfeiting whatever colors had been put in before. That's been corrected.

  • You can now copy all theme code with a single button click, thanks to Pyperclip.

  • I revamped the "Fill in Random Colors" system as well. Now, unless Haphazard Random is ticked in Other Options, the random option will try its best to create a usable theme; not just a mash of incoherent colors.

from themera.

definite-d avatar definite-d commented on August 27, 2024 1

Happy New Year, and welcome to Themera!

I decided to rename this project to Themera, because... well... "LookyFeely" sounds a bit weird, and I just realized that 😆 .

So, going forward, LookyFeely will be distributed under the name of Themera, and the upcoming 2.7 release will be Themera v1.0. It's also coming with 2 out of the 3 features currently in the roadmap, as well as slight optimizations and a fix for the ImagePalette bug.

from themera.

definite-d avatar definite-d commented on August 27, 2024 1

Well, I've got everything set about Themera, but GitHub is being a nightmare to use. I may end up deleting this repository, but I'm trying not to, as that will (probably) kick out everyone who has starred/watched this project so far.

I tried using Filestash, but that got busted after a while. Not sure how, but I think I broke it; GitHub and Filestash stopped showing the same content.

I'm trying out Sourcetree now though.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Thanks a lot for the tip! I'll do that.

from themera.

definite-d avatar definite-d commented on August 27, 2024

I'll probably close this issue now (as issue #1 already has some screenshots I could use), but I thought I'd ask you first; what do you think of LookyFeely? Not trying to rush you into trying it out (managing PySimpleGUI with hundreds of users "throwing" issue logs at you must be very time consuming, and your life likely doesn't revolve around lines of code alone), but If you have tried it out, please let me know how it feels to use.

--Side Note------------------------------->>
With the latest commit to the main script, I added two lines of code that would have been the solution to an Issue I thought of opening on PySimpleGUI. The title would have been, "[ Enhancement/Bug ] Default LookAndFeel Themes' Loader Bar Colors Need to be Unique to Each Theme,". The two lines of code simply change the sg.LOOK_AND_FEEL_TABLE[random_theme]['PROGRESS'] parameter to equal a tuple of the Text and Input colors:

if sg.LOOK_AND_FEEL_TABLE[random_theme]['PROGRESS'] == sg.DEFAULT_PROGRESS_BAR_COLOR: sg.LOOK_AND_FEEL_TABLE[random_theme]['PROGRESS'] = (sg.LOOK_AND_FEEL_TABLE[random_theme]['TEXT'], sg.LOOK_AND_FEEL_TABLE[random_theme]['INPUT'])

from themera.

definite-d avatar definite-d commented on August 27, 2024

My Markdown skills suck.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Sorry, I had to change the name of the issue. Should a new issue be opened?

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

It's your repo to manage so I wouldn't worry about renaming items to better fit how you see them. No need to get caught up in process at this point.

I tossed out a few ideas. You don't need to make too much of them as they're just opinions. What do I know, I'm making this stuff as I go along. I've never written a GUI program in my life so it's all new for me just like this is new for you.

Feel free to put out of business anything I or anyone else has written. You're welcome to take and use the color definition file that Israel gave to me where I got the 1,700 palettes. Take the algorithms I found too if they're helpful. It's all meant to be built upon. Historically that's how everything in computers has been done. It all builds or gets replaced or wrapped or .... Rarely do things stick around for decades unchanged.

The reason I bought up sliders is that I've not tried it and I've not seen anyone else try it. It was just an idea that popped into my head of "something different". I have lots of ideas.... I've learned over the years that many of them are not good, so take it as just an idea and nothing more.

I'm urging you to use the Elements, all of them, to solve a problem. Maybe a Combo box would be helpful for something. Or checkboxes as you mentioned. I used radio buttons to choose a few options. The point in this is that there is a selection of GUI Elements for us to choose from and assemble in ways not done before..... or maybe they have.

I get ideas, and code, from other people too. I ask for ideas from people often as well. It's not like I've got a secret formula for what I'm doing. I read a lot of code and am thus taught how to use PySimpleGUI by the users. One user has been on fire recently, cranking out games that are crazy good. When I saw and played them I didn't believe they were written with PySimpleGUI.

You'll find a link to his Minesweeper and the code itself to a new solitaire game as part of this issue:
PySimpleGUI/PySimpleGUI#2356

The solitaire game is crazy as there are dealing animations and other stuff I wouldn't think possible. But yet, here is a guy with English as a second language that is greatly out-coding anything I've made. He's teaching me techniques and concepts I hadn't thought of. He also extended the PySimpleGUI library and caused me to create the new bind capability, enabling everyone to get more tkinter events to be returned through the window.read() call. It's another example of how a user's code influenced the development path of PySimpleGUI.

What I was trying to say before is that the key to programming is to write code and read code. And to do as much of that as you can. It's a craft, just like watch repair is a craft. Or playing a musical instrument. The way you improve in crafts is by practice. It really is a matter of time and how much over the long term time is invested. Through iteration things improve, new ideas get added or discovered.

You're doing great! I'm glad you're feeling excited about the project. It's passion that drives projects like PySimpleGUI. Otherwise we're all just turning the crank, being a cog in a some computing machine.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Thanks for the advice!
I'm probably going to follow that @jason990420 guy; he's challenging my view of how most games are made (in a game engine like Godot), and I love it (both Godot and his challenge of my philosophy. You can check out Godot here: https://godotengine.org/).
Turns out, this...:

I'm not sure how I can accomplish that,
but I'll try and keep you posted.
...is actually going to be this...:
I can do that for sure.

...thanks to this module:
https://pypi.org/project/colour/

So, don't toss all those creative ideas out the window ;).

I've already begun coding additional features discussed above. If the UI gets messy (and it might), I'll use Tabs to sort things out!

By the way, I tried out the Tab element in one of my projects (you'll likely hear about it soon ;) !) other than LookyFeely, and (please correct me if I'm wrong) I noted that the default colors were not dependent on the current LookAndFeel picked. I had to apply the same logic from modding the Progress Bar colors. I totally get the want for a green progress bar everywhere (Windows users, lemme hear ya scream!), but for tabs, how about adding LookAndFeel table entries for its colors or basing it off other colors by default as I did? That would really make Tabs flow with the LookAndFeel vibe.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I have modified the code so that both the tabs and the progress bars use the look and feel settings.

4.9.0 added color for tabs

4.10.0 added color for progress bars

Now pretty much everything is being colored using the Look and Feel settings.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

For color processing, I looked at several packages, but ended up instead going out and finding the code for the specific tasks I wanted to do.

These are the color functions I ended up using in the Theme Maker code.

The most important of them is the rgb_to_hsl which enabled me to sort the colors by brightness. It's how I was able to generate "Dark" and "Light" themes with confidence as I knew when I was working with a dark color and when with a light.

def rgb_to_hsl(r, g, b):
    r = float(r)
    g = float(g)
    b = float(b)
    high = max(r, g, b)
    low = min(r, g, b)
    h, s, v = ((high + low) / 2,)*3
    if high == low:
        h = s = 0.0
    else:
        d = high - low
        l = (high + low) / 2
        s = d / (2 - high - low) if l > 0.5 else d / (high + low)
        h = {
            r: (g - b) / d + (6 if g < b else 0),
            g: (b - r) / d + 2,
            b: (r - g) / d + 4,
        }[high]
        h /= 6
    return h, s, v

def hex_to_rgb(hex):
    hex = hex.lstrip('#')
    hlen = len(hex)
    return tuple(int(hex[i:i + hlen // 3], 16) for i in range(0, hlen, hlen // 3))


def sorted_tuple(tup, position):
    tup.sort(key=lambda x: x[position])
    return tup

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

By the way, I tried out the Tab element in one of my projects (you'll likely hear about it soon ;) !) other than LookyFeely, and (please correct me if I'm wrong) I noted that the default colors were not dependent on the current LookAndFeel picked.

Make sure to pick up the latest release. They've been coming out fast recently. I always post in the Announcement Issue when one gets posted to PyPI.

Because I wanted to get some of these features out quickly, I went ahead and pushed them out the door and up to PyPI.

In the past week there have been 4 releases.

4.8.0 PySimpleGUI 4-Dec-2019

Multicolored multiline text! Often asked for feature going way back
ttk Buttons can have images
Print in color!

  • Multiline Element got 2 new parameters to the update method
    • text_color_for_value - color for the newly added text
    • background_color_for_value - background color of the newly added text
  • New Print/EasyPrint parameters and capability
    • text_color, background_color - control the text's color and background color when printing to "Debug Window"
    • Must be done only when used in mode where stdout is not re-routed (the default)
    • Wouldn't it be really nice if normal print calls had this parameter?
    • Print(event, text_color='green', background_color='white', end='')
  • ttk Buttons
    • can have images. No longer forces Buttons with images to be the old tk Butons. Now you can choose either
    • can update the button color
    • can update the button image
  • Set warning filter so that warnings are repeated
  • New global variables:
    • CURRENT_LOOK_AND_FEEL - The current look and feel setting in use. Starts out as "Default"
    • BROWSE_FILES_DELIMITER - Defaults to ";" It is the string placed between entries returned from a FilesBrowse button
    • TRANSPARENT_BUTTON - Depricated - was being used incorrectly as it was a relic from the early days. It's value was a color of gray
  • Window - gentle reminder if you don't choose a look and feel for your window. It's easy to stop them. Add a change_look_and_feel line
  • Test harness uses a debug window so don't be shocked when 2 windows appear when running PySimpleGUI by itself
    • Prints the "Event" in Green on White text
    • Prints the "values" normally

4.9.0 PySimpleGUI 7-Dec-2019

The "Finally Nailed Tabs" release

  • Colors for Tabs!
    • When creating TabGroup can now specify
    • Text & Background color of all tabs
    • Text & Background color of selected tab
    • If nothing is specified then the Look and Feel theme will be used (which turned out GREAT)
  • Tab visibility - Can finally control individual tab's visibility using update and when creating
  • More "Look and Feel" Themes! There's no excuse to be grey again. There are now 126 themes to choose from. Here are the 32 new themes"
    DefaultNoMoreNagging
    DarkBlack1
    DarkBlue12
    DarkBlue13
    DarkBlue14
    DarkBlue15
    DarkBlue16
    DarkBlue17
    DarkBrown5
    DarkBrown6
    DarkGreen2
    DarkGreen3
    DarkGreen4
    DarkGreen5
    DarkGreen6
    DarkGrey4
    DarkGrey5
    DarkGrey6
    DarkGrey7
    DarkPurple6
    DarkRed2
    DarkTeal10
    DarkTeal11
    DarkTeal12
    DarkTeal9
    LightBlue6
    LightBlue7
    LightBrown12
    LightBrown13
    LightGray1
    LightGreen10
    LightGreen9
    LightGrey6
  • preview_all_look_and_feel_themes now has a columns parameter to control number of entries per rows
    • also made each theme display smaller due to large number of themes

4.10.0 PySimpleGUI 9-Dec-2019

"Oh crap the debugger is broken!" + "Pretty Progress Bars" release

  • Fix for built-in debugger not working
    • Important due to upcoming educational usage
    • Has been broken since 4.5.0 when a change to Finalize was made
  • ProgessBar element colors set using Look and Feel colors
    • Combination of button color, input element, and input element text are used

4.11.0 PySimpleGUI 10-Dec-2019

The Element & Window bindings release

  • Element.bind - New method of all Elements
    • Enables tkinter bindings to be added to any element
    • Will get an event returned from window.read() if the tkinter event happens
  • Window.bind - New method for Windows, just like Elements
    • Enables tkinter bindings to be added to Windows
    • Will get an event returned from window.read() if the tkinter event happens
  • TabGroup fonts - can now set the font and font size for Tab text

from themera.

definite-d avatar definite-d commented on August 27, 2024

That is super cool. I'll update today. Thanks for adding the Tab color LookAndFeel spec. And the CURRENT_LOOK_AND_FEEL value is a lifesaver too. Now I don't have to explicitly specify the theme in a variable before passing it to the ChangeLookAndFeel function to allow for referencing the name of the theme. Fantastic update overall. Fantastic.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Updated. Still on the job, but I may release the new v2.0.0 by next week. I'm currently trying out different ways to accomplish the general tasks in Python. That means a lot of testing and re-coding.

And in case you noticed it, FastB64 isn't the project I was referring to earlier. It's just a project I made in the hope that having the icon embedded into the script would be less stressful.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Thanks for the functions for color manipulation. I'm going to add them now. I've integrated tabs into the design to avoid having a window that stretches longer than a hermit's shopping list, and also to allow for more options and space to implement GUI ideas.

To compact things further, is there an element that provides a sort of scrollable container function for other elements?

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Column is one of the "Container" elements that holds other elements so that you can scroll them. It's well documented and used extensively in the demo programs.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Will do. I used to think columns were only for cool alignment effects. Thanks for the tip.

Another thing; have you got any idea how I can use Base64 encoded images with either SetOptions() or SetGlobalIcon()? I tried it with the icon parameter of a window and it worked as expected, but the other two don't work.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Not just for aligning. They are an all-purpose containing. The parameters specific address use of scrollbars. At one time it was how tables were scrolled.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello again, @PySimpleGUI.
During development, I thought of something, and decided I'd ask you about it.
It's a bit off topic (it's about licensing), but it's important to me (and I probably should've put it in an issue on the PySimpleGUI repository).

I know PSG-LookyFeely operates (and will always operate) under the same license as PySimpleGUI, but PySimpleGUI is the only GUI framework in Python I currently use, and I'm afraid not all projects I develop can be open source or under the LGPL (so I can't just slap on an LGPL and not care so much about violating PySimpleGUI's LGPL requirements because we run under the exact same terms).

In the process of putting up my latest project (FastB64, still developed with PySimpleGUI, under LGPL3), I had to pick and review a license for it, and went with the LGPL3. Ironically, that was my first time of reading the very license that I'd picked a few times. In it, I saw a few things I could understand, like the definition of 'Combined Work', and enabling the end-user to swap out the 'Linked Library' with a version of their choice. Now, here's the puzzling scenario:

  • I make my app in PyCharm as expected, like LookyFeely here.
  • I use PyInstaller to package the .py script for the app into a folder as usual (the only thing added by hand using --add-data is the icon file).
  • I snoop around the generated folder, but I only see stuff about Tkinter, Tcl, some weird looking Python stuff in a 'base_library' zip file, my .exe, some Python extensions, and a lot of .dlls (I'm on Windows).

There seems to be no way to swap out PySimpleGUI with a version that the user wants, because it appears PySimpleGUI doesn't exist within that app bundle. Is that [app bundle] still legal? Am I allowed to sell such an app? Can I license it however I please?

(Note: the term 'app' used here denotes the generic abbreviation for 'application', not a Mac bundle. I'm sure you already knew that anyway. The app in question is the FastB64 project)

Thanks.

Edit: I'm putting up everything about the FastB64 (including the PyInstaller build and dist folders.)

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I can't help you with legal / licensing questions except to refer you to the license file.

If you have applications that this license won't apply to, then other licensing arrangements may be possible. But there will need to be a new commercial license drawn up for you.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello again, @PySimpleGUI!
Today, I battled with accomplishing the Mono option that's made available when a color isn't selected. Still on it, but its coming along fine. I almost forgot about the 'slider' idea, but I found no suitable place to integrate it. So I thought, how about having a tab under the Specifier tab (where the color pickers and stuff are now), and call it 'Quick Mode', while the previous contents of the Specifier tab would go under a tab called 'Detailed Mode'. It's likely that I'll still have to use the colored module for the slider values, though. I intend to use the colored module's ability to take in two color values and spit out a range of colors in transition between them.

To spice things up a bit, is it possible to have an image/normal icon/base64 icon beside the name of a tab? Something like the Python logo beside the name of any Python script open in PyCharm for example (if you use PyCharm). It's okay if the answer is no; I just thought of a workaround: the emoji module. Besides, it's just a miscellaneous addition.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

The slider idea was to have a slider available as a way to choose colors. I envisioned any place that you can enter #RRGGBB manually, you can do it with one or three sliders. If a single slider, then it could be located right next to the input element. If multiple then maybe use a popup. I thought it would be a quick and easy way to "dial in" a color instead of manually typing it. If a single slider it would go from 000000 to FFFFFFF. If 3 sliders then each would be 0 to FF. I dunno if it's a good idea or not. I was simply trying to find alternative ways for users to specify information in a way other than the keyboard.

Icons on stuff in general

You're welcomed to open an enhancement to add an icon to a tab. That's more likely to happen on PySimpleGUIQt would be my guess. I don't know if it's possible in tkinter. If it is possible, then you may be able to extend PySimpleGUI yourself and add the code in your user code.

Other places people have asked for icons are in the right click menu for System Tray icons, the menu in button and menu-bar menus.

Tree elements already support icons. Buttons do as well.

You've already come up with one good idea which is to use UNICODE characters in the string itself. This will be the way to achieve it immediately.

Another approach is to not use tabs at all but instead use buttons and simulate your own tabs. It's quite an advanced kind of feature to do, but I've seen it done. You would create a bunch of Column Elements that you hide and then you make them appear when a corresponding button is clicked.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Whoa, quick reply. I guess I hit the timing just right. We're probably in different timezones.

Anyway,
...bingo!!!! I literally just had this idea while typing. What if, the sliders for color selection (as you've aptly suggested) were to act as the color picker window? Simply throw in a text-input controlled by the sliders and a button for confirmation. And I could try to make the button color update itself to be the same as the color in the text box (via the timeout parameter of the window.

But... if it doesn't work as expected, I might have to stick with the 'Demo Program' color picker.

I meant to also say: The Unicode thing could suffice for this project, but if you give the go-ahead, I could experiment with creating a new tab compund element. It could be called 'Combo Tab'.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I mentioned the tab as a button because I saw it done. It was in one of the most complex PySimpleGUI programs I've ever seen. This project: https://github.com/mrmin123/kcauto

The GUI is in 20+ files
https://github.com/mrmin123/kcauto/tree/390-2019-fall-event/kcauto/gui

And it's not easy code to read either. TONS of it. It took me a while to get it to run but I eventually did. I think you'll find they made compound elements in a number of places.

I wouldn't think of this kind of tabs using buttons implementation as a compound element. It's an entire subsystem of it's own. You have to manage multiple rows of buttons that display and hide multiple columns under it. If you try it, make sure the columns are all on the same row.

I dunno, maybe it can be a compound element of sorts. Normally compound elements you can place directly into your layouts. This is a different beast. It's makes buttons that are several rows away from a series of columns that each have layouts. Your function would need to return an entire layout that the user would then add into their layout. It's all possible to do in a semi-portable way so that it'll work on Qt and tkinter. Hard to tell how different they will look.

If you want an icon next to text on a button, you'll need some special code to do that too. I would recommend simply making custom button graphics rather than go through the trouble of overriding PySimpleGUI's text placement on a button and figuring out how to put an image on a button with the text.

Just about anything's possible with enough work. The recent games are a testament to that as well as the above project. Neither programmer ever contacted me. I found their work after it was completed. They never asked a single question. They simply dug in and learned PySimpleGUI inside and out. Ran a TON of experiments, learned tkinter so that they could extend it, etc. It no doubt took them time.

I think you're getting the idea now on the use of slider(s) for color selection. Yes, replacing the color selector with a slider either built into the main window or popups up above the main window. A few programs have been written recently that use a custom popup window to take in some kind of input and put the input into the main window. The most recent was a PIN entry thing that's detailed in an Issue.

Anyway, keep digging... you're doing great stuff.

from themera.

definite-d avatar definite-d commented on August 27, 2024

That's a lot; >20 files for a GUI. Not to mention really complex. If not given enough time, I'd probably make some dumb errors (like forgetting to close an element's function call with ')' ).

I was honestly thinking of having 2 rows: one for the tab-button-headers and another for Column elements of corresponding number, then allowing the user pick which tab should be displayed first (or probably ine that myself) and taking in layout lists for the Columns. Didn't think it would entail such. Oh well, it was just a thought.

I've got a small observation about popups: It seems there's no way to set the element justification for their elements. I understand that that feature is available only on the Tkinter port, but that's what I'm using for LookyFeely. And it seems to me that popups are little prebuilt windows.
That's one reason why I refrained from using so many popups in FastB64. In one project, I even defined my own popups based on the Window element, just for that reason.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

It's too extreme for me. I didn't enjoy reading through their stuff. I got quickly lost. I like SIMPLE stuff, obviously.

By the way, some people are building the ability to change color scheme into their code. This new one, PyIDM is using them and saving the user's choice in the system settings. He's new to Python too evidently, but made quite a complex thing.

Popups are indeed little prebuilt windows. I call Window just like everyone else. Use Elements to make a layout. It's just a bunch of functions meant to make repetitive stuff easier and to make things really convenient for beginners. You can get a lot done with Popups.

Glad to hear you're making your own. Custom little windows are cool.

I'll leave you with this interesting little popup window thing. It a program that a guy wrote that I helped him get working right.

It was part of this issue
PySimpleGUI/PySimpleGUI#2259

It's a little popup built-into the main event loop. It would better have been a popup window broken out as a function just to modularize a little.

import PySimpleGUI as sg
from PySimpleGUI import InputCombo, Combo, Multiline, ML, \
    MLine, Checkbox, CB, Check, \
    Button, B, Btn, ButtonMenu, \
    Canvas, Column, Col, Combo, \
    Frame, Graph, Image, InputText, \
    Input, In, Listbox, LBox, Menu, \
    Multiline, ML, MLine, OptionMenu, \
    Output, Pane, ProgressBar, Radio, \
    Slider, Spin, StatusBar, Tab, \
    TabGroup, Table, Text, Txt, T, \
    Tree, TreeData, VerticalSeparator, Window, Sizer

print(sg.version, sg)


sg.change_look_and_feel('GreenTan')

col1 = Column([
    [Frame('Information:', [[Column([[Text('UNO:'), Input(key='-UNO-', size=(16, 1), tooltip='Insert your NO'), \
                                      Button('⌨', key='-KEYBOARD-', tooltip='Activate keyboard')],
                                     [Text('S/N:'), Input(key='-SN-', size=(16, 1), tooltip='Insert serial number of the product')],
                                     ], size=(240, 130), pad=(0, 0))]])],
], pad=(0, 0))

layout = [
    [Text('KBTest', size=(41, 1), key='text', justification='center', font=('Helvetica', 24), relief=sg.RELIEF_RIDGE)],
    [col1],
]

output = Window('Guided Test', layout, size=(400, 240)).Finalize()

keypad_active = False

while True:
    event, values = output.read()
    print(event, values)
    if event is None:
        break

    if not keypad_active and event == '-KEYBOARD-':
        output_elem = output.find_element_with_focus()
        output.hide()
        keypad_active = True

        keypad_layout = [
            [sg.Input('', size=(10, 1), key='input')],
            [sg.Button('1'), sg.Button('2'), sg.Button('3'), sg.Button('4')],
            [sg.Button('5'), sg.Button('6'), sg.Button('7'), sg.Button('8')],
            [sg.Button('9'), sg.Button('0'), sg.Button('⏎', key='Submit'), sg.Button('Clear')],
            [sg.Text('', size=(15, 1), font=('Helvetica', 18),
                     text_color='red', key='out')],
        ]

        keypad = Window('Keypad', keypad_layout,
                        default_button_element_size=(5, 2),
                        auto_size_buttons=False,
                        grab_anywhere=False)

        # Loop forever reading the form's values, updating the Input field
        keys_entered = ''
        while True:
            event, values = keypad.read()  # read the form
            if event is None:  # if the X button clicked, just exit
                break
            if event == 'Clear':  # clear keys if clear button
                keys_entered = ''
            elif event in '1234567890':
                keys_entered = values['input']  # get what's been entered so far
                keys_entered += event  # add the new digit
            elif event == 'Submit':
                keys_entered = values['input']
                output_elem.update(keys_entered)  # output the final string
                break
            # change the form to reflect current key string
            keypad['input'].update(keys_entered)
        keypad.close()
        keypad_active = False
        output.un_hide()

from themera.

definite-d avatar definite-d commented on August 27, 2024

Will do. Will do.
Perhaps I'll open another repo where I can put up all my little enhancement scripts for PySimpleGUI.

This really caught my attention:

By the way, some people are building the ability to change color scheme into their code. This new one, PyIDM is using them and saving the user's choice in the system settings.

I have tried to do this, but I didn't find a way to make the Window color or LookAndFeel theme update in real time, and I got stuck with creating an external .pref file (pref stands for user preferences), which didn't seem too appealing for a portable app. Maybe I was doing something wrong. I'll try again. Now, I didn't really get what you meant by this; does their implementation require a preferences file like mine (perhaps that's what you mean by 'system settings') and a restart of the program to take effect or is it real time? I'm really curious. Pardon my questions, I know you aren't the maintainer of that project.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Um, I've reached the part where I have to integrate the color manipulation module/functions. Your functions were what I picked first to integrate, but I required the ability to convert from HSL color, back to hex. To do that, I had to use the colour module in addition to your functions, but I was surprised when I got an error. I decided to try the module's ability to convert hex to HSL, and found that the results were different.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I have tried to do this, but I didn't find a way to make the Window color or LookAndFeel theme update in real time, and I got stuck with creating an external .pref file (pref stands for user preferences), which didn't seem too appealing for a portable app.

Look at the project I sent you... PyIDM.

You will find his code is not all that long. The way everyone does the look and feel "switch over" is to completely close the old window and open a brand new one. A "restart" of sorts.

His code shows you how to save your settings in a JSON file and read them back. I've never done it and was surprised at how easy he made it look.

I learn a LOT from reading other people's PySimpleGUI code. I highly recommend reading other people's code. You can learn something for sure. Some aren't the best, but they have some hidden gems for me. Others have sequences of code, like saving settings, that can be lifted and used in your own code, just like you're doing with the color libraries from mine.

I have no clue, by the way, about how color systems work. I learn enough stuff to "get the job done" and then I'm off to the next thing. I'm not a deep dive kind of person unless I have to be.

I added the table header code last night. Now when Tables and Trees are created, the colors of the headers can be set. If none are set, I do the same kind of thing like I did for tabs, use the current look and feel table.

I'm going to create some better "access" functions so that programs can find the current background color easily.

But, for now, I need to jump over to the Graph element to fix some stuff and add "object" detection so that things can be dragged around on a Graph.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Pretty cool. I checked out PyIDM, and I think I'll use it personally, aside from learning from its code.

As for the color picker, it's almost done. I'm just experimenting with different layouts for it. I honestly didn't know there was a dummy button as an element, but it came in handy as the color preview box. One more thing; I've built it as a separate entity from LookyFeely; only to be used through an import and a function call. I called it Colorpiq.
It's pretty basic anyway, and it's got only RGB sliders. But, (I think I'm a tab addict) I could put sliders in tabs that function for other color schemes, as long as I can convert the input into the #RRGGBB format. That will probably be v2 for Colorpiq.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I'm in the process of reworking the naming of the "Look and Feel" subsystem within PySimpleGUI.

theme is the new name of the capability. This will greatly simplify user code.

sg.theme('Dark Blue')

and

current_theme = theme()

Are a lot simpler, cleaner, easier to explain than

sg.change_look_and_feel('Dark Blue')

There are a number other functions that I'll be adding to enable access to the theme settings. If a button has an image with an alpha channel, then you need to know the background color the button will be placed on so that it matches. Right now it's a big messy expression. I'm thinking something like theme_background_color() would be the simple way to return the current background color that is being used for all new windows.

It'll take several days to get the names and stuff ironed out and several more to get it rolled out because it has to happen to all 4 ports simultaneously.

This kind of name change has happened throughout the evolution of PySimpleGUI. Old users can continue to user all the old function calls, but new users will only see examples using the new names. It's how the cookbook and demo programs have worked together in the past to evolve the names.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Nice. I admit, PySimpleGUI is the only thing I know of that calls "themes" LookAndFeel schemes. I agree, having it renamed to "theme" will help new users.

Anyway, Colorpiq has been fully integrated into LookyFeely, as its official color picker. I'm still battling the Mono option. If done right, it'll be a far more advanced version of the Quick Mode idea. I'm thinking of doing this:

  • Taking every color specified and making 8 different shades for each.
  • Divide 8 (the total number of color values) by the number of specified colors. (I'll call the result a variable; let's say n in this case.)
  • I'll use n in a loop to pick out n number of shades per specified color, and put them in a list.
  • I'll then sort that list by brightness, narrow it down to 8 values (also with a loop), reshuffle items' positions in the list, and assign each list item to a color value.

Just asking if this would be a good way to deal with Mono.

_(By the way, I already have the following variables at hand:

  • List of all specified colors.
  • A list of indexes/positions of all specified colors in order of choosing (e.g. if text color is the first color chosen, the value of its color in this list would be 0. If Input Color is the same, its position in this list would be different, but the value would be the same; 0.)
  • A loop to generate a list of shades of each specified color)_

from themera.

definite-d avatar definite-d commented on August 27, 2024

Merry Christmas, @MikeTheWatchGuy.
🎆 🎆 🎆 🎆

Well, ho ho ho, LookyFeely v2.0.9 is up (Sorry, the .9 came from additions that sprung up during testing). And I put a .exe of it on the repo as well. It was 'compiled'/'frozen' using PyInstaller.

I haven't tested the .exe, though. Hopefully, it won't call for an issue like that one on the PySimpleGUI repo about a .exe with the Pandas module being so large.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Awesome! I've been waiting for this post.

Merry Christmas @definite-d

from themera.

definite-d avatar definite-d commented on August 27, 2024

Oh crud...

Hope you haven't opened the present 🎁 yet... The last addition to LookyFeely I added before the GitHub upload yesterday, broke the Mono feature, and it didn't even work properly. Apologies, I should have this fixed soon.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Well, I've fixed the major issues. I'm doing some 'mandatory' testing, but I'll be done in no time, and the patch will be up.

from themera.

definite-d avatar definite-d commented on August 27, 2024

The patch is up... All fixed.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello once more, @PySimpleGUI.

Version 2.2 is coming soon...
This time, I'm adding a feature (to LookyFeely) that might blow the minds of logo and graphic designers. Can you guess?

Anyway, before any commits, I would like your feedback on the initial v2, so I can make ammends if any are needed.

Side note:
I played around with making a custom loading screen (similar to PyCharm's), and I noticed that when I used the 'no_titlebar' parameter of the Window element it had no ''window entry'' on my taskbar; which is exactly what I needed for such an application (loading screens don't need that stuff, right?). But that means stuff like custom/cool looking titlebars for windows (like Adobe Photoshop's titlebar) become unfeasible.
(P.S., I use the Windows OS, like you probably do.)

from themera.

definite-d avatar definite-d commented on August 27, 2024

The loading screen turned out perfect by the way.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Keep going. Keep innovating, trying new stuff, making change, refining, ....

Yes, no_titlebar is handy for a number of reasons, including the lack of icon on your taskbar. I recently described the phenomena in a "rainmeter widget" demo:

https://github.com/PySimpleGUI/PySimpleGUI-Rainmeter-CPU-Cores

As you've probably already seen in the animated GIF demos, the no-titlebar plays in an important role in these "loading" / splash screen types of windows:

https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Animated_GIFs.py

The popup_quick_message is a capability I've leveraged quite a bit recently as it will stay visible beyond the "auto-close" time indicated in case the operation being performed takes longer than excepted. Because it's non-blocking, it doesn't cost anything to show one of these messages to users when about to go into some long operation.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Alright! The latest feature of LookyFeely is nearly complete. At bare minimum, it works. Since you didn't guess that time, I'll tell you. It creates themes out of images.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

THAT is a cool thing!!
I certainly don't have anything like that in the works.

Sorry it's taken so long to reply. I'm behind in everything at the moment.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello again @PySimpleGUI.
I totally understand not being able to reply; I've taken far too long to update this project myself!

Anyway, Version 2.2.2 is up.
It's got the colors-from-images option, a gray out auto-gen mode, use of only dark default themes and a few minor changes.

Feel free to check it out, as usual.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Hi there!

That's great news. I will definitely check it out!

I've been nose down lately, whenever I can be. Everything took a rather large hit over the past month. It's great to see you've kept things rolling, continuing to add, improve, create. They get better everything time, right? They seem to for me. This latest post is an example. There's a new popup_get_date because people have been asking for more control over the date-chooser. It's all PySimpleGUI code. There's nothing but standard calls used so it gives me practice at using the package too.

Gleaming colors from images is the platinum feature for programs like palette builders and image editors. This is a really cool idea.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Holy sh*t!
This is amazing. I loaded up an image, which was really cool. And then I did the PREVIEW which was amazing! The progress meter was brilliant.

Damn man... this is going to be fun to play with. Got to spotlight this. I'll certainly do so, but it would be fantastic to post on Reddit. It's SUPER toxic there right now though. I don't even post my stuff on any Reddit python sub now. It's too emotionally risky for me. I dunno, getting attacked and downvoted after having working really hard on something sucks.

HOWEVER, the PySimpleGUI subreddit will eat this up. There's little risk there. Someone posted about the new YouTube videos I've been making. I hadn't thought of posting there about them. People that subscribe clearly want to hear about PySimpleGUI.

There is about to be an article released in one of the large Python newsletters / tutorial sites. This is going to stir up some interesting visits. I want to make sure people find you.

It would be good to do a collaborative thing in my Cookbook so I can get them to you as well as teach them how to integrate using the latest techniques. To be honest, I'm not sure of the best way. And maybe some new APIs should be added. Just thinking out loud here. Much more will come to me as I'm able to absorb this.

I would like to make 2 suggestions that I think will make it better. Not a big deal but would work better.

  1. The sliders that select the colors. I like the design look, but the functionality on my system was difficult. I had a hard time getting my mouse to click on the small spot needed to drag the slider. It's an unfortunate tkinter thing that is NOT at all your kind of fault. It's just how it's turning out. There ends up being making a 10x10 pixel area to grab if made small.

  2. Path to get to your image tool. That thing belongs on a LARGE BUTTON on your main screen. It's a whole product itself and should be the primary focus of this. I think it's a true "killer feature". The rest almost supports that feature rather than that feature filling in what they don't make by hand. Don't get me wrong the by hand stuff is still super important. It's good you've got a good interface for that. I'm just saying it shouldn't require a couple clicks to get to the image thing. It should be right there. Maybe make it a tab??? Even then make it super noticeable.

I hope you're proud of how far you've come with this project. Damn... it's really motivating seeing this kind of work. Congrats.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello @PySimpleGUI !

Thanks for all the compliments! 😃 Makes me feel good, knowing that my best PySimpleGUI program (so far) was built for PySimpleGUI users.

Well, knowing now that LookyFeely may get a huge boost in popularity, I'm going to have to make the code a bit more formal. I admit, I wrote that code too "freely". LookyFeely's name is a testimony to that. Also, that Help window needs help in itself... Maybe I should make some sort of online wiki or GitHub Pages site instead of a window. And if I do that, referring people on how to use LookyFeely would be easier.

About the Reddit thing; I agree with your opinion, it's okay to put it up on the PSG subreddit, but not the Python one. Honestly, I wouldn't have cared (too) much about some trolls' downvotes and snide remarks (even if it gets to me, I wouldn't stop working on LookyFeely; people need it), but risks are risky for a reason.

The YouTube, Cookbook and article... no problem there :thumbs-up:. Feel free to share whatever comes to you.

As for what you said about APIs... you kind of lost me there.

Due to your comment now, I've worked on Colorpiq and LookyFeely's use of it. Took 26 tweaks and runs to make the sliders a bit fatter and more clickable (they're kind of like worms instead of spaghetti now). I guess that helps with your 1st suggestion.

About your second suggestion, let me explain why I placed the ImagePalette feature where I did:

To be honest, I initially built ImagePalette as a tab. The first draft even had an image previewer planned (with a lenny or troll face if there was no image), but that image previewer required a timeout on the main window to operate as planned so I scrapped it anyway. Maybe I'll bring it back, now that ImagePalette has a window of its own. But it turns out, as I kept developing ImagePalette, I noticed how important it was to have customization of the potential theme to be generated, from the Specifier tab.

That didn't make much sense, did it?
To explain, take this instance for example; I need to make a theme with the Instagram logo using ImagePalette. But I love dark modes, so I want my background to be #2b2b2b or some other shade of gray instead of the usual white. It would be handy if I could just slide over to my gray from Specifier and have the LookyFeely honor my choice (while ImagePalette does its job and gives me my Instagram theme), rather than use ImagePalette and edit code after (that method's not so... chic).

So I asked myself; how did I handle stuff like this before - special features that can be influenced by the colors specified (Mono and Random)? The answer was the "Unspecified Colors" Options window.

Unspecified Colors' options/features actually assume full control of the entire theme, but at the end of their job, they always have their result overridden by whatever colors the user actually specified. This gives the user freedom to do something like mixing and matching personal color choices with automatic results from LookyFeely's features.

Besides, I think it's quite the selling point to potential users that LookyFeely gives them the ability to entirely bypass >=18 clicks, Generate button included (for all-out specification of a theme) with literally just 3 clicks to have LookyFeely take care of that for them.

Actually, I don't see the Unspecified Options as mere fill-in robots. ImagePalette, Mono and Random (the 3 big features) don't care if you specified even one color. They'll work fine without anything being specified. In fact, during testing, I sometimes just blitz in "asdf" as the theme name and press Enter. Nothing else. The Unspecified Options work responsibly, and I always get a theme.

I totally understand your want for ImagePalette to be on the "front page" of LookyFeely though (I'm proud of it too), but please understand my boring reason.

By the way, here's the result that would come from my little Instagram scenario above (ImagePalette seemed to focus on the orange part more):

# Custom Instadark LookAndFeel Theme.
# Generated using LookyFeely.
import PySimpleGUI as sg  # Please change 'sg' to your liking.
sg.LOOK_AND_FEEL_TABLE['Instadark'] = {'BACKGROUND': 'black',
    'TEXT': 'white',
    'INPUT': '#feb841',
    'TEXT_INPUT': '#de2374',
    'SCROLL': '#bd914a',
    'BUTTON': ('#354a96', '#fa8830'),
    'PROGRESS': ('#4e5dd8', '#feb841'),
    'BORDER': 1,
    'SLIDER_DEPTH': 1,
    'PROGRESS_DEPTH': 0}

sg.ChangeLookAndFeel('Instad
ark')

Instagram Logo

Instadark

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

"Toolchain". I don't know if you've worked in a software / artwork department and have encountered this concept before.

Basically there's a pipeline of tools that are used. Sometimes it's a strict ordering that's important. Other times they work together in a "mosaic" kind of way, sorta like a "toolbelt".

My "use case", my toolchain, and your's may be completely different. The tutorial I would like to write will describe a particular toolchain and how to use it to build PySimpleGUI themes.

For themes, I used a WIDE variety of tools to create them.

Here are a few of the tools I use for images / color on a regular basis:
image

My plan has been to use your software as a replacement of a tool that I wrote and pretty sure I shared with you. There are 3 steps that I see in creating a theme.

  1. Palette selection - getting a group of 5 colors that will work together
  2. Arranging the colors / assigning them to the elements
  3. Generation of the Theme code

I just re-discovered that I covered a lot of this on this page where my original program is posted:
https://github.com/PySimpleGUI/PySimpleGUI/tree/master/ThemeMaker

Your program doesn't fill all of the needs that I have, but does some. The reason the ImagePalette feature is so important to me is that it enables quick insertion of colors. I will not be using it on plain images and logos. Your tool fits into my toolchain in a particular way.

Finding colors that work together is something I rely on a lot of tools and websites to do. I've even purchased physical and ebooks of nothing but color palettes. Getting those color entered into a program has been a difficult process. Israel Dryer wrote a program that generated a py file that I use in the ThemeMaker code now. He enabled me to get a website's worth of color palettes into my code quickly and easily.

Looking again at my toolchain / mosaic of tools, I have PC based ones and online ones. A recent nice online find was this one:
http://www.colorschemedesigner.com/csd-3.5/

It's the kind of tool that "designers" and "artistrs" would use.

image

It uses color-theory concepts that have been used countless times in creating art, web pages, etc. It is where many of us will go to get our initial colors. Most likely the sliders and manual controls that you've created are not how a designer would use your tool. They are likely to use something like the color schemer because they can get the computed "triad" colors based on an initial color. They can use all kinds of crazy technical color algorithms that are unlikely to be something you and I are able to put into our code.

This is why "toolchains" exist. It's so that you can use the best tool for a particular step, and then glue together all of the steps.

You have one use case and how you use your tool. I've been trying to describe the one I use and will document in a tutorial. It's how I've seen designers work in the past. There have been a number of companies I've worked at with artists and designers and I've got a little bit of an idea of how they work.

OK, so far I've talked about how to get the initial set of colors, the palette. From the online tool I showed above, I could likely create something like this image:

image

That may not be enough colors, so maybe the one from the same page with more choices

image

I would take parts of that and run them into your tool. This allows me to quickly "enter" the RGB values into your program.

THAT'S the primary purpose of I see of using the ImagePalette feature... it's to take palettes generated by other tools and then getting them loaded into your program.

It's the NEXT step that my suggestion for a "scramble" or "shuffle" button comes into play. Your code at the moment takes the colors I provide and gives me ONE option for creating a theme from them. I'm shown a single preview.

A single option is not enough. It's why I created my Theme Maker program to begin with.

Let's review how it worked. Given ONE of these groups of 5 or so colors, it presented the user with this GUI:

image

From those 4 squares of choices I believe it ends up making 2 actual themes.

Each of the 4 squares has a checkbox that when checked will cause a theme to be made using those settings.

Let's look at one of those squares.

image

What you see here are a couple of groups of radio buttons. The background is already set to the light yellow color. So that one can't be changed. But, the color of the text, the input text background, the input text input color, and the button colors (MOST importantly the button colors).

For the buttons there are 11 choices available. ELEVEN.

The color 140 color palettes shipping with PySimpleGUI were made using this kind of rigorous human interaction. They were not computed and shown as a single choice. There are too many combinations possible for a computer program to choose the "best to the human eye".


Pulling all this together.

Your program has turned into something that enables me to quickly load an image of a palette. Before I needed to rely on Israel's code or I had to hand enter them. Hand entering them isn't an option. Using your single color at a time method with sliders, for me, isn't a usable way to get colors into the program. It's simply too tedious and slow. Even copy and pasting the color codes is super slow compared to 'here's a photo of colors, find the RGB values and then let me see them'.

You've got a nice theme previewer too, similar to my Theme Maker's one. It's a very important part of this process / toolchain.

What's missing is the ability to modify WHAT each color is used for. You have an algorithm that puts into into 1 possibility. I need many more than that. The simplest way I could think of making that happen is to use a "shuffle" button that will re-arrange them randomly. Then it's a matter of clicking the shuffle over and over until a "winning combination" is found.

It's either a shuffle thing or I need something like my theme maker's level of choices. You've currently given me 1 choice. I need 11. I don't THINK you want to make an "editor" like window like the ones I created that enable one to assign the colors in a particular way... that is what these are all about:

image

The final bit of magic your code does well is generate the code needed for the user to be able to add the "right combination" to the PySimpleGUI package / their code. You've cracked the code at going from an arrangement of colors into code.


The hole....

The hole that is in the tool that I'm looking to get filled is the assignment of colors to elements. It's that square from the theme maker or a shuffle button on your interface. That's where I need some kind of addition. I almost added it yesterday but wasn't able to get it done before running out of time.


Code cleanup

I know you're concerned about how your code looks, but I wouldn't worry about it. Your application is not a "demo program". you have created an end-user application. It just happens to be one that helps out PySimpleGUI developers. I won't be sending people to look at your source code.

Just like I don't send people to the pyIDM project as an example of how to build a PySimpleGUI program. I send people there because it's a cool program and does what it's supposed to do very well.

Your program falls into this "application" category. There are more and more of these programs being written and released on GitHub. GitHub claims there are currently 636 projects using PySimpleGUI. To me, these are all applications. They are "products". They are not demo programs or templates meant to demonstrate how to make a program. They are standalone products.


Maybe my use case isn't what you're trying to build for and solve and that's OK. If you're happy with what you've built and you're finding other people are too, then that's great and you've got plenty to be proud of for sure.

I just saw a potential for putting together something that's a particular kind of design and development tool that I believe would be used by artists and designers. It could make for an interesting toolchain and tutorial. But if it's not meant to be, it's not meant to be. This is your project, meant to bring you and your users enjoyment. It's not a contracted / work-for-hire project that I'm paying you to make. Even if I'm not able to write a tutorial describing the toolchain that I described here, I'll still certainly be sending people over to use your tool. Ir's a fantastic creation that I'm sure people will enjoy using.

As long as you're enjoying this, that's what's important.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Toolchains aren't new to me; your specific toolchain is what's new. Thanks for the in-depth explanation. And by the way, I'm actually also a graphic designer 😄.

Okay, I see what you mean. You require something that gives power over re-arrangement of colors, even after stuff like ImagePalette have played their part, right?.
Sorry, but for convenience, could this specific matter (the shuffle button and/or other means to control arrangement) be dealt with in detail on issue #5 ?

That hole will be filled 👍 .

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

And by the way, I'm actually also a graphic designer

🤦🏻‍♂️

DOH!

Sorry! Man, it was a really really really long night. Not at all trying to be a know-it-all but rather
just share stuff I've learned over the years. It took me a long time of working next to artists to understand how their world and brain is completely different than mine and other software engineers. It was an experience that I really value and wish more software people were working with artistic people nearby.

from themera.

definite-d avatar definite-d commented on August 27, 2024

No offence taken, that's okay. You were only trying to explain properly.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello there.

I understand that I promised to upload the new version with the perfected shuffle and all (v2.6) after I fixed the bug, but I've decided to slip in one last feature. Well, it's more of a UI improvent rather than a feature.

It's an extension module for PySimpleGUI, which gives the ability to automatically reposition child windows to a specified parent window. I'm thinking of calling it Window Wrangler, and once I'm done, it will be up on its own repository.

I'm intending to add this module's functionality to LookyFeely, since the UI is constantly changing and thus future windows need to be able to position themselves well without manually moving them.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Wow.

As expected, you've already seen a far more advanced an cool use case for such.

The extension module actually has two classes:

  • WindowContainer: For getting out the location values of different points in the window supplied ( like the upper left corner, center of the window etc)

  • WindowManager: For doing the actual heavy lifting with a parent window and child windows specified.

So, if I need a window to move to the parent at the click of a button, I simply call the WindowManager.reposition_window() function. This moves the child window specified as an attribute to the upper left corner of the parent window; what you'd expect to happen from manually getting the location of the desired reference window and then manually computing where the sub window should move to, then calling aMove and Refresh on the window.

By calling WindowManager.reposition_window(somewindow, "UC", "UC"), I can have somewindow move to the parent window's top-center as though I manually dragged the top-center of somewindow to align with that of the parent window (provided that somewindow is under the WindowManager's control).

from themera.

definite-d avatar definite-d commented on August 27, 2024

This comment is mainly about WindowWrangler, not LookyFeely.

Well, about an hour ago, I was certain I had a fully working solution for all window auto-location issues, but I actually ended up with a huge and complex location calculator that interferes with the functioning of the windows by calling their functions on its own and altering their Read structure, and that interference is a bad thing because windows exist within their own event loops and them having a timeout value complicates things further.

So, unfortunately, I'll have to scrap what I've done and go for a lighter solution that:

  • simply returns the ideal location for any window in accordance with the location of a reference (formerly parent) window,

rather than

  • jumping in and applying that location itself then having to call a Refresh or a separate Read. This is what I have now, and it works, but not as expected. (Hint: Using it with a timeout enabled window within the event loops gives a tk error. Using it outside stops the execution flow.)

It will be up to the judgement of the user to use that location tuple however he sees fit, most likely by calling the Move function.

Now that I think about it, (not considering that a one-liner function is always preferable for utility packages), that structure actually gives the user more control.

Having such a structure will probably enable the background image use-case you mentioned to be possible by constantly checking the larger window's location and updating the smaller (actual) window it with the location value provided by WindowWrangler, preferably in a separate thread.

I know this isn't really the place to post stuff about a potentially different extension for PySimpleGUI, and I still haven't uploaded the promised LookyFeely version itself, but I really want these two to work hand in hand.

from themera.

definite-d avatar definite-d commented on August 27, 2024

In case you're wondering what exactly WindowWrangler can do right now (and also to explain better), I mentioned this:

... if I need a window to move to the parent at the click of a button, I simply call the WindowManager.reposition_window() function. This moves the child window specified as an attribute to the upper left corner of the parent window; what you'd expect to happen from manually getting the location of the desired reference window and then manually computing where the sub window should move to, then calling aMove and Refresh on the window.

By calling WindowManager.reposition_window(somewindow, "UC", "UC"), I can have somewindow move to the parent window's top-center as though I manually dragged the top-center...

I also have a function that moves the parent window and optionally has the child windows move automatically, with options to retain offset. I imagine this could be used to fake multi-area windows like most graphics design software.

This new structure I'm planning will likely condense all that into a single tuple result: the best location for any window to be in relation to a reference window.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Well, with the new structure in place and a few hacks, I've managed to replicate your use case above without multithreading, though not exactly. A window following another as you showed up there is absolutely possible with my method, but the movement doesn't happen in real-time, and the window being moved has to be read with a 0 timeout.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Congrats on making a window manager. You're ahead of me in expanding PySimpleGUI in this formal of a way. I've not formalized a Window Manager that groups together windows. It's been up to the user to date to manage window, much like you're doing. There's not an event at the moment that can be enabled that will tell you that a window has been moved. That's what you need to pull off something like synchronized windows in a way that's not polled.

There are a couple of new features that begin to expand the overall window capabilities like replacing the titlebar with a custom built one. That capability is coming up in the next release as I have made it possible to grab portions of windows (Text and Column elements) to move windows. It's an incremental approach with new stuff slowly added along with bug fixes.

Headsup about theme coloring. There's a new constant that is used to specify that a theme's progress bar is to be "computed". Previously the "default" variable was used to indicate this, but using that variable created a bit of a problem as it held the computed value rather than staying constant. What I needed was a constant that indicates the progress bar isn't specified in the definition but instead created using colors that are already part of the definition (e.g. button colors or the input text colors). I don't think it'll impact your code though.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Darn, I'm getting excited thinking about the next release. It'll definitely be fun to play around with a Photoshop-esque custom titlebar.

About the window manager thing, considering the complexity of windows (which hit me when I actually tried altering past normal use), I'm not sure if a manager that has control over all windows would work as hoped for with the structure I had.

So, for the sake of the initial use case (to reposition windows), the new structure turns that into a location calculator. That's what will be distributed with LookyFeely, and I'll likely name it PSG_Loc8.

After the upload, I'll start re-developing a proper window manager.

Perhaps LookyFeely could use the proper manager in a later release.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Glad you're looking forward to it.... meanwhile I'm half terrified of releasing it. Tons of changes. Testing on my Raspberry Pi at the moment to make sure everything still runs on 3.4. Having some trouble with the custom titlebar on the Pi. I'm not able to input text as it's going to the terminal window instead of the program. I think it may be related to running without a titlebar.
I might have to force the focus. It looks great and I'm able to move the window around the Pi's screen with no problem. But won't be much good if can't enter anything.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

No titlebar Pi

Needed to add a couple of new things to get the no-titlebar demo working right on the Pi. Glad the demo exposed an existing problem. tkinter isn't able to get focus unless focus is forced on the Pi. Was a great thing to catch. I'm sure it's been a problem for a while but no one has hit it yet. I think most people run full-screen on their Pi or run with a normal titlebar. No one has hit the right combination.

from themera.

definite-d avatar definite-d commented on August 27, 2024

And of course, if it works on the Pi, it works nearly everywhere. That's great.

Speaking of changes, I hope it's not too much to add one more. Don't worry, I don't think it's very big. It's about the Horizontal Spacer element in Tk.

If I were to make a custom titlebar, I'd essentially have a single row containing:

  • The icon. Probably with a dummy button, as I don't really use the Image element itself.
  • A text element for the window title.
  • A horizontal spacer
  • 2 or 3 buttons for window functionality.

From what I noticed while making the new shuffle window for LookyFeely, a horizontal spacer shows a sort of border along the top edge, making it seem sort of elevated. I understand that this comes in handy for good looking status bars at the bottom of windows, but it seems somewhat unsettling at the top in a custom titlebar or anywhere else in the window.

I had to use a text element with a space character as its value multiplied by over 30. This gave the desired spacing effect, but it needs manual adjustment everytime the window width changes.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Can you post an image and perhaps that portion of your layout? I'm not sure I understand the issue from the description. Seeing it would be helpful. A short demo of it would be even better.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

You may want to also look at the expand capability that's been added. It is needed in order to right justify items so that they will move correctly when the window is resized. Maybe have a look at the custom titlebar demos to get a better idea of how expand is used. Previously you could do this by calling expand. Now it's been added as a parameter to the Column element. There's also a new status bar demo that shows how to use an expanding row to keep a titlebar located at the bottom of the window that also spans the width of the window.

from themera.

definite-d avatar definite-d commented on August 27, 2024

I see. Well, that answers all issues about that 😁 . No need to bother about the spacer if there's a better way, right?

Honestly, with all the testing and tweaking I've been on about LookyFeely, it's turned the code into a mess. When you click "Generate Theme" now, an unresponsive Unspecified Options window comes up. Closing that and clicking to generate again makes it work normally, but then again there's a random chance that the options may or may not work at all (with the exception of ImagePalette for some reason).

Again, it's a mess. I guess the best way for locating windows from the beginning of their life cycle is to specify a location in the window definition.

Then again, I just got an idea for a new structure (literally while typing this).

Windows are made of most commonly two things (from the user perspective); a layout declaration and calling the window function, right? And the layout is what defines the size (and thus basic location) of the window.

What if, the window relocator is built to work with mainly layouts rather than windows themselves? It could work like this:

  • A Locator object is created, probably outside the reference window's event loop or first Read().
  • The user registers the reference/home window as such when creating the object. This is the only Window object used by the locator, and it is used to obtain the home location and size.
  • To get the ideal location for any window, the user has to use a calculator function and supply the layout for that window as a parameter.
  • That location can then be fed into the window declaration.
  • Behind the scenes, the supplied layout is duplicated and used to make a dummy window with a blacked-out theme, which is finalized and used for calculations. This process would appear better if there's a way to Finalize windows without them showing up for a split second.

Using layouts rather than windows themselves has the advantage of enabling the location to be passed as a parameter instead of having to depend on Finalize and Read hacks then Moving the window to the calculated location.

Rather, from the beginning, the window appears in the right place, and if the user wishes, he can use the Move function.

Have I hit the jackpot structure? Do tell me what you think.

from themera.

definite-d avatar definite-d commented on August 27, 2024

I've also found a way to duplicate layouts which have been used in Windows already, at least for my uses (for a dummy window).

I'm applying the locator system to LookyFeely now, and I might as well throw in a color previewer dummy button.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Well, I'm done with integrating PSG-Loc8 (yes, that's what I named it) with the core part of LookyFeely, meaning that through the process of making a theme, all windows will be spawned properly no matter the location of the parent window.

from themera.

definite-d avatar definite-d commented on August 27, 2024

The latest version, 2.6, brings the new system I talked about.

A little thing to note though; LookyFeely may run a bit slow, thanks to PSG_Loc8 literally duplicating windows for data (though that happens literally invisibly).

from themera.

definite-d avatar definite-d commented on August 27, 2024

Hello everyone.

I know, I haven't been as active on this project as I used to, but I'll try to rectify that.

My computer recently crashed on me, and I lost my Python installation, which I can't get back due to some issues with my new system, so I'm using Repl.it now.

Screenshot of Repl.it workspace

I've never used it before though, so it may take a while to get used to.

Anyway, I'm back now, and I'll start working on the things in the Roadmap.

Cheers. And Merry Christmas in advance.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Since the major issue is running anything in Python, I decided to use a different workflow:

  • Edit in Visual Studio Code
  • Copy-paste into Repl.it and Run the code
  • Do my testing with the widget shown.
  • Repeat the process.

It's a bit cumbersome compared to my usual workflow of simply using PyCharm offline and clicking Ctrl+F5 whenever I need to run LF, but it works.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I've been using Trinket as well, but there are some downsides. It doesn't do external package installs for example. But, it's superior in terms of being a teaching tool.

I used repl.it early on, but there was a period where it really failed badly with tkinter based projects. Some of my early projects no longer run and I think I'm going to have to delete them and start over. They're somehow corrupt.

Sometimes I found that I needed to import tkinter first thing in my code, even though tkinter isn't used in my main.py file. This was needed to trigger repl.it to use a tkinter based environment.

Lately I was struggling with errors saying that user packages weren't allowed. It's more of the corrupt projects best I can tell.

I'm back to using Trinket for an upcoming course I'm working on. This is my primary trinket page that has a bunch of projects. It's pretty old:
https://pysimplegui.trinket.io/demo-programs#/demo-programs/the-basic-pysimplegui-program

But, it gets around the clock usage. Every time I go and see how people are using it, I see that in the past few MINUTES someone has run some of the examples. So I know it's reaching a large number of people generally speaking.

image

from themera.

definite-d avatar definite-d commented on August 27, 2024

That's no surprise; PySimpleGUI is the miracle of Python GUIs.

Well, I sure hope Repl.it doesn't give me unpredictable behavior down the line. It's already a bit awkward, as it doesn't support transparency. I'll look into Trinket soon. Thanks.

Now, I'm not sure if this is a bug caused by the change of systems, but are you unable to use ImagePalette successfully? I get a silent crash (likely masked by some break call). I want to be sure if it's a code issue.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

are you unable to use ImagePalette successfully?

I'm officially "taking a break" from the project and not looking at GitHub Issues, etc. I've arrived at a continue/quit decision point. Working non-stop for 2 1/2 years with no income has resulted in a financial and emotional crater which has necessitated a break from the project while I regroup and investigate options for the future for the project or determine this is the end of the road. Witnessing corporations benefit financially while not responding to pleas for assistance while others attempt to profit from PySimpleGUI by making minimal/superficial patches, renaming the package, and then asking for donations has resulted in this reassessment-break.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Wow...

Well, enjoy your break. I really hope you don't quit this project, but you clearly have your reasons if you do.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Thank you.... sorry to be abrupt or rash sounding. It's just frustrating showing through and complaining isn't going to be of benefit to anyone. It's ugly words and the internet has plenty of those. I'm sorry for posting them. -ugh- Too much ugliness in the world. I'm sorry to have contributed.

I really really appreciate all the help and support you've provided. It's invaluable. It's been the fuel for the passion of the project. Without the help and support of the many truly nice PySimpleGUI users out there, I wouldn't have made it this far. So, thanks.... your contribution has been large on many levels.

I've been busily designing a course for PySimpleGUI, so I'm not standing completely still. Slowly filling up my notebook with ideas, outlines, lists, sketches. Hopefully, something good will come from it. If PySimpleGUI is at all pioneering, then I'm bound to have a few arrows in my back.

Thanks again for being a positive voice in the PySimpleGUI universe.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

Happy New Year! Love the new name!!

You sound really hopeful and have a sense of direction for the project. That's fantastic to see. It's a great fit for 2021.

from themera.

PySimpleGUI avatar PySimpleGUI commented on August 27, 2024

I dunno about any other services. I use GitHub with GitHub desktop on Windows. I sometimes connect with the GitKraken GUI on windows but don't manipulate anything with it. I feel like I kinda have to be on GitHub. Good luck with whatever you end up with. Sad to hear you're spending time and energy on something so frustrating and not particularly enjoyable.

from themera.

definite-d avatar definite-d commented on August 27, 2024

Welp, I managed to fix things.

First, I got the repo set up on Sourcetree, then I made a new branch based off the first ever commit I made on this repo. Things were then as easy as deleting the old LICENSE and README.md files, and uploading all files below the 20MB GitHub upload mark.

Then I changed the default branch to 'main'; the branch I created.

Right now, I've got Filestash operating right (I guess), and I'm using that to upload the compiled app, the installer and the zip for Themera.

Also,
I'm awfully sorry to all the watchers of this project; you all have probably seen a ton of emails of my activity from fooling around with GitHub, based on your Watch notification settings. I apologize again.

Anyway, in some minutes, Themera should be fully up and ready to be used 👍🏾 .

from themera.

definite-d avatar definite-d commented on August 27, 2024

Scratch that, it's all set now. Go ahead 👍🏾 .
By the way, I think this issue should be closed once the number of comments reaches 100.

from themera.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.