comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: desensitizing selected elements of CW_BGROUP
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: desensitizing selected elements of CW_BGROUP [message #12548] Wed, 19 August 1998 00:00
mgs is currently offline  mgs
Messages: 144
Registered: March 1995
Senior Member
In article <35DACF94.91798260@wellesley.edu>, rfrench@mediaone.net wrote:

> I would like to display a set of non-exclusive buttons in a group,
> but to be able to apply a 'sensitivity mask' to the group which
> would sensitize only those buttons that have a 1 in the mask,
> desensitizing the ones with a 0. WIDGET_CONTROL lets you
> desensitize and ENTIRE compound widget - what I want to do is
> to desensitize only selected buttons in the button group. I've
> looked at the CW_BGROUP and WIDGET_CONTROL documentation and
> don't see a way to do this. Presumably, one could monkey with
> the CW_BGROUP code and implement a SENSITIVE=[0,1,0,1,1] kind
> of keyword, but I am not eager to do that. Suggestions welcome!
> The workaround I have so far is to apply this mask in
> my event handler and simply ignore events that are insensitive.
> The down side of this is that the labels for those buttons are
> not dimmed, so the user does not have a visual indication that
> those buttons are inactive.

Use the "IDS" keyword to CW_BGroup to return the widget IDs of the
individual buttons in your group.

Here's a small chunk of code from the widget definition module of a recent
application:
asLabel = ['Display Current', 'Output Display', 'Display Mosaic', $
'Output All', 'Color ...', 'Output ...']

; button group for Display and Color selection
wBGCommand = CW_BGroup(wBaseL, asLabel, Row=3, /Frame, $
UValue=asLabel, IDs=awBGCommand)

; desensitize all but the Color and Output buttons.
FOR i = 0, 3 DO $
Widget_Control, awBGCommand(i), Sensitive=0

And here's the corresponding portion in the event handler:
; sensitize the appropriate command buttons
aPos = [0, 2, 3]
FOR i = 0, (N_Elements(aPos) - 1) DO $
Widget_Control, mInfo.awBGCommand(aPos(i)), Sensitive=1

--
Mike Schienle Interactive Visuals
mgs@la.znet.com http://la.znet.com/~mgs/
Re: desensitizing selected elements of CW_BGROUP [message #12552 is a reply to message #12548] Wed, 19 August 1998 00:00 Go to previous message
David L. Windt is currently offline  David L. Windt
Messages: 9
Registered: June 1997
Junior Member
Here's one way:

base=widget_base()
bgroup=cw_bgroup(base,['Sensitive','Insensitive'],ids=ids,/r ow)
widget_control,base,/realize
widget_control,ids(1),sensitive=0

-David Windt
windt@bell-labs.com
www.bell-labs.com/user/windt/idl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 2D UNIQ function?
Next Topic: Re: No colour with TVRD and WRITE_GIF

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 00:42:59 PDT 2025

Total time taken to generate the page: 0.32190 seconds