aif-ng_configgen/aif_gen/config/generator/subsections/meta.py
2019-11-04 03:53:39 -05:00

41 lines
1.6 KiB
Python

import tkinter
##
import aif_gen.config.generator.utils as utils
class Obj(object):
def __init__(self, xmlroot, tkroot):
self.defaults = {'version': '0.2.0'}
self.xml = xmlroot
self.root = tkroot
self.frame = tkinter.LabelFrame(self.root, text = 'META',
bd = 1, relief = tkinter.RAISED,
font = ('Arial Bold', 15))
# self.frame.grid(column = 0, row = 0)
self.frame.pack(side = 'top', fill = 'both', expand = True)
# TODO: Currently displays if ANY nested elements hover over. We don't want that. Eff it, fix later.
# utils.CreateToolTip(self.frame, 'This section controls information about AIF-NG itself.')
self.version()
def version(self):
# Subsection header
frame = tkinter.LabelFrame(self.frame, text = 'VERSION',
bd = 1, relief = tkinter.RAISED,
font = ('Arial Bold', 12))
# frame.grid(column = 0, row = 0)
frame.pack(side = 'top', fill = 'both', expand = True)
# Version entry
self.ver = tkinter.Entry(frame)
utils.CreateToolTip(self.ver, 'Must be a valid git reference (branch, tag, commit ID, etc.)')
self.ver.insert(0, self.defaults['version'])
self.ver.pack(side = 'top', fill = 'both', expand = True)
return()
def new(self):
self.ver.delete(0, tkinter.END)
return()
def save(self):
self.xml.attrib['version'] = self.ver.get()
return()