Made initial window loop much shorter. Correctly handle closing initial window, add commented out line showing how to make transparent window if on windows, added copyright

This commit is contained in:
PySimpleGUI 2022-04-21 12:43:41 -04:00
parent bf872d0882
commit 40567418db
1 changed files with 7 additions and 3 deletions

View File

@ -11,6 +11,8 @@ import PySimpleGUI as sg
The first image that uses popup_animated will stop after a few seconds on its own. The first image that uses popup_animated will stop after a few seconds on its own.
The remaining images are shown 1 at a time. To move on to the next image, click the current image. The remaining images are shown 1 at a time. To move on to the next image, click the current image.
If you want to exit before reaching the final image, right click the image and choose 'exit' If you want to exit before reaching the final image, right click the image and choose 'exit'
Copyright 2022 PySimpleGUI
""" """
# ---------------------------- Base 64 GIFs ---------------------------- # ---------------------------- Base 64 GIFs ----------------------------
@ -29,18 +31,20 @@ bar_striped = b'R0lGODlhoAAUAIAAAAQCBP7+/iH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCQABACwA
gifs = [ring_blue, red_dots_ring, ring_black_dots, ring_gray_segments, ring_lines, blue_dots, red_dots_ring, bar_striped, line_boxes, line_bubbles] gifs = [ring_blue, red_dots_ring, ring_black_dots, ring_gray_segments, ring_lines, blue_dots, red_dots_ring, bar_striped, line_boxes, line_bubbles]
# first show how to use popup_animated using built-in GIF image # first show how to use popup_animated using built-in GIF image
for i in range(100000): for i in range(1000):
sg.popup_animated(sg.DEFAULT_BASE64_LOADING_GIF, message='Right Click To Exit GIF Windows That Follow\nLeft click to move to next one', no_titlebar=False, time_between_frames=100, text_color='black', background_color='white') if not sg.popup_animated(sg.DEFAULT_BASE64_LOADING_GIF, message='Right Click To Exit GIF Windows That Follow\nLeft click to move to next one', no_titlebar=False, time_between_frames=100, text_color='black', background_color='white'):
break
sg.popup_animated(None) # close all Animated Popups sg.popup_animated(None) # close all Animated Popups
# Next demo is to show how to create custom windows with animations # Next demo is to show how to create custom windows with animations
layout = [[sg.Image(data=gifs[0], enable_events=True, background_color='white', key='-IMAGE-', right_click_menu=['UNUSED', ['Exit']])],] layout = [[sg.Image(data=gifs[0], enable_events=True, background_color='white', key='-IMAGE-', right_click_menu=['UNUSED', ['Exit']], pad=0)],]
window = sg.Window('My new window', layout, window = sg.Window('My new window', layout,
no_titlebar=True, no_titlebar=True,
grab_anywhere=True, grab_anywhere=True,
keep_on_top=True, keep_on_top=True,
background_color='white', background_color='white',
# transparent_color='white' if sg.running_windows() else None,
alpha_channel=.8, alpha_channel=.8,
margins=(0,0)) margins=(0,0))