running demos with enter key
This commit is contained in:
parent
4408423c9f
commit
fd69c8b34a
samples/python2
@ -1,9 +1,10 @@
|
|||||||
'''
|
'''
|
||||||
Coherence-enhancing filtering example
|
Coherence-enhancing filtering example
|
||||||
|
=====================================
|
||||||
|
|
||||||
inspired by
|
inspired by
|
||||||
Joachim Weickert "Coherence-Enhancing Shock Filters"
|
Joachim Weickert "Coherence-Enhancing Shock Filters"
|
||||||
http://www.mia.uni-saarland.de/Publications/weickert-dagm03.pdf
|
http://www.mia.uni-saarland.de/Publications/weickert-dagm03.pdf
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -72,6 +72,7 @@ class App:
|
|||||||
demos_lb.bind('<<ListboxSelect>>', self.on_demo_select)
|
demos_lb.bind('<<ListboxSelect>>', self.on_demo_select)
|
||||||
|
|
||||||
self.cmd_entry = cmd_entry = tk.Entry(right)
|
self.cmd_entry = cmd_entry = tk.Entry(right)
|
||||||
|
cmd_entry.bind('<Return>', self.on_run)
|
||||||
run_btn = tk.Button(right, command=self.on_run, text='Run', width=8)
|
run_btn = tk.Button(right, command=self.on_run, text='Run', width=8)
|
||||||
|
|
||||||
self.text = text = ScrolledText(right, font=('arial', 12, 'normal'), width = 30, wrap='word')
|
self.text = text = ScrolledText(right, font=('arial', 12, 'normal'), width = 30, wrap='word')
|
||||||
@ -137,7 +138,7 @@ class App:
|
|||||||
else:
|
else:
|
||||||
text.tag_add(tag_proc, match_index, end_index)
|
text.tag_add(tag_proc, match_index, end_index)
|
||||||
|
|
||||||
def on_run(self):
|
def on_run(self, *args):
|
||||||
cmd = self.cmd_entry.get()
|
cmd = self.cmd_entry.get()
|
||||||
print 'running:', cmd
|
print 'running:', cmd
|
||||||
Popen(cmd, shell=True)
|
Popen(cmd, shell=True)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'''
|
'''
|
||||||
Multiscale Turing Patterns generator.
|
Multiscale Turing Patterns generator
|
||||||
=====================================
|
====================================
|
||||||
|
|
||||||
Inspired by http://www.jonathanmccabe.com/Cyclic_Symmetric_Multi-Scale_Turing_Patterns.pdf
|
Inspired by http://www.jonathanmccabe.com/Cyclic_Symmetric_Multi-Scale_Turing_Patterns.pdf
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user