Re: [gtk-list] C++ and gtk+



David Pettersson wrote:

> Hi!
>
> I tried to do a little program in c++ with gtk+. I have a 'class A' which
> contains a 'widget *W'. If I have more then one instance of 'A' I can for
> some signals (e.g. "clicked") send 'this' last data argument to
> 'gtk_signal_connect()', and thus know what object the signal refer to.
> With other signals (e.g. "configure_event") the last argument in the
> callback function is used for other data, so my question is, how do I know
> which of my objects the signal refers to?
>
> David.
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

David:

I tried to use GTK+ with C++ and it just doesn't work.  I could not get rid of
segmentation faults with simple things that I thought should work.  Anyhow,
I now use GTK--.  The syntax is C++ like and objects use callback methods.
Also, there is an excellent paper on the Gnome site I think, on signal
callbacks.  Well, check out GTK-- and I think that you will be pleased.  The
download for the development library comes with html pages for the header
files and their methods.  Some examples are provided,  but you will learn more
if you just experiment.  GIve up on the mixture of C++ (your code) and (GTK+
their code).  It just doesn't work well together.

David

david.whitehurst@att.net
dwhitehurst@skyalland.com
Senior Applications Developer
Sky Alland




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]