Re: [gtk-list] Re: Didn't Read the Instructions ..C++ and GTK+ ?



Karl Nelson wrote:

> > Folks:
> >
> > I created an elaborate application using GTK+ and C++.  I have been
> > using g++ to compile.  I passed the main() arguments argc, and argv[] to
> > my gApplication object via pointers.  Now, I am core dumping in the very
> > exit of the program.  Each C++ object is being "deleted" and some are
> > just going into their destructor methods just fine.  Anyhow, at the last
> > return 0; in main(), ddd is telling me that I can't find the bounds of
> > this function (which is main()).
>
> Couldn't really say what level it came from without a back trace
> to tell what was on the stack at the time.
>
>
> > Now that I have spent all of this time and effort without looking at
> > GTK--, can anyone explain to me why I am having a scope problem I
> > think?  The last object to be deleted is the gApplication object.  My
> > gCmdAssistant, gOptionHelper, gFileAssistant,etc. objects all destruct
> > just fine.  The problem I believe, is in the GTK Application scope
> > itself, and its relation to Main().
>
> Do you do any signal connects to C++ objects with the gtk+ signal
> mechanism?  Since C++ objects don't clean up their signal connections
> you may get a signal to any of the other objects that had already been
> deleted which results in an invalid this pointer.  This is one of the key
> reasons to use gtk-- as it solves these types of C++ issues.
>
> > Any help would be appreciated.  Also, I can't seem to get a connection
> > to the GTK-- link on www.gtk.org.
>
> The site should be http://lazy.ton.tut.fi.  If you can't get that
> just check out the gtk-- module from cvs.  The web page is under
> experimental/web.  But more importantly there is an examples
> directory and a good part of a tutorial.
>
> Hope it helps.
>
> --Karl
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

Karl:

I thank you for the prompt reply.  I went to the gnome ftp site and I am
actually building the GTK-- library now.  The example for the gnome calendar
was excellent.  And, yes, the signal events are probably the culprit.  I don't
understand their interaction with the C++ objects that I created.  The gnome
example was a lot clearer.  I had developed an application object and other
support objects, but I just copied the C code that I had tested first into the
initialize method.  It sort of worked, but the general concept seemed a little
strange.

Thanks again,

David
david.whitehurst@att.net



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