Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../lib64/python2..../Demo/tix
File: grid.py
###
[0] Fix | Delete
import Tix as tk
[1] Fix | Delete
from pprint import pprint
[2] Fix | Delete
[3] Fix | Delete
r= tk.Tk()
[4] Fix | Delete
r.title("test")
[5] Fix | Delete
[6] Fix | Delete
l=tk.Label(r, name="a_label")
[7] Fix | Delete
l.pack()
[8] Fix | Delete
[9] Fix | Delete
class MyGrid(tk.Grid):
[10] Fix | Delete
def __init__(self, *args, **kwargs):
[11] Fix | Delete
kwargs['editnotify']= self.editnotify
[12] Fix | Delete
tk.Grid.__init__(self, *args, **kwargs)
[13] Fix | Delete
def editnotify(self, x, y):
[14] Fix | Delete
return True
[15] Fix | Delete
[16] Fix | Delete
g = MyGrid(r, name="a_grid",
[17] Fix | Delete
selectunit="cell")
[18] Fix | Delete
g.pack(fill=tk.BOTH)
[19] Fix | Delete
for x in xrange(5):
[20] Fix | Delete
for y in xrange(5):
[21] Fix | Delete
g.set(x,y,text=str((x,y)))
[22] Fix | Delete
[23] Fix | Delete
c = tk.Button(r, text="Close", command=r.destroy)
[24] Fix | Delete
c.pack()
[25] Fix | Delete
[26] Fix | Delete
tk.mainloop()
[27] Fix | Delete
[28] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function