Advertisement
gregwa

FCM155 - child.py

Feb 22nd, 2020
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.84 KB | None | 0 0
  1. #! /usr/bin/env python
  2. #  -*- coding: utf-8 -*-
  3. # ======================================================
  4. #     child.py
  5. #  ------------------------------------------------------
  6. # Created for Full Circle Magazine #155
  7. # Written by G.D. Walters
  8. # Copyright (c) 2020 by G.D. Walters
  9. # This source code is released under the MIT License
  10. # ======================================================
  11. # GUI module generated by PAGE version 5.0.2c
  12. #  in conjunction with Tcl version 8.6
  13. #    Feb 21, 2020 04:08:16 AM CST  platform: Linux
  14.  
  15. import sys
  16.  
  17. try:
  18.     import Tkinter as tk
  19. except ImportError:
  20.     import tkinter as tk
  21.  
  22. try:
  23.     import ttk
  24.     py3 = False
  25. except ImportError:
  26.     import tkinter.ttk as ttk
  27.     py3 = True
  28.  
  29. import child_support
  30.  
  31. def vp_start_gui():
  32.     '''Starting point when module is the main routine.'''
  33.     global val, w, root
  34.     root = tk.Tk()
  35.     child_support.set_Tk_var()
  36.     top = Toplevel1 (root)
  37.     child_support.init(root, top)
  38.     root.mainloop()
  39.  
  40. w = None
  41. def create_Toplevel1(rt, *args, **kwargs):
  42.     '''Starting point when module is imported by another module.
  43.       Correct form of call: 'create_Toplevel1(root, *args, **kwargs)' .'''
  44.     global w, w_win, root
  45.     #rt = root
  46.     root = rt
  47.     w = tk.Toplevel (root)
  48.     child_support.set_Tk_var()
  49.     top = Toplevel1 (w)
  50.     child_support.init(w, top, *args, **kwargs)
  51.     return (w, top)
  52.  
  53. def destroy_Toplevel1():
  54.     global w
  55.     w.destroy()
  56.     w = None
  57.  
  58. class Toplevel1:
  59.     def __init__(self, top=None):
  60.         '''This class configures and populates the toplevel window.
  61.           top is the toplevel containing window.'''
  62.         _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
  63.         _fgcolor = '#000000'  # X11 color: 'black'
  64.         _compcolor = '#d9d9d9' # X11 color: 'gray85'
  65.         _ana1color = '#d9d9d9' # X11 color: 'gray85'
  66.         _ana2color = '#ececec' # Closest X11 color: 'gray92'
  67.         font17 = "-family {DejaVu Sans} -size 12 -weight bold -slant "  \
  68.             "italic"
  69.  
  70.         top.geometry("278x365+1181+365")
  71.         top.minsize(1, 1)
  72.         top.maxsize(1905, 1050)
  73.         top.resizable(1, 1)
  74.         top.title("I am the child")
  75.         top.configure(highlightcolor="black")
  76.  
  77.         self.btnExit = tk.Button(top)
  78.         self.btnExit.place(x=90, y=20,  height=29, width=109)
  79.         self.btnExit.configure(activebackground="#f9f9f9")
  80.         self.btnExit.configure(command=child_support.on_btnExit)
  81.         self.btnExit.configure(text='''Exit''')
  82.  
  83.         self.Frame1 = tk.Frame(top)
  84.         self.Frame1.place(x=20, y=137, height=215, width=245)
  85.         self.Frame1.configure(relief='groove')
  86.         self.Frame1.configure(borderwidth="2")
  87.         self.Frame1.configure(relief="groove")
  88.  
  89.         self.btn7 = tk.Button(self.Frame1)
  90.         self.btn7.place(x=10, y=10,  height=45, width=45)
  91.         self.btn7.configure(activebackground="#f9f9f9")
  92.         self.btn7.configure(font=font17)
  93.         self.btn7.configure(text='''7''')
  94.  
  95.         self.btn8 = tk.Button(self.Frame1)
  96.         self.btn8.place(x=60, y=10,  height=45, width=45)
  97.         self.btn8.configure(activebackground="#f9f9f9")
  98.         self.btn8.configure(font=font17)
  99.         self.btn8.configure(text='''8''')
  100.  
  101.         self.btn9 = tk.Button(self.Frame1)
  102.         self.btn9.place(x=110, y=10,  height=45, width=45)
  103.         self.btn9.configure(activebackground="#f9f9f9")
  104.         self.btn9.configure(font=font17)
  105.         self.btn9.configure(text='''9''')
  106.  
  107.         self.btn4 = tk.Button(self.Frame1)
  108.         self.btn4.place(x=10, y=60,  height=45, width=45)
  109.         self.btn4.configure(activebackground="#f9f9f9")
  110.         self.btn4.configure(font=font17)
  111.         self.btn4.configure(text='''4''')
  112.  
  113.         self.btn5 = tk.Button(self.Frame1)
  114.         self.btn5.place(x=60, y=60,  height=45, width=45)
  115.         self.btn5.configure(activebackground="#f9f9f9")
  116.         self.btn5.configure(font=font17)
  117.         self.btn5.configure(text='''5''')
  118.  
  119.         self.btn6 = tk.Button(self.Frame1)
  120.         self.btn6.place(x=110, y=60,  height=45, width=45)
  121.         self.btn6.configure(activebackground="#f9f9f9")
  122.         self.btn6.configure(font=font17)
  123.         self.btn6.configure(text='''6''')
  124.  
  125.         self.btn1 = tk.Button(self.Frame1)
  126.         self.btn1.place(x=10, y=110,  height=45, width=45)
  127.         self.btn1.configure(activebackground="#f9f9f9")
  128.         self.btn1.configure(font=font17)
  129.         self.btn1.configure(text='''1''')
  130.  
  131.         self.btn2 = tk.Button(self.Frame1)
  132.         self.btn2.place(x=60, y=110,  height=45, width=45)
  133.         self.btn2.configure(activebackground="#f9f9f9")
  134.         self.btn2.configure(font=font17)
  135.         self.btn2.configure(text='''2''')
  136.  
  137.         self.btn3 = tk.Button(self.Frame1)
  138.         self.btn3.place(x=110, y=110,  height=45, width=45)
  139.         self.btn3.configure(activebackground="#f9f9f9")
  140.         self.btn3.configure(font=font17)
  141.         self.btn3.configure(text='''3''')
  142.  
  143.         self.btn0 = tk.Button(self.Frame1)
  144.         self.btn0.place(x=10, y=160,  height=45, width=95)
  145.         self.btn0.configure(activebackground="#f9f9f9")
  146.         self.btn0.configure(font=font17)
  147.         self.btn0.configure(text='''0''')
  148.  
  149.         self.btnDot = tk.Button(self.Frame1)
  150.         self.btnDot.place(x=110, y=160,  height=45, width=45)
  151.         self.btnDot.configure(activebackground="#f9f9f9")
  152.         self.btnDot.configure(font=font17)
  153.         self.btnDot.configure(text='''.''')
  154.  
  155.         self.btnEnter = tk.Button(self.Frame1)
  156.         self.btnEnter.place(x=160, y=110,  height=94, width=79)
  157.         self.btnEnter.configure(activebackground="#f9f9f9")
  158.         self.btnEnter.configure(command=child_support.on_btnEnter)
  159.         self.btnEnter.configure(font=font17)
  160.         self.btnEnter.configure(text='''Enter''')
  161.  
  162.         self.btnClear = tk.Button(self.Frame1)
  163.         self.btnClear.place(x=160, y=10,  height=45, width=79)
  164.         self.btnClear.configure(activebackground="#f9f9f9")
  165.         self.btnClear.configure(command=child_support.on_btnClear)
  166.         self.btnClear.configure(font=font17)
  167.         self.btnClear.configure(text='''Clear''')
  168.  
  169.         self.btnBackSpace = tk.Button(self.Frame1)
  170.         self.btnBackSpace.place(x=160, y=60,  height=45, width=79)
  171.         self.btnBackSpace.configure(activebackground="#f9f9f9")
  172.         self.btnBackSpace.configure(command=child_support.on_btnBackspace)
  173.         self.btnBackSpace.configure(font=font17)
  174.         self.btnBackSpace.configure(text='''Bksp''')
  175.  
  176.         self.Label1 = tk.Label(top)
  177.         self.Label1.place(x=18, y=89,  height=49, width=246)
  178.         self.Label1.configure(activebackground="#f9f9f9")
  179.         self.Label1.configure(borderwidth="2")
  180.         self.Label1.configure(relief="ridge")
  181.         self.Label1.configure(text='''Label''')
  182.         self.Label1.configure(textvariable=child_support.DisplayLabel)
  183.  
  184. if __name__ == '__main__':
  185.     vp_start_gui()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement