#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 5.4
#  in conjunction with Tcl version 8.6
#    Aug 17, 2020 12:16:24 AM CST  platform: Linux

import sys

try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk

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

import newName_support

def newName_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = tk.Tk()
    top = Toplevel1 (root)
    newName_support.init(root, top)
    root.mainloop()

w = None
def create_Toplevel1(rt, *args, **kwargs):
    '''Starting point when module is imported by another module.
       Correct form of call: 'create_Toplevel1(root, *args, **kwargs)' .'''
    global w, w_win, root
    #rt = root
    root = rt
    w = tk.Toplevel (root)
    top = Toplevel1 (w)
    newName_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'

        top.geometry("500x500+641+306")
        top.minsize(1, 1)
        top.maxsize(3825, 1050)
        top.resizable(1, 1)
        top.title("Modificar nombre")
        top.configure(background="#556B2F")
        top.configure(highlightcolor="black")

        self.Label1 = tk.Label(top)
        self.Label1.place(relx=0.34, rely=0.14, height=21, width=171)
        self.Label1.configure(activebackground="#f9f9f9")
        self.Label1.configure(background="#556B2F")
        self.Label1.configure(foreground="#ffffff")
        self.Label1.configure(text='''Ingrese su nuevo nombre''')

        self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor)
        top.configure(menu = self.menubar)

        self.Text1 = tk.Text(top)
        self.Text1.place(relx=0.34, rely=0.38, relheight=0.068, relwidth=0.332)
        self.Text1.configure(background="white")
        self.Text1.configure(font="TkTextFont")
        self.Text1.configure(selectbackground="blue")
        self.Text1.configure(selectforeground="white")
        self.Text1.configure(wrap="word")

        def get_new_text():
            input = self.Text1.get("1.0", "end")
            print('new name set')
            print(input)
            global newName
            newName = input

        self.Button1 = tk.Button(top, command=get_new_text)
        self.Button1.place(relx=0.42, rely=0.62, height=31, width=80)
        self.Button1.configure(activebackground="#f9f9f9")
        self.Button1.configure(text='''Guardar''')
