Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Change text to read only
Change text to read only [message #534307] Tue, 18 May 2010 15:24 Go to next message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
Hello peoples

Is there any way to change an existing Text widget to read only, when it was
constructed without the SWT.READ_ONLY flag?
Re: Change text to read only [message #534322 is a reply to message #534307] Tue, 18 May 2010 16:23 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
That would be a hack...

text.addVerifyListener(new VerifyListener(){
public void verifyText(VerifyEvent e){
e.doit=false;
}
});


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Change text to read only [message #534718 is a reply to message #534307] Thu, 20 May 2010 06:41 Go to previous messageGo to next message
Praveen  is currently offline Praveen Friend
Messages: 86
Registered: July 2009
Member
geejay wrote:
> Hello peoples
>
> Is there any way to change an existing Text widget to read only, when it
> was constructed without the SWT.READ_ONLY flag?
You can use text.setEditable(false) API for making the text widget to
read only.
Re: Change text to read only [message #534740 is a reply to message #534718] Thu, 20 May 2010 08:28 Go to previous message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Quote:
geejay wrote:
> Hello peoples
>
> Is there any way to change an existing Text widget to read only, when it
> was constructed without the SWT.READ_ONLY flag?
You can use text.setEditable(false) API for making the text widget to
read only.


Yes that would be a better way,i missed it.


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Previous Topic:[INFO]When you dont get response to your posts.
Next Topic:How to re-layout controls in a view
Goto Forum:
  


Current Time: Fri Mar 29 01:21:03 GMT 2024

Powered by FUDForum. Page generated in 0.03901 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top