http://www.perlmonks.org?node_id=62715

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I want to make a button not clickable until a certain event has occurred. How do I "grey out" the button so you cannot click it, and then re-enable it?

Replies are listed 'Best First'.
Re: How do I disable ("grey out") buttons?
by Jouke (Curate) on Mar 07, 2001 at 15:34 UTC

    Assuming you are using Tk, not Win32::GUI, you would do it like this:

    $button->configure( -state => 'disabled' );

Re: How do I disable ("grey out") buttons?
by Eradicatore (Monk) on Jun 06, 2001 at 19:31 UTC

    Following up on the previous answer: To enable the button again, you simply do this:

    $button->configure( -state => 'normal' );
    Note: In my experience with Tk on Win32 and UNIX platforms, I've found that Win32 uses 'disable' while UNIX uses 'disabled'.

Re: How do I grey out buttons?
by Anonymous Monk on Oct 25, 2004 at 10:11 UTC

    Re: How do I grey out buttons?

    Originally posted as a Categorized Answer.