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":[
|
"Button":[
|
||||||
{
|
{
|
||||||
"name":"btn-scan",
|
"name":"btn-scan",
|
||||||
@@ -77,6 +83,13 @@
|
|||||||
"row": 5
|
"row": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"Combobox":{
|
||||||
|
"name":"cbbox-com",
|
||||||
|
"width":20,
|
||||||
|
"column": 2,
|
||||||
|
"columnspan": 2,
|
||||||
|
"row": 1
|
||||||
|
},
|
||||||
"Checkbutton":[
|
"Checkbutton":[
|
||||||
{
|
{
|
||||||
"name":"ckbtn-rhex",
|
"name":"ckbtn-rhex",
|
||||||
@@ -122,38 +135,26 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Entry": [
|
"Entry": [
|
||||||
{
|
|
||||||
"name":"entry-com",
|
|
||||||
"bg":"gold",
|
|
||||||
"width":20,
|
|
||||||
"column": 2,
|
|
||||||
"columnspan": 2,
|
|
||||||
"row": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name":"entry-baud",
|
"name":"entry-baud",
|
||||||
"bg":"gold",
|
|
||||||
"width":10,
|
"width":10,
|
||||||
"column": 4,
|
"column": 4,
|
||||||
"row": 1
|
"row": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"entry-split",
|
"name":"entry-split",
|
||||||
"bg":"gold",
|
|
||||||
"width":10,
|
"width":10,
|
||||||
"column": 6,
|
"column": 6,
|
||||||
"row": 3
|
"row": 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"entry-cycle",
|
"name":"entry-cycle",
|
||||||
"bg":"gold",
|
|
||||||
"width":10,
|
"width":10,
|
||||||
"column": 6,
|
"column": 6,
|
||||||
"row": 4
|
"row": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"entry-sendText",
|
"name":"entry-sendText",
|
||||||
"bg":"gold",
|
|
||||||
"column": 1,
|
"column": 1,
|
||||||
"columnspan": 9,
|
"columnspan": 9,
|
||||||
"row": 6
|
"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:
|
if _cfg:
|
||||||
root.entry('entry-dfile').set(_cfg.get('title', btn))
|
root.entry('entry-dfile').set(_cfg.get('title', btn))
|
||||||
root.get('text-dsetting').insert('end', _cfg.get('value'))
|
root.get('text-dsetting').insert('end', _cfg.get('value'))
|
||||||
if _cfg.get('hex'):
|
root.checkbox('ckbtn-dhex').set(_cfg.get('hex') and 1 or 0)
|
||||||
root.get('ckbtn-dhex').select()
|
|
||||||
else:
|
|
||||||
root.get('ckbtn-dhex').deselect()
|
|
||||||
root.button('btn-dsave', cmd=_save_dfile, focus=True)
|
root.button('btn-dsave', cmd=_save_dfile, focus=True)
|
||||||
def open_wm_pack(root,btn):
|
def open_wm_pack(root,btn):
|
||||||
print('debug: toplevel=%s'%btn)
|
print('debug: toplevel=%s'%btn)
|
||||||
@@ -67,4 +64,5 @@ if __name__ == '__main__':
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
root.configure(background='#e8e8e8')
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|||||||
@@ -145,11 +145,11 @@ class TkJson(tkinter.Tk):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
widget_factory = getattr(
|
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:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
widget_factory = getattr(
|
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:
|
except AttributeError:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
|
|||||||
Reference in New Issue
Block a user