Hi,
I have a gtk_dialog with a gtk_entry and a button. Before
clickink Ok the user must supply a filename in the gtk_entry.
The problem: if the user doesn't do this I have a gtk_message_dialog
appears with an error message but to give control again to the
gtk_dialog ? The execution of the code goes on !! This is the code:
void on_extract1_activate ( GtkMenuItem *menuitem, gpointer user_data)
{
static GtkWidget *prefs_window = NULL;
gchar *command;
const gchar *extract_path = NULL;
GtkTreeSelection *selection = gtk_tree_view_get_selection (
GTK_TREE_VIEW (treeview1) );
gint selected = gtk_tree_selection_count_selected_rows ( selection );
prefs_window = prefs (selected);//Here I create the dialog
gtk_dialog_set_default_response (GTK_DIALOG (prefs_window),
GTK_RESPONSE_OK);
response = gtk_dialog_run ( GTK_DIALOG ( prefs_window ) );
if ( response == GTK_RESPONSE_CANCEL || response ==
GTK_RESPONSE_DELETE_EVENT )
{
gtk_widget_destroy ( prefs_window );
return;
}
else
{
extract_path = gtk_entry_get_text ( GTK_ENTRY (entry1) );
if ( (! extract_path ) || ( ! strlen ( extract_path ) ) ) response =
ShowGtkMessageDialog (GTK_WINDOW
(MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,
"Please select where to extract files !" );
// The execution of the code goes here, how can I give control again
to the gtk_dialog ??
--
Colossus
Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list