Calling C++ functions
- From: "William L. Thomson Jr." <support obsidian-studios com>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Calling C++ functions
- Date: 25 Jun 2002 18:10:04 -0700
I am having problems calling C++ functions from my GTK buttons.
For example
gtk_signal_connect_object(GTK_OBJECT(new_button),"clicked",GTK_SIGNAL_FUNC(new_invoice),GTK_OBJECT(window));
Works fine if I do not wrap the new_invoice() function in a C++ class
So when I declare the function as
void Invoice::new_invoice()
I can't seem to get the proper syntax to the gtk button. I have tried
gtk_signal_connect_object(GTK_OBJECT(new_button),"clicked",GTK_SIGNAL_FUNC(Invoice::new_invoice),GTK_OBJECT(window));
And even initialized a the class like
Invoice invoice;
gtk_signal_connect_object(GTK_OBJECT(new_button),"clicked",GTK_SIGNAL_FUNC(invoice.new_invoice),GTK_OBJECT(window));
Which worked in another case.
As stated in the past I am new to GTK, C and C++. I like the syntax of
C++, but seem to be pulling teeth to do the simplest of operations. So I
feel like I am pissing in the wind just to please my eyes. :)
Also while I am asking, what function can be used to close an inner
window. This
gtk_signal_connect_object(GTK_OBJECT(button),"clicked",GTK_SIGNAL_FUNC(gtk_exit),GTK_OBJECT(window));
will not only close a window, but it closes the main window closing all,
so what can I use instead of gtk_exit.
The window widget/object I am attaching is not the main window, and is
in a function all by itself, and in a different file, but being compiled
into the same single executable. Each window widget/object should only
exist in the function's scope. I have not made it a public or global
scope widget or anything.
Thanks
--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]