From: balajee on 10 Feb 2010 09:35 Hi, I created a text window with some text inside it. Now, if highlight any text with mouse selection, it should automatically be saved into variable. Can anybody suggest me how to do this? Thanks, balajee
From: Jeremy on 10 Feb 2010 09:50 On Feb 10, 9:35 am, balajee <balaj...(a)gmail.com> wrote: > Hi, > I created a text window with some text inside it. Now, if highlight > any text with mouse selection, it should automatically be saved into > variable. Can anybody suggest me how to do this? > Please see: http://www.tcl.tk/man/tcl8.6/TkCmd/text.htm#M79 Footnote 4 says that when the selection changes, then the <<Selection>> event is triggered. Thus, you can bind to that event and use the "sel" index to get the desired text. You may want to look at the "get" and "tag" sections of that man page as well. Jeremy
|
Pages: 1 Prev: delete of directory command - - -noob-- Next: Text 'see' subcommand not working as expected |