#!/usr/bin/python
from Tkinter import *
import csoundroutines as cs
root = Tk()
global canv
xx = {}
def makeFrame(root):
global canv
test = cs.csdInstrumentlist3('bay-at-night.csd')
canv = Canvas (root, height = 200, width = 350)
for i in range (0, len(test.instr_number)):
canv.create_text(10, i *10, text=str(test.instr_number[i]) +
'...', tags=('movable'))
xx[i] = canv.tag_bind('movable', '<B1-Motion>', slide) #B1-motion
is a drag with left button down
canv.pack()
def slide (event):
'''
triggered when something is dragged on the canvas - move thing
under
mouse ('current') to new position
'''
newx = event.x
if event.y < 10 and event.y > 0:
newy = event.y
canv.coords('current', newx, newy)
makeFrame(root)
root.mainloop()
#!/usr/bin/python
from Tkinter import *
#import csoundroutines as cs
root = Tk()
global canv
xx = {}
def makeFrame(root):
global canv
# test = cs.csdInstrumentlist3('bay-at-night.csd')
canv = Canvas (root, height = 200, width = 350)
# for i in range (0, len(test.instr_number)):
for i in range (0, 4):
# canv.create_text(10, i *10, text=str(test.instr_number[i]) +
canv.create_text(10, i *10, text=str(i) +
'...', tags=('movable'))
xx[i] = canv.tag_bind('movable', '<B1-Motion>', slide) #B1-motion
is a drag with left button down
canv.pack()
def slide (event):
'''
triggered when something is dragged on the canvas - move thing
under
mouse ('current') to new position
'''
if 0 < event.x < 200:
newx = event.x
else: newx = canv.coords('current')[0]
if 0 < event.y < 100:
newy = event.y
else: newy = canv.coords('current')[1]
canv.coords('current', newx, newy)
makeFrame(root)
root.mainloop()
sorry to take so long to reply... You should be able to find the
latest version of csound routines in the csound blog.. an older
version is in dex tracker available on source forge..
haven't tried this yet but I look foward to trying it out..