[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Dialog question.
- From: "Eric Gillespie, Jr." <epgilles olemiss edu>
- To: gtk-app-devel-list redhat com
- Subject: Re: Dialog question.
- Date: Mon, 11 Oct 1999 17:37:59 -0500
On Mon, Oct 11, 1999 at 01:39:57PM +0000,
Dominik Smogor <duce@fanthom.math.put.poznan.pl> wrote:
> I started developing gtk apps about a month ago and I have a simple
> question. I'd like to make a function with proto like this.
> int mesg(gchar *message)
> This should create a modal dialog with the message and a few buttons
> and return a button number after user have clicked it. How to implement
> this while the function is called from callback?
>
I made a function like this for my app. Here it is.
gboolean
Question(gchar *format, ...)
{
gint r;
gchar *msg;
GtkWidget *question;
va_list ap;
va_start(ap, format);
msg = g_strdup_vprintf(format, ap);
va_end(ap);
question = gnome_app_question(GNOME_APP(dpsftp.MainWindow), msg,
reply, NULL);
r = gnome_dialog_run_and_close(GNOME_DIALOG(question));
return (r == GNOME_YES) ? TRUE : FALSE;
}
--
Eric Gillespie, Jr. <*> epg@pobox.com
"Man is a rope, tied between beast and overman--a rope over an abyss.
A dangerous across, a dangerous on-the-way, a dangerous looking-back,
a dangerous shuddering and stopping."
--Friedrich Nietzsche
PGP signature
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]