Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disabling (graying out) a pushbutton widget

77 views
Skip to first unread message

Olav Kindt

unread,
Mar 3, 1997, 3:00:00 AM3/3/97
to

Hi all,

I was just wondering if it was possible to "gray out" push buttons that
are not valid (i.e. has no effect).

Alternatively does anybody know of other buttons, widget, to use for
this. I wan't to disable a button during some critical calculations.

Any help is greatly appreciated.

PS I did read the FAQ (or searched it anyway) but couldn't find anything
there, If there is could you please give me the topic number?

TNX


--
Olav Kindt email : kindt@cmr.n
Datateknologi tlf : 55-574352
Christian Michelsen Research AS

Ken Lee

unread,
Mar 3, 1997, 3:00:00 AM3/3/97
to

In article <331AC8...@cmr.no>, Olav Kindt <ki...@cmr.no> writes:all,

|>
|> I was just wondering if it was possible to "gray out" push buttons that
|> are not valid (i.e. has no effect).

Use XtSetSensitive()

--
Ken Lee, X/Motif Consulting, http://www.rahul.net/kenton/index.shtml

Geoff Kell

unread,
Mar 3, 1997, 3:00:00 AM3/3/97
to

On Mon, 03 Mar 1997 13:45:54 +0100, Olav Kindt <ki...@cmr.no> wrote:

>Hi all,


>
>I was just wondering if it was possible to "gray out" push buttons that
>are not valid (i.e. has no effect).
>

Set the XmNsensitive resource of the widget to False.

e.g.
XtVaSetValues (WidgetName,
XmNsensitive, False,
NULL);

Good luck

Geoff Kell
Software Engineer
Lockdesign Ltd
UK

Lawson Hanson

unread,
Mar 3, 1997, 3:00:00 AM3/3/97
to

Olav Kindt <ki...@cmr.no> writes:

>Hi all,

>I was just wondering if it was possible to "gray out" push buttons that
>are not valid (i.e. has no effect).

Take a look at the Xt function "XtSetSensitive":

void XtSetSensitive(w, sensitive)
Widget w;
Boolean sensitive;

So a call like:

XtSetSensitive ( someButtonWidget, False );

should do the trick.

By the way, you can get this sort of information from browsing
through the on-line manuals ... perhaps:

man XmPushButton
and
man XtSetSensitive

>--
>Olav Kindt email : kindt@cmr.n
>Datateknologi tlf : 55-574352
>Christian Michelsen Research AS

Best regards,

Lawson Hanson

Kevin L. Suffecool

unread,
Mar 4, 1997, 3:00:00 AM3/4/97
to

Olav Kindt wrote:
>
> Hi all,
>
> I was just wondering if it was possible to "gray out" push buttons that
> are not valid (i.e. has no effect).
>
> Alternatively does anybody know of other buttons, widget, to use for
> this. I wan't to disable a button during some critical calculations.
>
> Any help is greatly appreciated.
>
> PS I did read the FAQ (or searched it anyway) but couldn't find anything
> there, If there is could you please give me the topic number?
>

You did not look hard enough. Subject #288 in the FAQ.

--
% Kevin L. Suffecool ICS (Integrated Computer Solutions) %
% ke...@ics.com <INTJ> 201 Broadway, Cambridge MA, 02139 %
% 1-301-824-5117 http://www.ics.com/~kevin/ %
% Xlib/Motif/Java Consulting, Training, Products, and Solutions %

William D. Fulford

unread,
Mar 6, 1997, 3:00:00 AM3/6/97
to

In article <331AC8...@cmr.no> Olav Kindt <ki...@cmr.no> writes:
>Hi all,
>
>I was just wondering if it was possible to "gray out" push buttons that
>are not valid (i.e. has no effect).
>
>Alternatively does anybody know of other buttons, widget, to use for
>this. I wan't to disable a button during some critical calculations.
>
>Any help is greatly appreciated.
>
>PS I did read the FAQ (or searched it anyway) but couldn't find anything
>there, If there is could you please give me the topic number?
>
Olav,

Please forgive my impertinence, but RTFM. In particular, see XtSetSensitive.
This is so basic that it shouldn't be in the FAQ.


Your Obedient X Servant,
Doug

(I can also be reached at ful...@ix.netcom.com - BUT SEND TO ABOVE ADDRESS TOO!)

0 new messages