From: Joel VanderWerf Date: 2003-05-27T05:06:06+09:00 Subject: Re: FXRuby: Changing the options of FXTextField Andreas Schwarz wrote: > Joel VanderWerf wrote: > >>Andreas Schwarz wrote: >> >>>Hello, >>> >>>I want to change the options of a FXTextField to make it read only >>>(TEXTFIELD_READONLY), but I didn't find any methods to set options after >>>the object is created. >> >>You can use >> >> field.enabled = true # or false to gray out the field > > > undefined method `enabled=' for :Fox::FXTextField (NameError) > :-( > Oops, for convenience I define: class FXWindow alias :enabled :enabled? unless instance_methods.include?("enabled") unless instance_methods.include?("enabled=") def enabled=(x); x ? enable : disable; end end end