Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

Widget closes almost instantly

Author Message
Lemieux66



Joined: 24 Apr 2005
Posts: 3

Posted: Sun Apr 24, 2005 - 4:14 pm    Post subject: Widget closes almost instantly Reply with quote

I've tried to create a basic widget that puts a picture on the dashboard and when clicked on it plays a sound via a simple javascript. It runs fine in Safari but when I load it into Dashboard it appears on the dashboard for 1-2 seconds and then closes. Anyone have any idea what is going on here?

I know it's a bit of a stupid widget but for me it's purpose is little more than a more complicated hello world.

Thanks for your help!
View user's profile Send private message Send e-mail Widgets
Lutz



Joined: 18 Apr 2005
Posts: 19
Location: Sweden

Posted: Sun Apr 24, 2005 - 4:55 pm    Post subject: Re: Widget closes almost instantly Reply with quote

Lemieux66 wrote:
I've tried to create a basic widget that puts a picture on the dashboard and when clicked on it plays a sound via a simple javascript. It runs fine in Safari but when I load it into Dashboard it appears on the dashboard for 1-2 seconds and then closes. Anyone have any idea what is going on here?

I know it's a bit of a stupid widget but for me it's purpose is little more than a more complicated hello world.

Thanks for your help!


you have made something wrong Razz, take the apple widget that does nothing other than appear in dashboard and base your widget on it.
View user's profile Send private message Send e-mail Visit poster's website AIM Address ICQ NumberWidgets
Lemieux66



Joined: 24 Apr 2005
Posts: 3

Posted: Sun Apr 24, 2005 - 5:34 pm    Post subject: Re: Widget closes almost instantly Reply with quote

Lutz wrote:
Lemieux66 wrote:
I've tried to create a basic widget that puts a picture on the dashboard and when clicked on it plays a sound via a simple javascript. It runs fine in Safari but when I load it into Dashboard it appears on the dashboard for 1-2 seconds and then closes. Anyone have any idea what is going on here?

I know it's a bit of a stupid widget but for me it's purpose is little more than a more complicated hello world.

Thanks for your help!


you have made something wrong Razz, take the apple widget that does nothing other than appear in dashboard and base your widget on it.


Well now the graphic displays but when i click on it the sound doesnt play.

I use the following code:
Code:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css" title="AppleStyle">@import "PennyArcade.css";</style>
<script type='text/javascript' src='PennyArcade.js' charset='utf-8'/>
</head>
<body leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<body leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">

<embed src="TimAllen.wav" autostart=false hidden=true id="sound1" enablejavascript="true">
<a href="#" onClick="EvalSound('sound1')"><img src="TimAllen.png"></A>
</body>
</html>


and inside of PennyArcade.js I have:
Code:
function EvalSound(soundobj) {
  var thissound=document.getElementById(soundobj);
  thissound.Play();
}


If I open that in Safari it plays on the click, but on the dashboard it does not play, it just shows the image. Any suggestions?
View user's profile Send private message Send e-mail Widgets
Chris



Joined: 27 Jan 2005
Posts: 344
Location: Durham, UK

Posted: Mon Apr 25, 2005 - 2:14 am    Post subject: Reply with quote

Look at the docs on what to put in your Info.plist. The quicktime plugin wont work by default, since you need to allow internet plugins.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
Lemieux66



Joined: 24 Apr 2005
Posts: 3

Posted: Mon Apr 25, 2005 - 12:09 pm    Post subject: Reply with quote

Chris wrote:
Look at the docs on what to put in your Info.plist. The quicktime plugin wont work by default, since you need to allow internet plugins.


I told it to allow Java, am I missing something specifically for quicktime? I've looked in plists for quicktime players and didnt see anything. Here's my plist

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>AllowSystem</key>
   <true/>
   <key>AllowJava</key>
   <true/>
   <key>AllowMultipleInstances</key>
   <true/>
   <key>AllowNetworkAccess</key>
   <true/>
   <key>AllowFileAccessOutsideOfWidget</key>
   <true/>
   <key>CFBundleDisplayName</key>
   <string>PennyArcade</string>
   <key>CFBundleIdentifier</key>
   <string>com.apple.widget.pennyarcade</string>
   <key>CFBundleName</key>
   <string>PennyArcade</string>
   <key>CFBundleShortVersionString</key>
   <string>1.0</string>
   <key>CFBundleVersion</key>
   <string>1.0</string>
   <key>CloseBoxInsetX</key>
   <integer>0</integer>
   <key>CloseBoxInsetY</key>
   <integer>0</integer>
   <key>Height</key>
   <integer>470</integer>
   <key>MainHTML</key>
   <string>PennyArcade.html</string>
   <key>Width</key>
   <integer>770</integer>
</dict>
</plist>


Also, I just used the PennyArcade framework to make sure it'd load.
View user's profile Send private message Send e-mail Widgets
sean



Joined: 22 Apr 2005
Posts: 67
Location: Duluth, MN

Posted: Mon Apr 25, 2005 - 1:17 pm    Post subject: Reply with quote

What about AllowInternetPlugins?
View user's profile Send private message Send e-mail Visit poster's website Widgets
Chris



Joined: 27 Jan 2005
Posts: 344
Location: Durham, UK

Posted: Mon Apr 25, 2005 - 1:34 pm    Post subject: Reply with quote

sean wrote:
What about AllowInternetPlugins?


Yeah, I thought the clue in my reply was quite obvious. Apparently not Smile

Chris wrote:
The quicktime plugin wont work by default, since you need to allow internet plugins.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group