LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-25-2010, 04:33 AM   #1
ginda
Member
 
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Rep: Reputation: 31
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
 
Old 02-25-2010, 05:05 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Maybe this helps.

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot find gtk-config on ubuntu9.04 after installing GTK Randyqiu Programming 2 11-17-2009 09:58 PM
Inhibit GTK verbose messages when running GTK/Gnome applications from terminal d1s4st3r Linux - Software 1 11-10-2009 10:33 PM
gtk-qt-engine causes white border on gtk tray icons tdtooke Linux - Desktop 0 08-08-2008 12:25 PM
Freerock uninstall stole GTK looking for up-to-date pango, atk, gtk, glib and xft tgz Oholiab Slackware 8 09-18-2005 11:57 AM
cant find gtk-config file or gtk-devel to install happychappy Linux - Software 2 02-16-2005 12:46 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration