Example #1
0
'''This module contains the UI Layouts'''

import PySimpleGUI as sg
from PySimpleGUI.PySimpleGUI import Column

# my modules
import handle_config  # Programs Configuration
handle_config.init()

default_vert_padding = 3
default_horz_padding = 8
text_pad = 20

# screen_width, screen_height = sg.Window.get_screen_size()
screen_width, screen_height = 1280, 1024

# calculate row size
row_padding = default_vert_padding * 5
row_size = int((screen_height - row_padding) / 3)

# calculate col size
full_width = screen_width - (default_horz_padding * 2)
half_width = int((screen_width - (default_horz_padding * 3)) / 2)

img_width = full_width / 2
col_padding = default_horz_padding * 3
col_width = int((full_width - col_padding) / 4)
sm_col_width = int(col_width * 0.9)
bg_col_width = int(col_width * 1.3)

# view layouts
Example #2
0
'''This module handles the main threads'''

import threading  # threading

# my modules
import info_logger  # logger
info_logger.init()  # logger needs loaded
import handle_config  # module to handle config settings
handle_config.init()  # config settings need loaded

import layouts  # UI Layouts
import gui  # gui handler
import worker_thread  # main thread

if __name__ == '__main__':

    window = layouts.window  # UI Window
    threads = []  # array to hold threads

    # collect all threads
    threads.append(
        threading.Thread(target=worker_thread.main,
                         args=(window, ),
                         daemon=True))

    # start all threads
    for thread in threads:
        thread.start()

    # The function that builds the UI and listens for events
    gui.main(window)