[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1254.0. "sensitizing/desensitizing scale widget" by CSC32::B_BRADACH () Wed Aug 09 1989 19:48

    I have a customer using C with uil/toolkit.  He creates a scale widget
    in UIL and sets sensitive to false.  Then, in his C source he uses
    xtsetarg/xtsetvalues to reset this attribute to true.  The scale widget
    itself becomes "sensitive", however the title for it is still in its
    greyed out form.  Does anyone know of a way to get the title back to
    being "non-greyed"????  I hacked an example together to reproduce and
    it follows in the first response.  
    
    Any and all ideas would be appreciated.
    
    bernie
    csc/cs
    

T.RTitleUserPersonal
Name
DateLines
1254.1uil and c source filesCSC32::B_BRADACHWed Aug 09 1989 20:02147
module helloworld
    version = 'v1.0'
    names = case_sensitive

include file '/usr/include/X11/DECwDwtApplProg.uil';

procedure
    helloworld_button_activate();

object
    helloworld_main : main_window {
	arguments { 
	    accept_focus = true;
            height=150;
            width=150;
	};
	controls {
	    scale	helloworld_scale;
	};
    };

object
    helloworld_scale : scale {
	arguments {
		x = 25;
		y = 25;
!                sensitive = false;
		};
    };

end module;
               cut here
    ==============================================================
    
#include <stdio.h>
#include <X11/DECwDwtApplProg.h>
#include <X11/Vendor.h>
#include <X11/Intrinsic.h>
static DRMHierarchy	s_DRMHierarchy;		/* DRM database hierarch id */
static char		*vec[]={"scale.uid"};
						/* DRM database file list   */
static void helloworld_button_activate();
static DRMCode		class ;
static DRMCount		regnum = 1 ;
static DRMRegisterArg	regvec[] = {
	{"helloworld_button_activate",(caddr_t)helloworld_button_activate}
	};



Display *display;	/* display pointer */

    Widget toplevel, helloworldmain,helloworlddialog,helloworldbutton; 
/*
 *  Main program
 */
int main(argc, argv)
    unsigned int argc;
    char **argv;
{
    Arg arglist[10] ;
    int n = 0;

	if (! (display = XOpenDisplay(NULL)))
		{
		fprintf (stderr, "Can't open display\n");
		}

/* create menu window */
    DwtInitializeDRM ();

    toplevel = XtInitialize(
	"Hi",	 			/* application name */
	"helloworldclass",              /* application class */
	NULL, 0,                        /* options */
	&argc, argv);                   /* command line parameters */


    if (DwtOpenHierarchy (1,			    /* number of files	    */
			vec, 			    /* files     	    */
			NULL,			    /* os_ext_list (null)   */
			&s_DRMHierarchy)	    /* ptr to returned id   */
			!= DRMSuccess) {
	printf ("can't open hierarchy");
     }

    DwtRegisterDRMNames (regvec, regnum) ;

    if (DwtFetchWidget (s_DRMHierarchy,
			"helloworld_main",
			toplevel,
			&helloworldmain,
			&class)
			!= DRMSuccess)
			    printf("can't fetch interface");


    XtSetArg (arglist[n], DwtNx, 50) ; n++;
    XtSetArg (arglist[n], DwtNy, 50) ; n++;
/*    XtSetArg (arglist[n], DwtNsensitive, True) ; n++; */
    
    XtSetValues (toplevel, arglist, n) ;

    n=0;
    helloworlddialog=XtNameToWidget(helloworldmain,
                                    "helloworld_main.helloworld_scale");
    XtSetArg (arglist[n], DwtNsensitive, True) ; n++;
    
    XtSetValues (helloworlddialog, arglist, n) ;

    XtManageChild(helloworldmain);
    
    XtRealizeWidget(toplevel);

    /* Get the widget id's to install the accelerator */
    XtMainLoop();

    return (0);
}
static void helloworld_button_activate( widget, tag, callback_data )
	Widget	widget;
	char    *tag;
	DwtAnyCallbackStruct *callback_data;
{
    Arg arglist[2];

    static int call_count = 0;
    String call_name = "regvec"; 

    call_count += 1 ;
    switch ( call_count )
        {
        case 1:
            XtSetArg( arglist[0], DwtNlabel,
                DwtLatin1String("Goodbye\nWorld!") );
            XtSetArg( arglist[1], DwtNx, 11 );  
            XtSetValues( widget, arglist, 2 );
            break ;
        case 2:
            break ;
	case 3:
            exit(1);
		break;
        }
}
    

1254.2CASEE::LACROIXObject oriented dog food? No, sorryThu Aug 10 1989 05:047
    Bernie,

    This is a known bug in DECwindows V1. Use XtSetSensitive: it's faster,
    and it works.

    Denis.

1254.3thanks for the quick responseCSC32::B_BRADACHThu Aug 10 1989 11:528
    Thanks for the quick response.  XtSetSensitive does indeed work.  
    I appreciate your help.
    
    
    bernie
    csc/cs