use ttk as default theme
This commit is contained in:
39
scomm.json
39
scomm.json
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"Frame":{
|
||||
"name":"frame-root",
|
||||
"text":" ",
|
||||
"column": 1,
|
||||
"row": 1,
|
||||
"weight": 1,
|
||||
"Button":[
|
||||
{
|
||||
"name":"btn-scan",
|
||||
@@ -77,6 +83,13 @@
|
||||
"row": 5
|
||||
}
|
||||
],
|
||||
"Combobox":{
|
||||
"name":"cbbox-com",
|
||||
"width":20,
|
||||
"column": 2,
|
||||
"columnspan": 2,
|
||||
"row": 1
|
||||
},
|
||||
"Checkbutton":[
|
||||
{
|
||||
"name":"ckbtn-rhex",
|
||||
@@ -122,38 +135,26 @@
|
||||
}
|
||||
],
|
||||
"Entry": [
|
||||
{
|
||||
"name":"entry-com",
|
||||
"bg":"gold",
|
||||
"width":20,
|
||||
"column": 2,
|
||||
"columnspan": 2,
|
||||
"row": 1
|
||||
},
|
||||
{
|
||||
"name":"entry-baud",
|
||||
"bg":"gold",
|
||||
"width":10,
|
||||
"column": 4,
|
||||
"row": 1
|
||||
},
|
||||
{
|
||||
"name":"entry-split",
|
||||
"bg":"gold",
|
||||
"width":10,
|
||||
"column": 6,
|
||||
"row": 3
|
||||
},
|
||||
{
|
||||
"name":"entry-cycle",
|
||||
"bg":"gold",
|
||||
"width":10,
|
||||
"column": 6,
|
||||
"row": 4
|
||||
},
|
||||
{
|
||||
"name":"entry-sendText",
|
||||
"bg":"gold",
|
||||
"column": 1,
|
||||
"columnspan": 9,
|
||||
"row": 6
|
||||
@@ -248,4 +249,18 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Separator":{
|
||||
"name":"sepline",
|
||||
"column": 1,
|
||||
"row": 2
|
||||
},
|
||||
"Label":[
|
||||
{
|
||||
"name":"label-status",
|
||||
"text":"scomm",
|
||||
"column": 1,
|
||||
"row": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
scomm.py
6
scomm.py
@@ -14,10 +14,7 @@ def open_wm_data(root,btn):
|
||||
if _cfg:
|
||||
root.entry('entry-dfile').set(_cfg.get('title', btn))
|
||||
root.get('text-dsetting').insert('end', _cfg.get('value'))
|
||||
if _cfg.get('hex'):
|
||||
root.get('ckbtn-dhex').select()
|
||||
else:
|
||||
root.get('ckbtn-dhex').deselect()
|
||||
root.checkbox('ckbtn-dhex').set(_cfg.get('hex') and 1 or 0)
|
||||
root.button('btn-dsave', cmd=_save_dfile, focus=True)
|
||||
def open_wm_pack(root,btn):
|
||||
print('debug: toplevel=%s'%btn)
|
||||
@@ -67,4 +64,5 @@ if __name__ == '__main__':
|
||||
except:
|
||||
pass
|
||||
|
||||
root.configure(background='#e8e8e8')
|
||||
root.mainloop()
|
||||
|
||||
@@ -145,11 +145,11 @@ class TkJson(tkinter.Tk):
|
||||
|
||||
try:
|
||||
widget_factory = getattr(
|
||||
tkinter, name) if self.prefer_tk else getattr(ttk, name)
|
||||
ttk, name) if self.prefer_tk else getattr(tkinter, name)
|
||||
except AttributeError:
|
||||
try:
|
||||
widget_factory = getattr(
|
||||
ttk, name) if self.prefer_tk else getattr(tkinter, name)
|
||||
tkinter, name) if self.prefer_tk else getattr(ttk, name)
|
||||
except AttributeError:
|
||||
traceback.print_exc()
|
||||
raise AttributeError(
|
||||
|
||||
Reference in New Issue
Block a user