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.

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 1188

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 Im 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...
0
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=()=>{
0
tracyyun
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...
2
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...
4
NeoPa
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 :...
1
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...
3
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...
0
isladogs
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...
4
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...
3
SueHopson
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.