Re: Emitting and/or Catching a signal



On 3/30/2010 12:43 PM, michi7x7 wrote:
Am 2010-03-28 03:43, schrieb ArbolOne:
OS WinXP SP3
MinGW and MSYS= latest!
GCC
~~~~
Reading specs from D:/XWin/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special)
====================================================

OK, I give up!
I have been trying to emit a signal from one of my classes to another, but it has proven to be beyond me. I am not an expert C++ programmer let alone a GUI programmer, so bare with me please. Below is a snip of the source code; since the class is so specific and at a such early stage there aren't that many lines of code, nevertheless, my apology for the use of the band-width; in the future I will try to post the code on a URL site.
I would like to emphasize that any help and or observations are most welcome as well as an observation 

Now, the problem with my program is that when I tried to compile it it tells me that there is an error in "...\include\sigc++-2.0\sigc++\functor\stot.h in line 103
//// -- file.cpp SNIP ******
Menu::Menu() {
    ..........
    //Command bar
    RefActionGroup->add( Gtk::Action::create("MenuFile", "_File") );
    RefActionGroup->add( Gtk::Action::create("New", Gtk::Stock::NEW, "_New",        "Create a new fle"), sigc::mem_fun(*this, & Menu::onActionActivated));
       ..........
/******* THIS IS THE CODE CAUSING THE PROBLEM **************/
    RefActionGroup->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT,"Quit", "Exit application"),  sigc::mem_fun(*this, & Menu::signal_quit));
      .........
}


//// -- file.hpp SNIP ******
class Menu : virtual public Gtk::VBox {
public:
        //signal accessor
        typedef sigc::signal< my_enum::error_t> type_signal_end;
        type_signal_end signal_quit();

protected:
        type_signal_end m_signal_end1;
       .........
private:
        .........
    }; //class
========================
// tester.hpp
class Tester : virtual public Gtk::Window {
        public:
                  ....
        private:
        Menu menu;
        void quit(){this->hide();}
};
// tester.cpp
Tester::Tester(){
             ..............
            ///////////
            menu.signal_quit().connect( sigc::mem_fun(*this, &Tester::quit) );
           ///////////
           ................
}

Can any body help?

I think had the same Problem. For some reason WINDOWS is not defined, so it uses the wrong Syntax when defining the functions.
Just work your way through the Header-Files, you should be able to find these defines.


Is this true, can someone else in the list confirm this, it would be wrong to have something documented, but that only works for NON-WIN OSs, wouldn't it?


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