472,989 Members | 2,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 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.


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

root = Tk()
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)


Error Msg:
Traceback (most recent call last):
File "D:\ROGER\Python\tkinter\scrollcanvas3.py", line 16, in
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

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:



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)

Jun 6 '07 #1
0 1188

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

Similar topics

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...
by: Carlos P. | last post by:
Hi! I want to call tcl from python and python from tcl. The big picture is that Im writing an application GUI with tcl/tk and application logic with python, so at least I want to call python...
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...
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...
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...
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...
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...
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.
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...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.