#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# Support module generated by PAGE version 7m
#  in conjunction with Tcl version 8.6
#    Aug 09, 2021 07:04:51 AM PDT  platform: Linux

import sys
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.constants import *

import one

def main(*args):
    '''Main entry point for the application.'''
    global root
    root = tk.Tk()
    root.protocol( 'WM_DELETE_WINDOW' , root.destroy)
    # Creates a toplevel widget.
    global _top44, _w44
    _top44 = root
    _w44 = one.Toplevel1(_top44)
    init(_top44, _w44)
    root.mainloop()

def init(top, gui, *args, **kwargs):
    global w, top_level, root
    w = gui
    top_level = top
    root = top
    w.TProgressbar1.place_forget()

import time
def advance(*args):
    global prog_var
    bar_value = w.prog_var.get() / float(100)
    info = w.TProgressbar1.place_info()

    if info == {}:
        w.TProgressbar1.place(relx=0.333, rely=0.378, relwidth=0.333,
                              relheight=0.0, height=19)
        root.update()

    if bar_value < 1.0:
        bar_value += 0.2
        print (f'{bar_value = }')
        w.prog_var.set(int(bar_value*100))
        root.update()
    if bar_value >= 1.0:
        time.sleep(1)        # Wait one second and then kill the progress bar.
        w.TProgressbar1.place_forget()
        info = w.TProgressbar1.place_info()
        w.prog_var.set(int(0.0))

def quit(*args):
    sys.exit()

if __name__ == '__main__':
    one.start_up()




