nanogui: Modal dialog ?


Previous by date: 7 Mar 2001 15:04:21 -0000 Re: WineCE, final answer?, Jakov af Wallby
Next by date: 7 Mar 2001 15:04:21 -0000 Re: WineCE, final answer?, Jordan Crouse
Previous in thread: 7 Mar 2001 15:04:21 -0000 Modal dialog ?, Sunil Soman
Next in thread:

Subject: Re: Modal dialog ?
From: Jordan Crouse ####@####.####
Date: 7 Mar 2001 15:04:21 -0000
Message-Id: <3AA64F21.C643C497@censoft.com>

It sounds like you are talking about two different things there.  A
dialog box, by definition, would be some sort of warning or information
provided by a program through the use of a seperate window.  A modal
dialog box would be a dialog box that requires the user to respond,
which it acomplishes by ignoring all events outside of the dialog box
window. 

But you were also discussing starting a new process via fork().  I am
confused as to which concept you are interested in, but I will take a
stab at the dialog box. 

It would be really easy to implement a modal dialog box within a
program.  Simply create a new window, populate it, and then force it to
the top with GrRaiseWindow().  Next, you can implement a small event
loop to filter all events coming in until the dialog box is responded
to.  For example:

void dialog_box()
{
	win = create_dialog_box();
	show_dialog_box(win);
	
	while(1)
	{
	   GR_EVENT event;
	   GrGetNextEvent(event);

	   if (event.general.wid != win) continue;
	 
	    ... Handle expose and other events here ...   
	    if (event.type == GR_EVENT_BUTTON_DOWN)
	      break;
	 
	}

	close_dialog_box(win);
}

Note that this will be effective only for the client in question, not
for other clients or the window manager.  Unlike Windows, we have no way
of implementing a system wide modal box (and I hope we never do!!!)

Jordan

Sunil Soman wrote:
> 
> Hello, how do I implement such a thing as a modal dialog box with nano-X ? Of
> course, I cannot do such a thing as fork a child & wait for it's pid....what
> then ?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####

Previous by date: 7 Mar 2001 15:04:21 -0000 Re: WineCE, final answer?, Jakov af Wallby
Next by date: 7 Mar 2001 15:04:21 -0000 Re: WineCE, final answer?, Jordan Crouse
Previous in thread: 7 Mar 2001 15:04:21 -0000 Modal dialog ?, Sunil Soman
Next in thread:


Powered by ezmlm-browse 0.20.