[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

2075.0. "DwtModal popup_dialog_box" by TOWNS::RUFFIEUX () Thu Jan 18 1990 18:41

HELP!

	I am writing an application that requires a login window similar to
the login window in DECwindows.  I use a popup_dialog_box with 2 simple text
widgets and two push buttons for the username and password part of the window.
The popup is set as follows:



object
    access_box :popup_dialog_box
    {
	arguments
	{
	    take_focus = true;
	    style = DwtModal;
	    x = 313;
	    y = 365;
	    height = 240;
	    width = 400;
	    border_width = 3;
	    border_color = color('MediumVioletRed');
	};
	controls
	{
	    label	login_label;
	    separator   login_separator;
	    label	username_label;
	    simple_text username_text;
	    label	password_label;
	    simple_text password_text;
	    push_button ok_button;
	    push_button clear_button;
	};
    };


	My problem is that when you click on the clear push button, the entire
popup_dialog_box clears away leaving only its parent.  I understand that a
Modal dialog box widget causes an application to suspend all other 
processing until the user responds to the query presented, but, all the clear
push button does is reset's the username and password simple text widgets. (
all that the callback does.....)

Everything else works fine, bothe simple texts and the ok button.
Any comments, suggestions, or advice is welcome.


				Thank you,

				CER
T.RTitleUserPersonal
Name
DateLines
2075.1DwtNautoUnmanage?RTL::TREGGIARIFri Jan 19 1990 09:4013
>	My problem is that when you click on the clear push button, the entire
> popup_dialog_box clears away leaving only its parent. 
    
    I'm not sure what you mean by that, but a modal dialog box does
    have a resource named DwtNautoUnmanage which might be the problem.
    It defaults to TRUE, and when TRUE, it causes the activation of any
    push button to unmanage the dialog box as a side-effect.  If this
    is your problem, set it to FALSE, and unmanage the dialog box
    yourself when the user pushes the OK button.
    
    Leo
    
       
2075.2Works FineTOWNS::RUFFIEUXFri Jan 19 1990 12:213
    RE .1
    
    Thanks Leo, that was my problem..
2075.3 problem with modal dialog box widgets? N2ITIV::LEEThe stupid is always possibleThu Apr 19 1990 21:3671
	I'm having a similar problem.  I am using a modal dialog box widget to
	get input, and I have set up a default button. (using DwtNdefaultButton)
	I want the dialog box to stay managed when the button is "pushed" and 
	there is no input (or invalid input) specified.   I have set 
	DwtNautoUnmanage to be False on the dialog box widget, but it still 
	disappears when the button is activated.

	However, if I make the dialog box modeless, it works fine.

	I am running VMS V5.2, with the associated Decwindows kit (V1?), 
	on a GPX.

	Any help/pointers are appreciated.


	Thanks,

	-Andy




	The relevant code is as follows:


    .
    .
    .

    dialogBox = DwtDialogBox(mainwindow, "", TRUE, 300, 300,
				NULL, DwtModal, NULL, NULL);

    .
    .	/* subwidgets of dialog box created here, including okayButton &  *
    .	 * filenameText							  */
    .

    XtSetArg(arglist[0], DwtNautoUnmanage, 0);
    XtSetArg(arglist[1], DwtNdefaultButton, okayButton);
    XtSetValues(dialogBox, arglist, 2);

    .
    .	/* some other junk done here /
    .

    DwtMainSetAreas(mainwindow, menubar, NULL, NULL, NULL, NULL);
    XtRealizeWidget(toplevel);
    XtManageChild(dialogBox);

    XtMainLoop();

/**********************/

default button activate callback routine:


    strcpy(input_filename,  DwtSTextGetString(filenameText));

    if (strlen(input_filename) > 0)
    {
	XtUnmanageChild(dialogBox);

        .
        .	/* some other junk done here /
        .

   }

    return;

2075.4Can't change DwtNautoUnmanageLEOVAX::TREGGIARIFri Apr 20 1990 20:1319
>    dialogBox = DwtDialogBox(mainwindow, "", TRUE, 300, 300,
>				NULL, DwtModal, NULL, NULL);
>
>    .
>    .	/* subwidgets of dialog box created here, including okayButton &  *
>    .	 * filenameText							  */
>    .
>
>    XtSetArg(arglist[0], DwtNautoUnmanage, 0);
>    XtSetArg(arglist[1], DwtNdefaultButton, okayButton);
>    XtSetValues(dialogBox, arglist, 2);

DwtNautoUnmanage is a widget resource that you cannot change after the
widget has been created (see the manual...).  You will have to use the
low-level create routine.

Leo