From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 3498 invoked from network); 19 Nov 1998 23:02:08 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 19 Nov 1998 23:02:08 -0000 Received: from norad.dodds.net (scorpio@westgate-190-203.res.iastate.edu [129.186.190.203]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id SAA21176 for ; Thu, 19 Nov 1998 18:02:07 -0500 Received: from localhost (scorpio@localhost) by norad.dodds.net (8.8.5/8.8.5) with SMTP id RAA04662; Thu, 19 Nov 1998 17:02:07 -0600 Date: Thu, 19 Nov 1998 17:02:06 -0600 (CST) From: Bibek Sahu To: axp-list@redhat.com cc: Shaw Terwilliger Subject: Re: C++ gurus; AbiWord pointer casting on Alpha In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I spoke too soon. It allows menus to be displayed, but activating a menu item still causes a segfault. However, that is a different (though related) problem. - Bibek On Thu, 19 Nov 1998, Bibek Sahu wrote: > > Ok, scratch that, I was wrong: there is no 'callback_data' member. > > I looked at the Gimp source to see how it was done there (since it > does work fine on my machine), and discovered that AbiWord was being done > in a fundamentally incorrect manner. > > Gotta love that GTK documentation, huh? I had to dig through the > gtk headers and another program's source code to figure this out... THAT I > consider to be fundamentally Wrong. ;-) > > At any rate, since the menuing code was already using the > UT_Vectors, the fix was trivial. A patch is attached. Menus work for me > now; hurray! :-) > > However, it still does segfault on exit. I'll look into that > later. > > - Bibek > > On Mon, 16 Nov 1998, Shaw Terwilliger wrote: > > > Bibek Sahu wrote: > > > Although I don't know the code well enough to be positive, it > > > appears that 'callback_action' is supposed to be data rather than a > > > function pointer. The 'callback_data' member, defined to be of type > > > gpointer, which is in all the structures that include callback_action > > > might be more appropriate if you need a pointer. > > > > Hm... I'm still wondering if it's a compiler thing (testgtk is C, > > we're using C++; odd chance that the C++ compiler is doing much > > different > > casting here). If we're abusing that member (storing pointers instead > > of, say, an index to a list of functions), the GTK guys sure haven't > > told me so. I asked on the list early this morning, and on the IRC > > channel. None of them seem to really know; the total lack of > > documentation > > on GTK+ doesn't help much. :) > > > > I'll take a look at this some more and try to get back to the Alpha > > list about it. > > > > -- > > Shaw Terwilliger > > >