473,385 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

tkSnack and Pmw Scrollcanvas

Thanks in advance,
Hi, I am trying to put tkSnack's Minwave.py demo into Pmw
Scrollcanvas, without success.
I have included the sample, the error message and the documentation
tkSnack says should work.

Can someone tell me what I am doing wrong? and If someone has some
sample code it would be greatly appreciated.

Roger

============ Code Here ===========
from Tkinter import *
import tkSnack
import Pmw

root = Tk()
Pmw.initialise()
tkSnack.initializeSnack(root)
sc = Pmw.ScrolledCanvas(root, borderframe=0, labelpos=N,
label_text='ScrolledCanvas', usehullsize=1,
hull_width=40, hull_height=200)

s = tkSnack.Sound(load='r3.wav')

tkSnack.createWaveform(sc._canvas, sound=s, width=400)

sc.pack(padx = 5, pady = 5, fill = 'both', expand = 1)
sc.resizescrollregion()

root.mainloop()

=====================
Error Msg:
Traceback (most recent call last):
File "D:\ROGER\Python\tkinter\scrollcanvas3.py", line 16, in
<module>
tkSnack.createWaveform(sc._canvas, sound=s, width=400)
File "C:\Python25\lib\tkSnack.py", line 552, in createWaveform
return canvas._create('waveform', args, kw)
File "C:\Python25\lib\lib-tk\Tkinter.py", line 2138, in _create
cnf = args[-1]
IndexError: tuple index out of range

===========================
>From the tkSnack documentation:
Putting SnackCanvas items on regular Canvases
It's possible to draw these new canvas items onto any canvas in your
program, not just those that are instances of SnackCanvas. You might
need to do this if you're using elaborations or subclasses of Canvas
that have been written by other people, for example, if you want to
draw a waveform on a ScrolledCanvas from the Python Megawidget
collection.

To accomplish this, tkSnack provides module-level versions of
create_waveform , create_section, and create_spectrogram. Simply use
the non-Snack canvas as the first argument. Instead of:

NonSnackCanvas.create_waveform(sound=tada)

use:

tkSnack.createWaveform(NonSnackCanvas, sound=tada)

If you're using Pmw Scrolled Canvas, remember that you're drawing onto
the ScrolledCanvas's Canvas object. In that case, you'll need to do:

tkSnack.createWaveform(myScrolledCanvas._canvas, sound=tada)
Roger

Jun 6 '07 #1
0 1208

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dfenestr8 | last post by:
Hi. I'm no coder. I'm just a working guy who likes to tinker with computers in my spare time. That's my hobby. My passion is: playing instruments. Combining the two, I've made a couple of...
4
by: Carlos P. | last post by:
Hi! I want to call tcl from python and python from tcl. The big picture is that I´m writing an application GUI with tcl/tk and application logic with python, so at least I want to call python...
6
by: Todd Stephens | last post by:
Is there such a module containing audio tools? I am looking specifically for tools to manipulate ogg-vorbis and convert other formats (mp3, wav) to ogg. -- Todd Stephens ICQ# 3150790 "A...
1
by: jmdeschamps | last post by:
I'm trying to play programmed music by iteratively applying filter changes to a playing Sound object. It almost seem to work but i can't control duration of sounds??? Using tkSnack 2.2.4 for...
0
by: Justin Shaw | last post by:
I am using the tkSnack library to estimate the frequency from a sound file. The pitch seems to drop down an octave at 400 Hertz. For example A~440 Hertz comes out at 220 Hertz. When I use the...
0
by: didifouke | last post by:
Hi, I try to sample and playback speech using snack. My idea is to have a socket based server that plays back the sound and a client that samples the input from the sound card and sends it to...
2
by: dunderhead | last post by:
Hello, I would like to use tkSnack through python to manipulate sounds on my fedora 4 system, but I am unable to get the following basic script to run: #!/usr/bin/env python from Tkinter...
3
by: rino | last post by:
Hi Does anyone know how I can change the default dbl click in VS 2005 to open the source code and not the Resource editor thanks.
0
by: Karthik | last post by:
Hi, I want to record a sound wave from a mic and at the same time invert it and play the inverted wave.My code goes as follows, however nothing is written into the E:\inverted.wav file.Thanks in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.