Thanks Ian for your quick reply
> On Mon, Jan 28, 2013 at 6:26 PM, Jason But <[email protected]> wrote:
>> 1) The program works fine ONLY if the applications executed in the terminal
>> widget do NOT require any keyboard input.
>>
>> 2) The two widgets above are in a Columns, if O use a "cols.focus_col = 1"
>> (giving focus to the terminal widget), then all of a sudden any applications
>> that require keyboard input start working as the terminal is the selected
>> widget. However, because the listbox has lost focus, the currently selected
>> item is no longer highlighted
>>
>> Any ideas on how I can achieve both?
>
> Don't use the focus_map AttrMap setting for the ListBox items. You
> could just put an AttrMap(task, 'active task) around the task that is
> active, maybe also add some text like an arrow or something to help
> people with trouble distinguishing colours. You can continue forcing
> the ListBox to change focus when the task changes (to keep the active
> task visible within the ListBox)
>
I am a little unsure of your suggestion here. At the moment my code looks like:
self.task_listbox = urwid.ListBox(urwid.SimpleListWalker(
[urwid.AttrWrap(urwid.Text(item), 'default', 'focus') for item in item_list]
))
Where 'default' and 'focus' are the two palette attributes and item_list is
a list of text information.
Are you suggesting I run AttrMap on the old selection and the new selection
each time the selection changes? If so, what would be the cleanest way to do
this, something like:
urwid.AttrMap(self.task_listbox.contents[0][item_no], ?????)
> You should also make the ListBox not selectable by wrapping it with a
> WidgetDisable() so that the user doesn't accidentally move focus away
> from the Terminal.
>
Good idea and thanks
Jason
> Ian
>
> _______________________________________________
> Urwid mailing list
> [email protected]
> http://lists.excess.org/mailman/listinfo/urwid
>
--
----------
Dr. Jason But
Program Co-Ordinator, Bachelor of ICT (Network Design and Security)
Telecommunications Engineering Academic Group
Faculty of Information and Communication Technologies
Swinburne University of Technology
Phone: +61 3 9214 4839
Email: [email protected]
www: http://caia.swin.edu.au
_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid