[Iup-users] Setting the caret position in MultiLine w/Lua?
Antonio Scuri
scuri at tecgraf.puc-rio.br
Sat Dec 8 14:22:24 GMT+3 2007
Hi,
The followinf code works just fine:
m = iup.multiline{size="200x200"}
b = iup.button{title="Go", action = function() m.caret = "10,10" end}
dg = iup.dialog{iup.vbox{m,b}}
dg:show()
Of course assuming that there are characters at line 10, column 10, so the
caret can be positioned.
But inside the action it could be very confusing. Because the multiline
contents will be changed after the action callback, and I think that the
caret position will be also changed. So setting the caret inside the action
callback will be replaced by the new caret position.
Best,
scuri
> -----Original Message-----
> From: iup-users-bounces at lists.luaforge.net
> [mailto:iup-users-bounces at lists.luaforge.net] On Behalf Of
> Jeremy Cowgar
> Sent: sábado, 8 de dezembro de 2007 14:59
> To: IUP discussion list.
> Subject: [Iup-users] Setting the caret position in MultiLine w/Lua?
>
> I have an action callback and in it I am wanting to set the
> cursor position... I thought I could do this:
>
> self.caret = '10,2'
>
> but that does not seem to have any effect?
>
> Jeremy
>
>
> _______________________________________________
> iup-users mailing list
> iup-users at lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/iup-users
>
More information about the iup-users
mailing list