diff options
author | Christos.K <freedomrfox@gmail.com> | 2017-09-11 20:45:19 +0300 |
---|---|---|
committer | Christos.K <freedomrfox@gmail.com> | 2017-09-11 20:45:19 +0300 |
commit | e2848028ea44e0251667f8274159c6467e3b48ae (patch) | |
tree | d70dfdcd668b0207f6d7610dbceb484dd993f8c1 | |
parent | gpy sub-dir functions (diff) | |
download | GSE-e2848028ea44e0251667f8274159c6467e3b48ae.tar.gz GSE-e2848028ea44e0251667f8274159c6467e3b48ae.tar.bz2 GSE-e2848028ea44e0251667f8274159c6467e3b48ae.zip |
gportal: gse gui menu
-rw-r--r-- | scripts/pyfunctions/gportal.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/scripts/pyfunctions/gportal.py b/scripts/pyfunctions/gportal.py new file mode 100644 index 0000000..9c5023b --- /dev/null +++ b/scripts/pyfunctions/gportal.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3.6 + +def _gmm(): + import tkinter + + def donothing(): + filewin = tkinter.Toplevel(portal) + button = tkinter.Button(filewin, text="Do nothing button") + button.pack() + + # Define portal as tkinter.Tk + portal = tkinter.Tk() + + # Title + portal.title("Portal Menu") + # Window Geometry + portal.geometry("1200x1024") + + # Define portal menu as portmen + portmen = tkinter.Menu(portal) + + def _portfile(): + # Create file tab + portfile = tkinter.Menu(portmen, tearoff=0) + # Label the tab as File + portmen.add_cascade(label="File", menu=portfile) + + # File's sub-menu + portfile.add_command(label="New", command=donothing) + portfile.add_command(label="Open", command=donothing) + portfile.add_command(label="Save", command=donothing) + portfile.add_command(label="Save as...", command=donothing) + portfile.add_command(label="Close", command=donothing) + portfile.add_separator() + portfile.add_command(label="Exit", command=portal.quit) + + return portfile + + + def _portedit(): + + # Create edit tab + portedit = tkinter.Menu(portmen, tearoff=0) + # Label the tab as edit + portmen.add_cascade(label="Edit", menu=portedit) + + portedit.add_command(label="Undo", command=donothing) + portedit.add_separator() + + portedit.add_command(label="Cut", command=donothing) + portedit.add_command(label="Copy", command=donothing) + portedit.add_command(label="Paste", command=donothing) + portedit.add_command(label="Delete", command=donothing) + portedit.add_command(label="Select All", command=donothing) + + return portedit + + + def _porthelp(): + porthelp = tkinter.Menu(portmen, tearoff=0) + portmen.add_cascade(label="Help", menu=porthelp) + + porthelp.add_command(label="Help Index", command=donothing) + porthelp.add_command(label="About...", command=donothing) + + return porthelp + + portfile = _portfile() + portedit = _portedit() + porthelp = _porthelp() + + portal.config(menu=portmen) + portal.mainloop() + + return 0 + + |