From: Hidetoshi NAGAI Date: 2010-06-07T19:23:19+09:00 Subject: Re: using TkEntry with copy/paste From: Mathew Cucuzella Subject: using TkEntry with copy/paste Date: Mon, 7 Jun 2010 18:26:05 +0900 Message-ID: <1a5a8e5e8201d16e9807a4a633423f5d@ruby-forum.com> > I'm writing a Ruby/Tk program where I want a TkEntry field with a > state of "readonly" so a user can copy/paste from it, but not modify > it. Unfortunately this prevents me from programatically changing it, > which I want to do. Is there a better way to accomplish that? How about the following require 'tk' top = TkRoot.new var = TkVariable.new entry = TkEntry.new(top, :state=>'readonly', :textvariable=>var).grid(:row=>0, :column=>0) TkButton.new(top, :text=>'Convert', :command=>proc{var.value = 'hi'}).grid(:row=>1, :column=>0) Tk.mainloop -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)