LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-09-2005, 07:12 AM   #1
mandeltuete
Member
 
Registered: Mar 2003
Location: Switzerland
Distribution: Fedora 3
Posts: 75

Rep: Reputation: 15
GTK2: About Dialog


Hi all!

I've tried creating an about dialog with gtk2 in C.
The api documentation tells me that I can do this in two ways. First, using g_object_new:
Code:
GtkWidget *aboutWindow;
aboutWindow = g_object_new(GTK_TYPE_ABOUT_DIALOG, 
		"name", "...'", 
		"version", "0.1", 
		"copyright", "...", 
		"comments", "....", 
		"authors", ".....", 
		"documenters", "....", 
		"translator-credits", "....", 
		"logo", NULL, 
		NULL);

gtk_widget_show_all(aboutWindow);
Compile fails:
Code:
gcc -o gtk-14 main.c `pkg-config --cflags --libs gtk+-2.0`
main.c: In function `aboutDialog':
main.c:216: error: `GTK_TYPE_ABOUT_DIALOG' undeclared (first use in this function)
main.c:216: error: (Each undeclared identifier is reported only once
main.c:216: error: for each function it appears in.)
Second attempt, using gtk_about_dialog_new() (http://developer.gnome.org/doc/API/2...outDialog.html):
Code:
GtkWidget *aboutWindow;
aboutWindow = gtk_about_dialog_new();
doesn't work:
Code:
gcc -o gtk-14 main.c `pkg-config --cflags --libs gtk+-2.0`
main.c: In function `aboutDialog':
main.c:226: warning: assignment makes pointer from integer without a cast
/tmp/cczYBpMy.o(.text+0x10a3): In function `aboutDialog':
: undefined reference to `gtk_about_dialog_new'
collect2: ld returned 1 exit status
I can't find anything about 'about_dialog' in my gtk2 header files, and there don't seem to be any example programs using it.
Any clues?

greets
phylor

Last edited by mandeltuete; 04-09-2005 at 07:14 AM.
 
Old 04-09-2005, 08:51 AM   #2
BorisMcHack
Member
 
Registered: May 2004
Location: uk
Distribution: debian sarge
Posts: 65

Rep: Reputation: 15
The gtk about dialog is new to 2.6, so perhaps you're using 2.4 or earlier?
 
Old 04-09-2005, 12:23 PM   #3
mandeltuete
Member
 
Registered: Mar 2003
Location: Switzerland
Distribution: Fedora 3
Posts: 75

Original Poster
Rep: Reputation: 15
Thanks for your reply!
Yes, I am using gtk 2.4 ^^
Actually I'm bit confused about the API reference. The API reference for 2.x seems to be for 2.6.3. (but url shows 2.0) The one for 2.6 links to 2.6.2.
I'll update to 2.6, thanks for your help !

Last edited by mandeltuete; 04-09-2005 at 12:25 PM.
 
  


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
GTK2 Dialog Example - request guitarfella Programming 1 04-25-2005 11:32 AM
Dialog cookie_ie Programming 5 04-11-2005 01:48 AM
dialog ziox Programming 1 03-16-2005 01:09 PM
Dialog phatbastard Linux - Security 3 12-13-2004 09:48 PM
Shortcut buttons in GTK2 open dialog Lacek Linux - Software 0 06-09-2004 02:40 AM

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

All times are GMT -5. The time now is 05:43 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