animal-gui.py 989 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. #
  5. # Copyright 2022 Stephen Stengel <stephen.stengel@cwu.edu> and friends
  6. #
  7. import multiprocessing
  8. def main(args):
  9. import gi
  10. gi.require_version("Gtk", "3.0")
  11. from gi.repository import Gtk
  12. print("Hello! Loading...")
  13. #Splash screen should go here.
  14. #I can't find any working tutorials or documentation. Gtk.main()
  15. #My plan:
  16. #Create a splash window using default glade splash window thing
  17. #Create a timer like in handlers.
  18. #Use multiprocessing to spawn a function that does loading
  19. #check if it is done with the timer
  20. #when it is done, destroy the splash screen and load the main screen.
  21. print("loading file window...")
  22. from FileSelectWindow import FileSelectWindow
  23. print("Done!")
  24. # ~ splash.destroy()
  25. theWindow2 = FileSelectWindow()
  26. Gtk.main()
  27. return 0
  28. if __name__ == '__main__':
  29. multiprocessing.freeze_support() # this might be needed right after main starts...?
  30. import sys
  31. sys.exit(main(sys.argv))