@@ -1306,16 +1306,14 @@ function Widgets.inputBox:getText()
13061306 return self ._value
13071307end
13081308function Widgets .inputBox :setText (str )
1309- if type ( str ) == ' string ' then
1310- self . _value = str
1311- end
1309+ if str == nil then str = " " end
1310+ assert ( type ( str ) == ' string ' , " Arg #1 must be string " )
1311+ self . _value = str
13121312end
13131313function Widgets .inputBox :addText (str )
1314- if type (str )== ' string' then
1315- self ._value = self ._value .. str
1316- else
1317- MES .new (' error' ," inputBox " .. self .name .. " dead, addText(" .. type (str ).. " )" )
1318- end
1314+ if str == nil then str = " " end
1315+ assert (type (str )== ' string' ," Arg #1 must be string" )
1316+ self ._value = self ._value .. str
13191317end
13201318function Widgets .inputBox :clear ()
13211319 self ._value = ' '
@@ -1466,9 +1464,10 @@ function Widgets.textBox:replaceTexts(newList)
14661464 self ._texts = newList
14671465 self ._scrollPos = 0
14681466end
1469- function Widgets .textBox :setTexts (newList )
1467+ function Widgets .textBox :setTexts (t )
1468+ assert (type (t )== ' table' ," Arg #1 must be table" )
14701469 TABLE .clear (self ._texts )
1471- TABLE .connect (self ._texts ,newList )
1470+ TABLE .connect (self ._texts ,t )
14721471 self ._scrollPos = 0
14731472end
14741473function Widgets .textBox :push (t )
@@ -1641,6 +1640,7 @@ function Widgets.listBox:clear()
16411640 self ._scrollPos = 0
16421641end
16431642function Widgets .listBox :setList (t )
1643+ assert (type (t )== ' table' ," Arg #1 must be table" )
16441644 self ._list = t
16451645 self ._selected = 1
16461646 self ._scrollPos = 0
0 commit comments