RE: [gtkmm] gtkmm and vc++6



I use gtkmm 1.2 with vc++6/sp5 nearly every day.  I also do cross platform
apps.  I had to solve this problem some time ago.  The problem is in the
signature for the slot.  Under normal conditions using a decent compiler,
the slot takes a pointer to an object in the first parameter.  However,
because v++6 does not support partial specification, the first parameter
must be a reference.  The following is how I normally solve this problem.
This was adapted from the Calendar example.

#ifdef SIGC_CXX_PARTIAL_SPEC
    window->destroy.connect(bind(slot(this, &Calendar::destroy_widget),
font_dialog));
    window->get_ok_button()->clicked.connect(slot(this,
&Calendar::font_selection_ok));
    window->get_cancel_button()->clicked.connect(bind(slot(this,
&Calendar::destroy_widget), font_dialog));
#else
    window->destroy.connect(bind(slot(*this, &Calendar::destroy_widget),
font_dialog));
    window->get_ok_button()->clicked.connect(slot(*this,
&Calendar::font_selection_ok));
    window->get_cancel_button()->clicked.connect(bind(slot(*this,
&Calendar::destroy_widget), font_dialog));
#endif

If you define your signal connections in this way, it will work for all
compilers.

Good luck

John Burris

P. S.   There has been no attempt to get gtkmm 2.0 to work with vc++6 as
yet.  Unfortunately, I don't know templates well enough for help with this.
I tried to understand SigC, but it was hopeless.  It may be some time until
we can use Microsoft tools with gtkmm 2.0.  I tried to us gcc but I couldn't
find a useable visual debugger for it on window.  And unfortunately, I am a
slave a slave to visual debuggers.

-----Original Message-----
From: gtkmm-list-admin gnome org [mailto:gtkmm-list-admin gnome org]On
Behalf Of Eric Ross
Sent: Monday, July 08, 2002 11:16 AM
To: gtkmm-list gnome org
Subject: [gtkmm] gtkmm and vc++6

Hi all..

I've using gtkmm for some time under linux, and it works wonderful. Now,
im working in a cross platform proyect, and i'd like to use the same
source code for both. Currently im using plain gtk+ and it works, but i'd
like to try gtkmm.

I compiled and installed sigc++ and gtkmm with no problem using vc++6/sp5,
but when i try to compile a minimal example, the compiler complains it
cant find a good version of 'slot'. The example compiles just fine in the
linux box using gcc2.95.3.

I dont have right here the exact output from the compiler but i can post
it if needed.

I'd like to know if someone have done it before. Maybe i'm asking a FAQ ?

Thanks in advance.

--
Word is no doubt faster for oppressed office workers and others who just
need to throw something together and get in the post fast without worrying
about aesthetics and document structure.

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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