MyrTheMoth / Oblige-my-Doom

A small python based launcher to get a fresh Oblige map and launch it with your favorite source port
MIT License
3 stars 0 forks source link

Is PySimpleGUI (animation in particular) working out OK? #1

Closed MikeTheWatchGuy closed 5 years ago

MikeTheWatchGuy commented 5 years ago

Just came across your code and saw you're using the base64 animated popups.

Wanting to make sure it's all working out for you as it's a relatively new capability.

MyrTheMoth commented 5 years ago

I used the base64 feature because I was having trouble loading the GIF, no matter what I did it kept saying it wasn't a supported image, it works just fine with base64, but it won't animate, I'm not sure if there is something wrong with the encoding or if that's just because using subprocess.run() locks up everything

MikeTheWatchGuy commented 5 years ago

Can you post the file that caused problems?

About animating.... have you tried to simplify your program down to just the loop that's animating the image? That would be a call to the Popup inside of a loop.

Are you clear on how the animation popup works? You must keep calling that function if you want it to animate.

I'll try digging around a little at your code and see if I can find anything. Having the file will help of course.

MikeTheWatchGuy commented 5 years ago

It looks like your animation is working OK in a test environment.

Your time between frames was too low at 10 ms. 100 ms is more reasonable or else it goes way too fast.

Check it out running here: https://repl.it/@PySimpleGUI/Looping-Animation-Test

MyrTheMoth commented 5 years ago

Aah, thank you, here is the file itself 30

I guess the animation is locked due to subprocess.run(), I was using 100ms before as well

MikeTheWatchGuy commented 5 years ago

Hmmmm... well...., the file worked out fine. It too ran in the same loop at the base64 one

while True:
    sg.PopupAnimated(image_source=r"E:\DownloadsE\testanim.gif", message="Generating Map, Time Depends on your Oblige Config", alpha_channel=1, time_between_frames=100)
    sg.PopupAnimated(image_source=loading_animation, message="Generating Map, Time Depends on your Oblige Config", alpha_channel=1, time_between_frames=100)
MyrTheMoth commented 5 years ago

I was getting a Tkinter error: Couldn't recognize data in image file, no matter how I setup the image_source path,

I tried "file.gif" while the gif was in the same folder as the script, tried to get the full path of the gif and such, also didn't work for some reason

MikeTheWatchGuy commented 5 years ago

What's your OS?

Did you try a fully qualified path like in my example? Using the r" " format?

This line of code demonstrates what I mean.

    sg.PopupAnimated(image_source=r"E:\DownloadsE\testanim.gif", message="Generating Map, Time Depends on your Oblige Config", alpha_channel=1, time_between_frames=100)
MikeTheWatchGuy commented 5 years ago

WOW!!! Your button trick is amazing!

    [sg.Button("▲")],
    [sg.Button("▼")]

How did you get those characters in there??

They look GREAT in a window too. image

MyrTheMoth commented 5 years ago

Got them from here https://www.alt-codes.net/arrow_alt_codes.php I was curious if there would be no issue reporting events with those characters, and I guess there's no problem \o/

MyrTheMoth commented 5 years ago

What's your OS?

Did you try a fully qualified path like in my example? Using the r" " format?

This line of code demonstrates what I mean.

    sg.PopupAnimated(image_source=r"E:\DownloadsE\testanim.gif", message="Generating Map, Time Depends on your Oblige Config", alpha_channel=1, time_between_frames=100)

Windows 10, I did use it like that, also gave me that error, maybe it was the file itself, I got it from https://icons8.com/preloaders/

MikeTheWatchGuy commented 5 years ago

I used the file you gave me... I downloaded it from this Issue. Try downloading it and running it just like I did. I downloaded, then I ran the loop I posted above. It worked great.

Perhaps you've got an old version of tkinter?

Are you running Python 3?

MikeTheWatchGuy commented 5 years ago

I was curious if there would be no issue reporting events with those characters, and I guess there's no problem \o/

I would recommend using keys on those types of buttons so that you don't have anything complaining about weird strings. It appears they work fine however when using them straight as strings.

MikeTheWatchGuy commented 5 years ago

Please try this test program that I've been using in this thread rather than anything you've used in the past:

import PySimpleGUI as sg

loading_animation = b'R0lGODlhoAAUAOMAAHx+fNTS1KSipKyqrPz6/KSmpKyurPz+/P7+/gAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCQAIACwAAAAAoAAUAAAE/hDJSau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru/jERiGwEFD+AWHmSJQSDQyk04kRnlsLqUX6nMatVanBYAYMCCAx2RzNjwun9tqC4Etdq/Rdjk9/a7HK3N4fxSBcBgBaGIBh4kAixeIiY8WkWiTFZVjlxSZioySn5ahmqOeF3tiAhioAKqnja4WrLEVs6uwt4m0FLavurlouxOsAxgCjcUXx4nJFst4xsjRzNPQytLX1NnWlI2bE52O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ly5gza95cIgQAIfkECQkAEAAsAAAAAKAAFACEBAIElJaU1NLU9PL0REJEpKak/Pr8rK6sPD48FBIU1NbU9Pb0fH58rKqs/P78tLK0/v7+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABf4gJI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqPq8EAyWwCHY8EAJA4OFIOweOhMKiy2+5Xy/ViyeJz2IwCl8dr+Fs9NzkI0zyAcDUZDgyBDAdsJX+Cg4Ukh4KEKIyBjieQiY+AjYojlJJ+l5GZIpugB3p6BycCiIECKKmqrKiqDLAmroi0JbaCuCS6q62yvCO+s8CvdlKlUwl9JA2yDSjPqtEn04jVJteC2SXbgd3O0NLj1uXa5yMLynoL6NTk8Oby79jx9vP49dz3/Pn+JNaxm+IulywFxhAhjKVqYa2DCQU5NNgwYqCJvSAyVOgnmTJmnQIFYPAAFAQDD2VEkjSJUmXJRykZjHw5KeZMljZXwnSJk+dOmTpNBBgYoI2CBw0EmAx1NOnSk02VqjAQ9SlVpFJTXHU6tWpXrFa9TkKgDMFTJ2jTYimQLEGBZmrjyk2yZK7du3jz6t3Lt6/fv3hDAAA7enJBaWc5bFhZWHQ5Zzg0LzdiYVdmNHNLNGhGQm5abHUyTXp6MHlxVG8vaHM1ZXRYUG9Sc0diNGlqL0s1MUYxTA=='

while True:
    sg.PopupAnimated(image_source=r"E:\DownloadsE\testanim.gif", message="Generating Map, Time Depends on your Oblige Config", alpha_channel=1, time_between_frames=100)
    sg.PopupAnimated(image_source=loading_animation, message="Generating Map, Time Depends on your Oblige Config", alpha_channel=1, time_between_frames=100)

exit()
MyrTheMoth commented 5 years ago

I used the file you gave me... I downloaded it from this Issue. Try downloading it and running it just like I did. I downloaded, then I ran the loop I posted above. It worked great.

Perhaps you've got an old version of tkinter?

Are you running Python 3?

Yeah, 3.7, I'll try again later today

MikeTheWatchGuy commented 5 years ago

Yea, try downloading, and then inserting into the code I just posted above. You can remove the base64 one if you don't want to see 2 anim at once. They will be on top of each other so you'll have to move one of them to see the other.

MikeTheWatchGuy commented 5 years ago

How about PySimpleGUI version?

MikeTheWatchGuy commented 5 years ago

oh wait!

There's a bug that I must have fixed..... version 3.26 just failed for me.... lemme check the one on GitHub

MikeTheWatchGuy commented 5 years ago

This is all coming back... wasn't this an Issue I fixed and posted on GitHub?

MikeTheWatchGuy commented 5 years ago

Crap.... the changes are on GitHub that work great!

But, the release 3.26 that was supposed to have them don't seem to, so I'm re-releasing again.

MikeTheWatchGuy commented 5 years ago

OK......

Finally figured things out a bit.

I was 1/2 way through getting release 3.26 out the door but didn't get the code released for some reason last week.

I went into the hospital on Thurs for surgery and must have run out of time.

Release 3.27 on PyPI or current PySimpleGUI.py from GitHub will fix your file problem.

I thought this was an ongoing discussion on the GitHub and I announced I made the change that could be downloaded, with the intention of making it pip available "soon".

I recommend deleting a PySimpleGUI.py file in your app folder if one is in there from GitHub and then pip installing to get version 3.27.

This will fix the file problem. It was actually a new feature adding the file stuff.

I'm so sorry if I've caused you or anyone else to lose time.

Please let me know if things work ok for you once you get the new stuff.

MyrTheMoth commented 5 years ago

Oh! Don't worry about it! once I get to update I'll try again, thank you for the help!

MikeTheWatchGuy commented 5 years ago

Yes, please run: pip install --upgrade --no-cache-dir PySimpleGUI

And make sure you don't have a PySimpleGUI.py file laying around.

Grrrr.... that was a big f-up on my part that wasted your time. I'm glad I asked about it. Well, thanks to you saying something, the fix finally got released.

The above demo should now work. Then you should try your app again.

One thing about your app's use of the popup is that it needs to be called inside of a loop of some sort. It doesn't do something exotic and run the animation for you as a spun-off thread. You have to call the popup call in a loop, at any speed you want. The reason for the time between frames parameter is so that the popup function will know if it's 'time to show a frame'.

It may turn out to be a feature that doesn't fit your program. I dunno.

MyrTheMoth commented 5 years ago

Don't sweat it! PySimpleGUI is pretty great! it allowed me to make a GUI prototype within minutes and get it working even faster than anything I've used before, if anything, I'd have blamed my own inexperience with python if you hadn't reached out, you are the real MVP ~

MikeTheWatchGuy commented 5 years ago

Yea, well, I've spent my entire life "sweating it" so I find it difficult and uncomfortable when things aren't right.

You pointed out exactly why, for me, it's gotta be done right, or fixed.... that you would assume it's your code. I'm glad I was able to chase this down before you assumed it was your problem. That's the exact thing I want to avoid like the plague!! That would be terrible.

I'm super happy to hear you were able to get a GUI up within minutes. That was the goal right from the start. GUI up and on the screen, a real GUI, within 5 minutes of hearing of PySimpleGUI. Most simple projects can be completed in an afternoon, if you already know Python.

Yea, I've not had any complaints from anyone, unless they didn't do any reading at all or copy a sample program, but "reasonable" people do great!

So don't worry about me paying too much attention 😉 It's how this package grows and gets better. As each one of these things is fixed, the next person doesn't have the same problem.

Thanks for the encouragement. It's very helpful. Balances out the negative stuff that's floating around. Lemme know if you have any problems at all.

MyrTheMoth commented 5 years ago

Sure! Well, I was trying to play around with the layout of my GUI to make it look good, but I couldn't get ListBox and the frame containing it to somehow be symmetrical in size to the other frame, so I kinda gave up and you can see it is just smaller, I'm not sure if I'm missing something about sizes and layouts, probably gotta give the documentation another pass or find a way to reorganize the elements to look better, it would be nice if I could just set the size of the frames and have the elements inside just stretch out to the max of the boundaries, I'll give the docs another look and see what I can come up with

MikeTheWatchGuy commented 5 years ago

Frame and Column sizing is a problem. I've tried, in tkinter, to directly set the sizes but can't seem to get it to work. You may have better luck using the Qt version? I find it massively frustrating this sizing thing.

MyrTheMoth commented 5 years ago

I tried PySimpleGUIQt and.. it is a large improvement on the looks department! image

MyrTheMoth commented 5 years ago

But... For some reason the Qt version doesn't let me use values[] image

MikeTheWatchGuy commented 5 years ago

It will run. Looks like your lint is complaining.

Lint hasn't been run on the code.

It's not crashing, right? I ran it with Qt.

It's too much for Wx and Web at the moment however.

MyrTheMoth commented 5 years ago

It crashed with PySimpleGUIQt, seems the values dictionary is handled differently image

Here's how they differ, Qt is the upper one, Tk is the lower one image

MikeTheWatchGuy commented 5 years ago

Do, debug a little here. The crash is not in PySimpleGUI. The crash is in your code, right? So, print out the value that's causing the trouble and look at it.

It appears the value is values["LoadConfig"] right?

In the printout I see it coming back as a list with a filename and a file type filter of some sort. Does that make sense? It seems a little odd.

Where are you getting the value from in your window?

The values being returned from the different PySimpleGUI ports may differ. There are some slight differences that sometimes need accounting for, especially in a complex GUI. It's just me doing all the ports after all 😉

So, if you can, help me debug this one further.

MyrTheMoth commented 5 years ago

I see, so what happens is that values["LoadConfig"] returns a tuple in PySimpleGUIQt with both the file path and the file filter, instead of only returning the file path as it does in PySimpleGUI image

So I'll have to change how I pass the values

MyrTheMoth commented 5 years ago

Oh, PySimpleGUIQt has no PopupAnimated 😢 image

MikeTheWatchGuy commented 5 years ago

I'm really confused by that return value for LoadConfig What does that correspond to exactly? What kind of Element. I don't know of anything that returns that kind of a tuple.

What can you tell me about this Element?

And yes, animations are not part of PySimpleGUIQt yet.

But, hey, they weren't working for you under PySimpleGUI anyway, right? (terrible joke)

MyrTheMoth commented 5 years ago

It's okay, I just used the Popup to lock the window and tell folk that Oblige is running and working hard

As for the Element, it is a FileBrowse button which I declared as: sg.FileBrowse("Load Game", key="LoadConfig", target=( "LoadConfig"), enable_events=True, file_types=(("XML Files", "*.xml"),)),

MikeTheWatchGuy commented 5 years ago

OK, then that's a bug of some kind.

MikeTheWatchGuy commented 5 years ago

Wait, your target is your button... that could be causing problems too

MyrTheMoth commented 5 years ago

It crashed with PySimpleGUIQt, seems the values dictionary is handled differently image

Here's how they differ, Qt is the upper one, Tk is the lower one image

Gotcha, also noticed that the FileBrowse buttons in PySimpleGUI are initialized as '' while PySimpleGUIQt they aren't initialize, if that is relevant

MikeTheWatchGuy commented 5 years ago

Make an Input field and set it as the target. Set your input field to visible=False

Use something like this:

            [sg.Input(key='LoadConfig', visible=False), sg.FileBrowse("Load Game",  target="LoadConfig", file_types=(("XML Files", "*.xml"),))],
MyrTheMoth commented 5 years ago

Ah, I used the button itself as the target because it was listed as a feature in the docs, where you can make it target itself to query it later

MikeTheWatchGuy commented 5 years ago

Yea, but I don't think that's implemented in Qt I need to remove that from the docs because of all these ports it is making it difficult to enable the advanced features to be specified without a disclaimer now

MikeTheWatchGuy commented 5 years ago

The more "acceptable" way now of all this it to create an "invisible" input field. This way it'll work in all ports, in theory.

MyrTheMoth commented 5 years ago

Gotcha, I'll try that

MyrTheMoth commented 5 years ago

Something I liked about PopupAnimated is that it will stay on screen until you call it again with None as image source, is there a way to make another Popup with no buttons that you can close by calling it again?

MikeTheWatchGuy commented 5 years ago

You can easily make your own window that works this way.

Lemme think of something....

MyrTheMoth commented 5 years ago

The more "acceptable" way now of all this it to create an "invisible" input field. This way it'll work in all ports, in theory.

Yeah, this works, no tuple, just the filepath as it was before, however, my buttons stopped causing events, so I had to enable_events=True on the invisible inputs and change the name of the events to the key of the inputs, I guess the target is the event trigger, good to know

MikeTheWatchGuy commented 5 years ago

This message / closing window with a call Popup is too simple for me to add a new Popup call across all the ports to do.

It's one line of code for you to display a window with a message

I'll write it out for you.... get ready... don't want you to miss it....

win = sg.Window('Msg Win').Layout([[sg.Text('Whatever I want to say')]]).Finalize()

It's one line of code for you to close the window with a message

win.Close()
MyrTheMoth commented 5 years ago

Oh, thank you, I was looking into the doc and making a second window already, thank you for the single line syntaxt tho!

MikeTheWatchGuy commented 5 years ago

I figured you wouldn't get that .Finalize() part as it's a tricky way to display a window so I went ahead and posted it. I'll post on the GitHub too somewhere as I'm sure someone else will want it eventually.

MyrTheMoth commented 5 years ago

image

Man, I can't believe how good this looks, thank you so much man, you are the real MVP 😭