Galde 2 (GTK+ 2.0) Question...

Need help with C, C++, perl, python, etc?

Galde 2 (GTK+ 2.0) Question...

Postby MadSc13ntist » 2005-09-15 21:52

I have recently started trying to use Glade 2 to create (expedient) GUI applications... and i must say i love the idea of this toolkit alot! I'm quite impressed really...

I was reading through a glade 2 tutorial i found http://www.kplug.org/glade_tutorial/glade2_tutorial/glade2_introduction.html

i figured out that (because i use KDE) i had to create the containers/widgets that were supposedly default with a new window (but i really don't care about that) the problem i have run into is this.....

I have gotten to the portion of the tutorial that involves editing the source (main.c, callbacks.c) i.e. the good stuff....

I am stuck here:
http://www.kplug.org/glade_tutorial/glade2_tutorial/gtemp_4.html

I kicked open my editor (SciTE, a killer scintilla based IDE)
and made the changes that were stipulated in the main.c file... no worries there.
However, when i attempt to make the following changes i.e.

Open the callbacks.c file in your editor of choice. You'll see all the callbacks or signal handlers we added previously, with the one we just added for delete event at the bottom of the file. Go to that one.

Add
gtk_main_quit();
above
return FALSE;
in the on_gtemp_app_delete_event() function. For more information on gtk_main_quit() you can consult the gtk+ API at the gtk-General section.


which that chunk of code begins as this:
Code: Select all
}


gboolean
on_gtemp_app_delete_event              (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{

  return FALSE;
}


I attempted several different configurations to accomidate this and i am sure that i am making a F&^%ing stupid mistake somewhere here because when i compile i get screamed at for various reasons (differing with the approach to editing this chunk)

I am willing to admit (as if i have a choice in this) that i feel pretty f&^%ing stupid about now, but i am just as stuborn and would like very much to learn my lesson and continue in this tutorial. i'm sure i am making a glaring error but here is an example....

Mychunk (edited):
Code: Select all
}


gboolean
on_gtemp_app_delete_event              (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
gtk_main_quit();
{

  return FALSE;
}


when i attempt to compile i get:

Code: Select all
callbacks.c:120: error: syntax error before "gtk_main_quit"
callbacks.c:120: error: conflicting types for `gtk_main_quit'
/usr/include/gtk-2.0/gtk/gtkmain.h:145: error: previous declaration of `gtk_main_quit'
callbacks.c:120: warning: data definition has no type or storage class
callbacks.c:121: error: syntax error before '{' token
make: *** [callbacks.o] Error 1
madsc13ntist:/home/madsc13ntist/Projects/project1/src#


i haven't started pulling my hair out because i'm sure the mistake i am making is glaring and will (most likely) make alot of sense and i will be able to learn from it and continue to RTFM/tutorial and enjoy my experience building nifty app's in Debian/Glade 2.

Thanks in advance to any/all who so much as comment that will help me (in any way) on my way to linux developement.
Last edited by MadSc13ntist on 2005-09-15 22:14, edited 1 time in total.
User avatar
MadSc13ntist
 
Posts: 115
Joined: 2005-07-23 16:34

deeeeeeeeeerrrrrrrrrrrrrrrr

Postby MadSc13ntist » 2005-09-15 22:12

okay... i am going to stop coding under the influence.....
Code: Select all
{
   gtk_main_quit();
}


i'm a tard... just fixed my errors now i am going to hang my head in shame.....
jesus-h-tapdancing-christ already...

p.s.

one part Capt. Morgan parot-bay coconut rum
one part 99 bananas
one part pineapple juice
not bad..... unless you are a function ;-)
User avatar
MadSc13ntist
 
Posts: 115
Joined: 2005-07-23 16:34


Return to Programming

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable