From: Batox on
In my application I need to build a selectoin of items from a
tablelist. To this end, I display two tablelists next to each other.
The right one contains all possible items, the left one is initially
empty and is filled by double-clicking items in the right list. The
right-list items are inserted in the left list after the element which
was active last.

This works fine, with [$leftlist index active] I get the index of the
last active row, even if the right list has the focus. The problem is
that there is no visible indication where the item is going to be
inserted in the left list, if the right list has the focus.

The Windows XP file explorer for example displays the active direcory
in the left pane with a grey background when the focus switches to the
right pane. How can I implement such behaviour most easily?

I'm aware that I can catch "loosefocus" and "getfocus" events, and
manipulate the row background color, but is there maybe a built-in or
easier approach?
From: Csaba Nemethi on
Am 21.07.2010 13:44, schrieb Batox:
> In my application I need to build a selectoin of items from a
> tablelist. To this end, I display two tablelists next to each other.
> The right one contains all possible items, the left one is initially
> empty and is filled by double-clicking items in the right list. The
> right-list items are inserted in the left list after the element which
> was active last.
>
> This works fine, with [$leftlist index active] I get the index of the
> last active row, even if the right list has the focus. The problem is
> that there is no visible indication where the item is going to be
> inserted in the left list, if the right list has the focus.
>
> The Windows XP file explorer for example displays the active direcory
> in the left pane with a grey background when the focus switches to the
> right pane. How can I implement such behaviour most easily?
>
> I'm aware that I can catch "loosefocus" and "getfocus" events, and
> manipulate the row background color, but is there maybe a built-in or
> easier approach?

If you set -exportselection 0/false/no for your tablelist widgets then
the selection will remain set and visible in both widgets, regardless of
which one has the focus.

BTW: This is yet another "problem" common to listbox and tablelist
widgets, having the same simple solution.

--
Csaba Nemethi http://www.nemethi.de mailto:csaba.nemethi(a)t-online.de