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 Design

How to add a separator to a widget menu?

Author Message
neoWave



Joined: 18 Sep 2005
Posts: 9
Location: Netherlands

Posted: Sun Mar 12, 2006 - 8:14 am    Post subject: How to add a separator to a widget menu? Reply with quote

Hey,

I'm making a search widget that has a pop-up menu where you can select the search engine of your choice.

I was wondering if it's possible to add "real" separators to that menu like the ones found throughout Mac OS X.

Basically I want it to look like this:
Search Engine A
Search Engine B
Search Engine C
Search Engine D
-------------
Search All

Pic of the separators used in Mac OS X, and the ones I would like to implement in my widget's pop-up menu.



Thanks in advance.
View user's profile Send private message Send e-mail Widgets
daylate



Joined: 19 Jun 2005
Posts: 18

Posted: Tue Mar 14, 2006 - 2:01 am    Post subject: Reply with quote

According to this list of fixes for WebKit:

http://webkit.opendarwin.org/blog/?p=32

Quote:
Menu separator support: an <hr> inside a <select> with size 1 will now add a horizontal separator in the menu.


This works for me:
Code:
<select>
  <option>Search Engine A</option>
  <option>Search Engine B</option>
  <hr />
  <option>Search All</option>
</select>


Note that you can add a separator dynamically in the same way you add "option" elements dynamically (although I'm too lazy to look that up right now).
View user's profile Send private message Visit poster's website Widgets
neoWave



Joined: 18 Sep 2005
Posts: 9
Location: Netherlands

Posted: Tue Mar 14, 2006 - 7:06 am    Post subject: Reply with quote

Thanks man, worked like a charm!
View user's profile Send private message Send e-mail Widgets
robotspacer



Joined: 09 Jun 2005
Posts: 21
Location: United States

Posted: Fri Sep 08, 2006 - 12:29 am    Post subject: Reply with quote

Ooh, very nice!

Just wanted to note that the <optgroup> tag may be of use as well. See here for usage: http://www.htmlhelp.com/reference/html40/forms/optgroup.html (I believe the label attribute is ignored however.)
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