Advertisement
gregwa

FCM155 - Parent.py

Feb 22nd, 2020
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.18 KB | None | 0 0
  1. #! /usr/bin/env python
  2. #  -*- coding: utf-8 -*-
  3. # ======================================================
  4. #     parent.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:02:23 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 parent_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.     parent_support.set_Tk_var()
  36.     top = Toplevel1 (root)
  37.     parent_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.     parent_support.set_Tk_var()
  49.     top = Toplevel1 (w)
  50.     parent_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.  
  68.         top.geometry("600x242+252+315")
  69.         top.minsize(1, 1)
  70.         top.maxsize(1905, 1050)
  71.         top.resizable(1, 1)
  72.         top.title("I am Parent")
  73.         top.configure(highlightcolor="black")
  74.  
  75.         self.btnExit = tk.Button(top)
  76.         self.btnExit.place(x=480, y=20,  height=29, width=99)
  77.         self.btnExit.configure(activebackground="#f9f9f9")
  78.         self.btnExit.configure(command=parent_support.on_btnExit)
  79.         self.btnExit.configure(text='''Exit''')
  80.  
  81.         self.btnLaunch = tk.Button(top)
  82.         self.btnLaunch.place(x=40, y=20,  height=29, width=149)
  83.         self.btnLaunch.configure(activebackground="#f9f9f9")
  84.         self.btnLaunch.configure(command=parent_support.on_btnLaunch)
  85.         self.btnLaunch.configure(text='''Launch Child''')
  86.  
  87.         self.Frame1 = tk.Frame(top)
  88.         self.Frame1.place(x=10, y=100, height=135, width=585)
  89.         self.Frame1.configure(relief='groove')
  90.         self.Frame1.configure(borderwidth="2")
  91.         self.Frame1.configure(relief="groove")
  92.  
  93.         self.Label2 = tk.Label(self.Frame1)
  94.         self.Label2.place(x=40, y=40,  height=19, width=76)
  95.         self.Label2.configure(activebackground="#f9f9f9")
  96.         self.Label2.configure(anchor='e')
  97.         self.Label2.configure(text='''Status:''')
  98.  
  99.         self.Label3 = tk.Label(self.Frame1)
  100.         self.Label3.place(x=40, y=80,  height=19, width=76)
  101.         self.Label3.configure(activebackground="#f9f9f9")
  102.         self.Label3.configure(anchor='e')
  103.         self.Label3.configure(text='''Received:''')
  104.  
  105.         self.Label4 = tk.Label(self.Frame1)
  106.         self.Label4.place(x=120, y=76,  height=29, width=216)
  107.         self.Label4.configure(activebackground="#f9f9f9")
  108.         self.Label4.configure(borderwidth="2")
  109.         self.Label4.configure(relief="ridge")
  110.         self.Label4.configure(text='''Label''')
  111.         self.Label4.configure(textvariable=parent_support.DataReceived)
  112.  
  113.         self.Label5 = tk.Label(self.Frame1)
  114.         self.Label5.place(x=124, y=44,  height=15, width=15)
  115.         self.Label5.configure(activebackground="#f9f9f9")
  116.         self.Label5.configure(background="#ff0000")
  117.         self.Label5.configure(borderwidth="2")
  118.         self.Label5.configure(relief="groove")
  119.  
  120. if __name__ == '__main__':
  121.     vp_start_gui()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement