Re: signal



Mark Roberts wrote:
> Dear pch0317,
>
>> Hi list
>> I have problem. I can't find which signal is related to emit when I move
>> cursor above widget.
>
>> I use:
>> widget.signal_button_press_event().connect(sigc::mem_fun(*this,
>> &Something1)); when I want to use Something1 function when i click on
>> widget and
>
>> widget.signal_button_release_event().connect(sigc::mem_fun(*this,
>> &Something2)); when I want to use Something2 function when I release
>> mouse button.
>
>> How I must type to use Something3 when I move cursor above widget.
>
> For when mouse pointer moves from outside the widget to inside, use
> signal_enter_notify_event(). For when it moves back outside, use
> signal_leave_notify_event(). In order to catch any mouse movement
> within your widget, use signal_motion_notify_event().
>
> Remember that your users might not all be using a mouse. In
> particular, lots of people use the keyboard to navigate dialogs.
>
> I hope you are all having good weather (though I know it is unlikely).
> Mark
>
Thank Mark
I choose signal_motion_notify_event() but when I compile my program
...
eBox.set_events(Gdk::ALL_EVENTS_MASK);
eBox.signal_motion_notify_event().connect(sigc::mem_fun(*this,
&Interfejs::about));

...
the error occur:
/usr/include/sigc++-2.0/sigc++/functors/slot.h: In static member
function ‘static T_return sigc::internal::slot_call1<T_functor,
T_return, T_arg1>::call_it(sigc::internal::slot_rep*, typename
sigc::type_trait<T_arg3>::take) [with T_functor =
sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’:
/usr/include/sigc++-2.0/sigc++/functors/slot.h:144:   instantiated from
‘static void* (* sigc::internal::slot_call1<T_functor, T_return,
T_arg1>::address())(void*) [with T_functor =
sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:529:   instantiated from
‘sigc::slot1<T_return, T_arg1>::slot1(const T_functor&) [with T_functor
= sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1157:   instantiated from
‘sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil,
sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor
= sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
interface.cpp:163:   instantiated from here
/usr/include/sigc++-2.0/sigc++/functors/slot.h:137: error: void value
not ignored as it ought to be
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h: In member
function ‘typename
sigc::adaptor_functor<T_functor>::deduce_result_type<T_arg1, void, void,
void, void, void, void>::type
sigc::adaptor_functor<T_functor>::operator()(T_arg1) const [with T_arg1
= GdkEventMotion* const&, T_functor = sigc::bound_mem_functor0<void,
Interfejs>]’:
/usr/include/sigc++-2.0/sigc++/functors/slot.h:137:   instantiated from
‘static T_return sigc::internal::slot_call1<T_functor, T_return,
T_arg1>::call_it(sigc::internal::slot_rep*, typename
sigc::type_trait<T_arg3>::take) [with T_functor =
sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:144:   instantiated from
‘static void* (* sigc::internal::slot_call1<T_functor, T_return,
T_arg1>::address())(void*) [with T_functor =
sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:529:   instantiated from
‘sigc::slot1<T_return, T_arg1>::slot1(const T_functor&) [with T_functor
= sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1157:   instantiated from
‘sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil,
sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor
= sigc::bound_mem_functor0<void, Interfejs>, T_return = bool, T_arg1 =
GdkEventMotion*]’
interface.cpp:163:   instantiated from here
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:84: error: no
match for call to ‘(sigc::bound_mem_functor0<void, Interfejs>)
(GdkEventMotion* const&)’
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1786: note: candidates
are: T_return sigc::bound_mem_functor0<T_return, T_obj>::operator()()
const [with T_return = void, T_obj = Interfejs]
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:84: error:
return-statement with a value, in function returning 'void'

What am I doing wrong?


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