[Glade-users] Need to use Glade with C++
- From: ocelot at vp.pl (ocelot)
- Subject: [Glade-users] Need to use Glade with C++
- Date: Thu Jun 1 07:09:35 2006
Hi gurlxc
I am new to Glade. I built a small program with Glade and compiled in C with
no problems.However, I need to use C++. I have GTK+ installed, but I'm not
sure what direction to go from there.Any suggestions would be appreciated.
I'm using gtk with c++ without any wrapers.
The simplest program
// main.cpp
#include <iostream>
#include <gtk/gtk.h>
#include <glade/glade.h>
gboolean on_window_delete_event (GtkWidget *widget, GdkEvent *event,
gpointer user_data){
gtk_main_quit();
return FALSE;
}
int main(int argc, char *argv[]) {
GladeXML *xml;
gtk_init(&argc, &argv);
/* load the interface */
xml = glade_xml_new("glade_project.glade", NULL, NULL);
/* connect the signals in the interface */
//glade_xml_signal_autoconnect(xml); // in windows it
doesn't work for c++
glade_xml_signal_connect(xml,"on_win_main_delete_event", GTK_SIGNAL_FUNC(on_window_delete_event));
/* start the event loop */
gtk_main();
return 0;
}
If you want to see more complex program look at http://www.ocelotsjungle.republika.pl/
Cheers,
Ocelot
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]