[tekui-devel] tekui: When an item is added to a list, the selected state is no...

Timm S. Mueller tmueller at neoscientists.org
Thu May 15 00:08:23 CEST 2008


details:   http://hg.teklib.org/tekui/rev/f1b07726543b
changeset: 487:f1b07726543b
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sun May 11 11:45:16 2008 +0200
description:
When an item is added to a list, the selected state is now reset

diffs (39 lines):

diff -r 789b5952635d -r f1b07726543b bin/list.lua
--- a/bin/list.lua	Sun May 11 10:24:55 2008 +0200
+++ b/bin/list.lua	Sun May 11 11:45:16 2008 +0200
@@ -186,6 +186,7 @@ ui.Application:new
 												if entry then
 													self:addItem(entry, cl - 1)
 													self:setValue("CursorLine", math.max(1, cl - 1))
+													self:setValue("SelectLine", cl - 1)
 												end
 											end, ui.NOTIFY_VALUE
 										}
@@ -207,6 +208,7 @@ ui.Application:new
 												if entry then
 													self:addItem(entry, cl + 1)
 													self:setValue("CursorLine", cl + 1)
+													self:setValue("SelectLine", cl + 1)
 												end
 											end, ui.NOTIFY_VALUE
 										}
diff -r 789b5952635d -r f1b07726543b tek/class/ui/listview.lua
--- a/tek/class/ui/listview.lua	Sun May 11 10:24:55 2008 +0200
+++ b/tek/class/ui/listview.lua	Sun May 11 11:45:16 2008 +0200
@@ -21,7 +21,7 @@ local unpack = unpack
 local unpack = unpack
 
 module("tek.class.ui.listview", tek.class.ui.gadget)
-_VERSION = "ListView 3.1"
+_VERSION = "ListView 3.2"
 local ListView = _M
 
 -------------------------------------------------------------------------------
@@ -145,6 +145,7 @@ function ListView:addItem(entry, lnr)
 	if lo then
 		entry = type(entry) == "table" and entry or
 			type(entry) == "string" and { entry }
+		entry[2] = false -- entry, when added, must not be selected
 		lnr = lo:addItem(entry, lnr)
 		self:prepare(true)
 		for i = lnr, lo:getN() do


More information about the tekui-devel mailing list