subscribe event to DragDropSlot

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

subscribe event to DragDropSlot

Postby Durin » Wed Aug 01, 2007 20:03

I have a problem subscribing action to an event. I want to subscribe a method from a different class, which the subscriber function is in. The following method is in class1 and I want to subscribe to the CEGUI::Window::EventDragDropItemLeaves a method out of class2. The compiler says there is no constructor which accepts 2 arguments, so I can´t compile the program. But by subscribing a method of class1 to CEGUI::Window::EventDragDropItemEnters there are no probelms. Here is the code:

Code: Select all

   CEGUI::Window* class1::createDragDropSlot(CEGUI::Window* parent, const CEGUI::UVector2& position, const CEGUI::UVector2& size, short parentname){
CEGUI::Window* slot = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticImage");
    parent->addChildWindow(slot);
    slot->setPosition(position);
    slot->setSize(size);
slot->subscribeEvent(CEGUI::Window::EventDragDropItemEnters, CEGUI::Event::Subscriber(&class1::handleDragEnter, this));
   slot->subscribeEvent(CEGUI::Window::EventDragDropItemLeaves, CEGUI::Event::Subscriber(&class2::handleDragLeave, this));
   slot->subscribeEvent(CEGUI::Window::EventDragDropItemDropped, CEGUI::Event::Subscriber(&class2::handleDragDropped, this));

    return slot;
   }


My Question now: What is wrong by using a method from another class then the subscribing function is in?

Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests