Re: Tooltip ans Sound - 2nd posting
- To: mathgroup at smc.vnet.net
- Subject: [mg93400] Re: Tooltip ans Sound - 2nd posting
- From: dh <dh at metrohm.ch>
- Date: Thu, 6 Nov 2008 04:05:57 -0500 (EST)
- References: <gepb36$si1$1@smc.vnet.net> <gerqjb$res$1@smc.vnet.net>
Hallo David, I would like to understand your solution. Why is EmitSound evaluated? I (probably wrongly) thought that Dynamic[..] is reevaluated only if the argument changes, not on every display. Daniel David Bailey wrote: > axel wrote: >> Hello, >> >> I have found that Tooltip[obj1, obj2] evaluates obj2 upon a mouseover >> event on obj1. The objects can either be Text or Graphics, all >> combinations work. Here is my question: can I use a Sound as obj2? I >> want to hear a specific sound when my mouse enters the notebook area >> occupied by obj1. >> >> Thank you >> >> Axel >> >> PS: using Tooltip[obj1, Play[...]] works but is not useful because one >> cannot reach the play-button. Also, I want to hear the sound upon the >> mouseover event, without the need of further action. >> > > I don't think obj2 is evaluated at the point of mouseover, but that > would not stop obj2 being a graphics object. To get an immediate sound > (as opposed to a widget that can play a sound) you need EmitSound, which > needs to execute when it is displayed, which you can get using Dynamic: > > Tooltip[fred, > Dynamic[EmitSound[ > Sound[{SoundNote["c5", 0.3], SoundNote["g4", 0.3]}]]; ""]] > > David Bailey > http://www.dbaileyconsultancy.co.uk > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>