Re: Simple Yes/No dialog



On Fri, 2006-06-16 at 11:50 -0400, blythe2 tcnj edu wrote:
Ok, you guys were a great help with my last question :)  Does GTK have a
simple blocking yes/no dialog?  Something that will return true or false,
or similar?  I could write my own really quickly, but I was kinda hoping
GTK would save me a few lines of code.

Depending on OS, you could also shell out to a separate program
that pops up the dialogue.

In general, though, if you're writing an application, blocking yes/no
dialogues are often a stumbling block in the user interface -- i.e.
they can suck :-)

One problem is that the user can often think of other responses they'd
prefer to make:
   The file blacksock already exists.
   Replace it? [yes] [no]
could better be
   The file blacksock already exists
   [don't save] [choose a new name] [overwrite]
but even there the user might want to look at the file first.

But if the dialogue is blocking, and they move the yes/no window,
they won't be able to interact with your program e.g. to load
the other file and see whether they want it.

Whenever you find yourself making a blocking dialogue, ask
yourself whether there's a better way.  Of course the other
ways are often a lot more work, and you probably already did
ask yourself this.

Others have already said how to do it if you want to.

best,

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]