[fxruby-users] How do you enable a button for any option change in UI?

Lyle Johnson lyle at lylejohnson.name
Mon Mar 22 16:10:08 EDT 2010

On Mon, Mar 22, 2010 at 1:58 PM, Paul Carvalho <tester.paul at gmail.com> wrote:

> What I want to do is this: the 'save config' button is disabled by default
> when you start the app.  If the user makes *any* change to any of the
> options, I want the 'save config' button to automatically enable.

For that kind of situation, I'd attach a SEL_UPDATE handler to the
"Save Config" button:

    @save_config_button.connect(SEL_UPDATE) do
      if @config_changed

Elsewhere in my code, I'd set @config_changed to false whenever the
user clicked "Save Config", or to false whenever they made a change to
one of the config values.

> Of course, that's my first problem.  Once I've figured out that part, I'll
> need to figure out how to read & write the options to a separate file.  Any
> help someone can provide me with this problem would be greatly appreciated.
> Again, feel free to use the button.rb script as a working example, because
> that's what I'm using to try and figure this out.

That sounds like a good job for the registry (FXRegistry) service.

More information about the fxruby-users mailing list