Yesterday at 6:17pm, Andy Kopciuch said:

> On Saturday 08 December 2001 20:21, you wrote:
> > On Sat, Dec 08, 2001 at 07:18:10PM -0700, Andy Kopciuch wrote:
> > > On Saturday 08 December 2001 19:04, you wrote:
> > > > On Sat, Dec 08, 2001 at 06:00:56PM -0500, Paul Kincaid wrote:
> > > > > I'm looking for a way that if you select "Exit" from the Blackbox
> > > > > Menu that you are prompted to exit rather than it just killing
> > > > > everything and kicking me out to the console.  You don't know how
> > > > > many times I have accidentially exited, killing everything that I was
> > > > > doing....
> > > >
> > > > I've always had something such as:
> > > >
> > > >         [submenu] (Quit!) {Really quit?}
> > > >                 [restart] (Restart Blackbox)
> > > >                 [exit] (Quit Blackbox)
> > > >         [end]
> > > >
> > > > Just to make it slightly harder to accidentally quit.

This is a nice solution!  Actually very much in the Blackbox spirit.

> > >
> > > Nice.  That does work, but it is a hack to something that I think should
> > > be in blackbox.  It is pretty a standard programming practise to prompt
> > > the user before something like this, in my experience anyway.
> > >
> > > >From my brief knowledge of the code base, I don't think it would be very
> > > > hard
> > >
> > > to implement a user prompt in the shutdown() method.
> >
> > Make sure there is still a way to exit without confirmation.  Adding a menu
> > function like 'exitconfirm' and making it the default might be appropriate.
> >
> >     [exitconfirm] (Quit Blackbox)
> >     [end]
> >
> > People who don't want confirmation can edit the menu and make it [exit].
>
> I would imagine there would be a configuration option to "confirm upon exit".
> Maybe in .blackboxrc.

There might be a problem with that.  There is currently no code in
blackbox for displaying any dialog.  So the confirm dialog would add a lot
of code to blackbox.

You may use the xtexit program.  It displays a dialog and sends a close
event to all open windows, so that apps can display a save yes/no dialog.
Then, when you click on the 'exit' button it resets the X server, thereby
quitting blackbox (but w/o saving the resource file).

There could also be written a little utility: bbexit.  This could display
a dialog and use the bbkeys mechanism to send Blackbox a quit command when
the user confirms.

regards,
wilbert

-- 
Wilbert Berendsen (http://www.xs4all.nl/~wbsoft/)

"To build an apple pie from scratch, you must first invent the universe."
Carl Sagan, Cosmos

Reply via email to