LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Little help with GTK+ please! (https://www.linuxquestions.org/questions/programming-9/little-help-with-gtk-please-791451/)

ginda 02-25-2010 04:33 AM

Little help with GTK+ please!
 
Hi all

I have started a little programming with GTK+ and C and have now come to a wall. I basically want to call a GTK+ Dialog window from an if statement but i am getting some errors when i compile.

"myapp.c:253: warning: conflicting types for âshow_errorâ
myapp.c:218: warning: previous implicit declaration of âshow_errorâ was here"

Note: I know how to do it using a button and signal connect but how can i call the function just like a normal C function.


My code:

/*MY IF STATEMENT*/
if (blah){
do this
}

else {
show_error();
}


/*MY DIALOG WINDOW FUNCTION*/
void show_error(GtkWidget *widget, gpointer window)
{
dialog = gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "Error loading file");

gtk_window_set_title(GTK_WINDOW(dialog), "Error");

gtk_dialog_run(GTK_DIALOG(dialog));

gtk_widget_destroy(dialog);
}



I suspect that when i am calling the function "show_error();" it expects some parameters, but what parameters do i put in????


Thanks in advance

crts 02-25-2010 05:05 AM

Maybe this helps.

http://library.gnome.org/devel/gtk/s...ageDialog.html


All times are GMT -5. The time now is 01:41 AM.