Re: Message box
- From: Todd Fisher <taf2 lehigh edu>
- To: Alf C Stockton <alf stockton co za>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Message box
- Date: Sun, 30 May 2004 14:47:52 -0400
Hi Alf,
I use the following:
error_message( GtkWidget *parent,
const gchar *title,
const gchar *msgformat, ... )
{
GtkWidget *dialog, *label;
va_list args;
gchar *message;
dialog = gtk_dialog_new_with_buttons( title,
GTK_WINDOW( parent ),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK,
GTK_RESPONSE_NONE,
NULL );
if( msgformat ){
va_start( args, msgformat );
message = g_strdup_vprintf( msgformat, args );
va_end( args );
label = gtk_label_new( message );
gtk_label_set_selectable( GTK_LABEL( label ), TRUE );
g_free( message );
}
else{
label = gtk_label_new( "Undetermined Error" );
gtk_label_set_selectable( GTK_LABEL( label ), TRUE );
}
gtk_container_add( GTK_CONTAINER( GTK_DIALOG( dialog )->vbox ), label );
gtk_widget_show( label );
gtk_dialog_run( GTK_DIALOG( dialog ) );
gtk_widget_destroy( dialog );
}
-todd
Alf C Stockton wrote:
I am sure that there must be an equivalent of the MS MessageBox in GTK+ but
after a bit of looking I have not found it.
What I want is something to display an error message for as long as it takes for
the user to respond.
---
Regards,
Alf Stockton www.stockton.co.za
Misfortune, n.:
The kind of fortune that never misses.
-- Ambrose Bierce, "The Devil's Dictionary"
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]