-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (29 loc) · 1.14 KB
/
main.py
File metadata and controls
34 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'''
main.py
Gurjas Dhillon
this program launches all the processes. it starts the three separate windows using a library called multiprocess
'''
# import libraries
import pygame
import multiprocessing
import queue
import os
# import local files
from screens.mainScreen import mainScreen
from screens.toolbar import toolbarScreen
from screens.stickersScreen import sticker
if __name__ == "__main__": # setup area for processes
# makes and starts all the processes of the different windows
toolbarScreenP = multiprocessing.Process(target=toolbarScreen) # toolbar processes
mainScreenP = multiprocessing.Process(target=mainScreen) # main canvas proccess
stickerP = multiprocessing.Process(target=sticker) # sticker menu process
mainScreenP.start()
toolbarScreenP.start()
stickerP.start()
# constantly checks if anyone of the windows has been closed and closes all windows and current program
while True:
if not mainScreenP.is_alive() or not toolbarScreenP.is_alive() or not stickerP.is_alive():
mainScreenP.terminate()
toolbarScreenP.terminate()
stickerP.terminate()
break