<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://tcl.activestate.com/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Thu Feb 09 08:16:51 GMT 2012 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='94'>
<header><title>Add Listbox -activestyle Option</title><author address="mailto:JeffH@ActiveState.com">Jeff Hobbs</author><status type='project' state='final' tclversion="8.4" vote='after'>$Revision: 1.5 $</status><history></history><created day='29' month='may' year='2002' /></header>
<abstract>This TIP proposes to add a [-activestyle] option to the [listbox] widget that would control what style the active element has when the widget has focus (currently hard-coded to be underlined).</abstract>
<body><section title="Rationale">
<para>Tk has always had an underline on the active item in listboxes, which is shown when the listbox has focus. However this in incompatible with the style of listboxes on Windows, especially as used in drop-down boxes. They instead have a thin dotted line to indicate the active item. In order to improve native look and feel, we would allow the user to request the style which indicates the active item.</para>
</section>
<section title="Specification">
<verbatim><vline encoding='base64'>ICAgICRsaXN0Ym94IGNvbmZpZ3VyZSAtYWN0aXZlc3R5bGUgbm9uZXx1bmRlcmxpbmV8ZG90Ym94</vline></verbatim>
<para>The default would be underline, which stays consistent with the current behavior. <emph style="italic">dotbox</emph> is the Windows style, which is essentially the dotted focus ring that any item with focus receives. While Windows does have a special API (<emph style="italic">DrawFocusRect</emph>) to draw this, it should be possible with the features of the dash patch to emulate on Unix. It may not be possible to draw a dotbox easily on MacOS, in which case the option will be allowed, but nothing would be drawn (rather than dropping back to underline).</para>
</section>
<section title="Reference Implementation">
<para>This implementation is simple and would only extend one check in <emph style="italic">DisplayListbox</emph> for whether the underline should be drawn.</para>
<para>File: <emph style="italic">tcl/generix/tkListbox.c</emph></para>
<para>Function: <emph style="italic">DisplayListbox</emph></para>
</section>
<section title="Copyright">
<para>This document has been placed in the public domain.</para>
</section>
</body></TIP>

