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

createGenericButton ?

Author Message
schapht



Joined: 21 May 2005
Posts: 5

Posted: Mon May 23, 2005 - 9:56 am    Post subject: createGenericButton ? Reply with quote

Has anyone had any luck using Apple's "createGenericButton" function to create the "Done" button on the flip-side of a widget. I did my "done" button by hand, but I dislike re-inventing the wheel if I can avoid it.

Apple's World Time widget uses the function on line 77 of WorldClock.html. The function is included from:

/System/Library/WidgetResources/button/genericButton.js

Anyone had any luck using it?
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
sean



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

Posted: Mon May 23, 2005 - 10:14 am    Post subject: Reply with quote

I just grabbing a pre-made image from one of the sample widgets included with the dev tools, but at one point I did try a genericButton. The closest I got was a button with the middle not in line with the two sides. A little css work might have fixed it, but I already had a done button so I didn't care... I would like to switch over to it one of these days, so my widget automatically fits in when/if apple decides to change the generic button look.

Try it out and let me know how it goes.
View user's profile Send private message Send e-mail Visit poster's website Widgets
kingmob



Joined: 07 May 2005
Posts: 68
Location: Vienna

Posted: Mon May 23, 2005 - 10:21 am    Post subject: Reply with quote

I'm using the Apple button in my widgets, and it's working pretty well. Here's the code I use:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript" src="file:///System/Library/WidgetResources/button/genericButton.js" charset="utf-8" />

...

<div id="done"></div>
<script>
var doneButton = document.getElementById('done');
createGenericButton(doneButton, "Done", hidePrefs);
</script>


that's about it. for the css, I just have these lines:
Code:
#done {
        position: fixed;
        bottom: 53px;
        right: 33px;
}


It's just a fixed positioning, really, nothing else.
_________________
I have no .sig and I must post.
View user's profile Send private message Send e-mail Visit poster's website AIM Address ICQ NumberWidgets
Mayhem



Joined: 18 May 2005
Posts: 63
Location: Stockholm, Sweden

Posted: Mon May 23, 2005 - 12:29 pm    Post subject: Reply with quote

sean wrote:
I just grabbing a pre-made image from one of the sample widgets included with the dev tools, but at one point I did try a genericButton. The closest I got was a button with the middle not in line with the two sides. A little css work might have fixed it, but I already had a done button so I didn't care... I would like to switch over to it one of these days, so my widget automatically fits in when/if apple decides to change the generic button look.

Sounds like you had set positioning to absolute/fixed for all div elements, which would causes the buttons to sort of implode. If so position any div elements inside the button statically and it should look as intended.
_________________
Give me one more medicated peaceful moment
View user's profile Send private message Send e-mail Visit poster's website MSN MessengerWidgets
Yousuf



Joined: 27 Jan 2005
Posts: 3
Location: Jeddah, Saudi Arabia

Posted: Tue Jun 14, 2005 - 1:56 am    Post subject: Reply with quote

Thank you man Flowers

This matter messed my brain for a week.

Thank you
Yousuf
View user's profile Send private message Send e-mail AIM Address Widgets
sean



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

Posted: Wed Jul 20, 2005 - 12:57 am    Post subject: Reply with quote

This post is as much for myself (so I can come back to it when the problem happens again) as it is for anyone else that might be experiencing the same thing.

The bit of css that was screwing up my Done button was the "vertical-align: middle;" in this:
Code:
img {
    border: none;
    vertical-align: middle;
}

which was on the stylesheet that I copied from wikipedia.org.

Picky picky picky.
View user's profile Send private message Send e-mail Visit poster's website 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