#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.19
#  in conjunction with Tcl version 8.6
#    Dec 08, 2018 02:11:20 PM PKT  platform: Windows NT

import sys

try:
    import Tkinter as tk
    from PIL import Image, ImageTk
except ImportError:
    import tkinter as tk
    from PIL import Image, ImageTk

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True

import viewGraph_support

def on_closing():
    root.destroy()
    from searching import vp_start_gui
    vp_start_gui()

def vp_start_gui2():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = tk.Tk()
    top = Toplevel1 (root)
    viewGraph_support.init(root, top)
    root.protocol("WM_DELETE_WINDOW", on_closing)
    root.mainloop()

w = None
def create_Toplevel1(root, *args, **kwargs):
    '''Starting point when module is imported by another program.'''
    global w, w_win, rt
    rt = root
    w = tk.Toplevel (root)
    top = Toplevel1 (w)
    viewGraph_support.init(w, top, *args, **kwargs)
    return (w, top)

def destroy_Toplevel1():
    global w
    w.destroy()
    w = None


class Toplevel1:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9' # X11 color: 'gray85'
        _ana1color = '#d9d9d9' # X11 color: 'gray85' 
        _ana2color = '#ececec' # Closest X11 color: 'gray92' 
        font11 = "-family {Shonar Bangla} -size 21 -weight normal "  \
            "-slant roman -underline 0 -overstrike 0"
        font12 = "-family {Shonar Bangla} -size 20 -weight normal "  \
            "-slant roman -underline 0 -overstrike 0"
        font15 = "-family {Segoe UI} -size 30 -weight normal -slant "  \
            "roman -underline 0 -overstrike 0"
        font16 = "-family {Segoe UI} -size 30 -weight normal -slant "  \
            "roman -underline 1 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.',background=_bgcolor)
        self.style.configure('.',foreground=_fgcolor)
        self.style.configure('.',font="TkDefaultFont")
        self.style.map('.',background=
            [('selected', _compcolor), ('active',_ana2color)])

        top.geometry("443x258+650+150")
        top.title("View")
        top.configure(background="#d9d9d9")

        self.original = Image.open('EBAY.png')
        self.image = ImageTk.PhotoImage(self.original)
        self.Canvas1 = tk.Canvas(top)
        self.Canvas1.place(relx=0.023, rely=0.426, relheight=0.554
                , relwidth=0.955)
        self.Canvas1.configure(background="#d9d9d9")
        self.Canvas1.configure(borderwidth="2")
        self.Canvas1.configure(highlightbackground="#d9d9d9")
        self.Canvas1.configure(insertbackground="black")
        self.Canvas1.configure(relief='ridge')
        self.Canvas1.configure(selectbackground="#c4c4c4")
        self.Canvas1.configure(selectforeground="black")
        self.Canvas1.configure(width=423)
        self.Canvas1.create_image(0, 0, image=self.image, anchor='nw', tags="IMG")
        self.Canvas1.bind("<Configure>", self.resize)

        self.TLabel1 = ttk.Label(top)
        self.TLabel1.place(relx=0.045, rely=0.039, height=39, width=86)
        self.TLabel1.configure(background="#d9d9d9")
        self.TLabel1.configure(foreground="#000000")
        self.TLabel1.configure(font=font11)
        self.TLabel1.configure(relief='flat')
        stockName = "EBAY"
        assert isinstance(stockName, str)
        self.TLabel1.configure(text=stockName)
        self.TLabel1.configure(width=86)

        self.TLabel2 = ttk.Label(top)
        self.TLabel2.place(relx=0.045, rely=0.271, height=39, width=116)
        self.TLabel2.configure(background="#d9d9d9")
        self.TLabel2.configure(foreground="#000000")
        self.TLabel2.configure(font=font12)
        self.TLabel2.configure(relief='flat')
        compName = "EBAY"
        assert isinstance(compName, str)
        self.TLabel2.configure(text=compName)
        self.TLabel2.configure(width=116)

        self.TLabel3 = ttk.Label(top)
        self.TLabel3.place(relx=0.7, rely=0.039, height=59, width=26)
        self.TLabel3.configure(background="#d9d9d9")
        self.TLabel3.configure(foreground="#e82056")
        self.TLabel3.configure(font=font15)
        self.TLabel3.configure(relief='flat')
        self.TLabel3.configure(text='''''')
        self.TLabel3.configure(width=26)

        self.Label1 = tk.Label(top)
        self.Label1.place(relx=0.767, rely=0.078, height=40, width=80)
        self.Label1.configure(background="#d9d9d9")
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(font=font16)
        self.Label1.configure(foreground="#e82056")
        price = "0.04"
        assert isinstance(price, str)
        self.Label1.configure(text=price)
        self.Label1.configure(width=80)

    def resize(self, event):
        size = (event.width, event.height)
        resized = self.original.resize(size, Image.ANTIALIAS)
        self.image = ImageTk.PhotoImage(resized)
        self.Canvas1.delete("IMG")
        self.Canvas1.create_image(0, 0, image=self.image, anchor='nw', tags="IMG")






