Project

General

Profile

User-selectable, tri-state WCheckBox

Added by Stefan Hainzl almost 9 years ago

Hello,

I've been trying to get a variation of the tri-state WCheckBox, which cycles through unchecked-part checked-checked as the user clicks on the element.

When using the changed signal to override the default behaviour the changed signal is fired twice due to the click and setting the state manually.

I did not even dare looking at changing WAbstractToggleButton, which seems to implement most of the logic, because I think it is the wrong place to start for only a particular situation.

Any suggestions highly welcome!

Thanks a lot & Best regards,

Stefan


Replies (8)

RE: User-selectable, tri-state WCheckBox - Added by Koen Deforche almost 9 years ago

Hey Stefan,

You shouldn't get a changed() when setting the value manually though. If you do, then that's an unexpected bug.

Can create a test case that reproduce this issue for you?

Regards,

koen

RE: User-selectable, tri-state WCheckBox - Added by Stefan Hainzl almost 9 years ago

Hello Koen,

Thanks for your attention.

Here is what I am doing:

In the constructor I connect changed

changed().connect(this,&tTSelectedSelector::checkstateChanged);

... to checkstateChanged which looks as follows:

void checkstateChanged()
    {
        if (userinitiated)
        {
            switch (checkstate)
            {
                case Wt::CheckState::Unchecked:
                {
                    checkstate = Wt::CheckState::PartiallyChecked;
                    break;
                }
                case Wt::CheckState::PartiallyChecked:
                {
                    checkstate = Wt::CheckState::Checked;
                    break;
                }
                case Wt::CheckState::Checked:
                {
                    checkstate = Wt::CheckState::Unchecked;
                    break;
                }
            }

            userinitiated = false;
            setCheckState(checkstate);
            checkstatesignal.emit(checkstate);
            userinitiated = true;
        }
    }

Here is the call stack of the first time:

#0  0x00000001013f9e81 in tTSelectedSelector::checkstateChanged() at /Users/stefanhainzl/Documents/Projects/TOM/Code/Development/projects/TOM_GUILib/common/TFilteredListView/TFilteredListView.h:35
#1  0x00000001013fce22 in boost::_mfi::mf0<void, tTSelectedSelector>::operator()(tTSelectedSelector*) const at /Developer/usr/share/boost_1_54_0/include/boost/bind/mem_fn_template.hpp:49
#2  0x00000001013fcd85 in void boost::_bi::list1<boost::_bi::value<tTSelectedSelector*> >::operator()<boost::_mfi::mf0<void, tTSelectedSelector>, boost::_bi::list1<Wt::NoClass&> >(boost::_bi::type<void>, boost::_mfi::mf0<void, tTSelectedSelector>&, boost::_bi::list1<Wt::NoClass&>&, int) at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind.hpp:253
#3  0x00000001013fccf2 in void boost::_bi::bind_t<void, boost::_mfi::mf0<void, tTSelectedSelector>, boost::_bi::list1<boost::_bi::value<tTSelectedSelector*> > >::operator()<Wt::NoClass>(Wt::NoClass&) at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind_template.hpp:32
#4  0x00000001013fca61 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf0<void, tTSelectedSelector>, boost::_bi::list1<boost::_bi::value<tTSelectedSelector*> > >, void, Wt::NoClass>::invoke(boost::detail::function::function_buffer&, Wt::NoClass) at /Developer/usr/share/boost_1_54_0/include/boost/function/function_template.hpp:153
#5  0x000000010027e51c in boost::function1<void, Wt::NoClass>::operator()(Wt::NoClass) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/function/function_template.hpp:766
#6  0x000000010027e505 in boost::signals2::detail::void_type boost::signals2::detail::call_with_tuple_args<boost::signals2::detail::void_type>::m_invoke<boost::function<void (Wt::NoClass)>, 0u, Wt::NoClass&>(void*, boost::function<void (Wt::NoClass)>&, boost::signals2::detail::unsigned_meta_array<0u>, std::__1::tuple<Wt::NoClass&>) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:92
#7  0x000000010027e505 in boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >::operator->() const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:81
#8  0x000000010027e4fc in boost::signals2::detail::void_type boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>::m_invoke<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> > >(boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> > const&, boost::signals2::detail::void_type const*) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:117
#9  0x000000010027e4fc in std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>::operator*() const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:109
#10 0x000000010027e4f9 in boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >::dereference() const at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/slot_call_iterator.hpp:82
#11 0x000000010027dbe8 in void boost::signals2::optional_last_value<void>::operator()<boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> > >(boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >) const [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/list:342
#12 0x000000010027dbd3 in boost::signals2::detail::signal_impl<void (Wt::NoClass), boost::signals2::optional_last_value<void>, int, std::__1::less<int>, boost::function<void (Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass)>, boost::signals2::mutex>::invocation_state::connection_bodies() [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/result_type_wrapper.hpp:64
#13 0x000000010027dba7 in boost::signals2::detail::signal_impl<void (Wt::NoClass), boost::signals2::optional_last_value<void>, int, std::__1::less<int>, boost::function<void (Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass)>, boost::signals2::mutex>::operator()(Wt::NoClass) at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/signal_template.hpp:245
#14 0x000000010027da18 in boost::signals2::signal<void (Wt::NoClass), boost::signals2::optional_last_value<void>, int, std::__1::less<int>, boost::function<void (Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass)>, boost::signals2::mutex>::operator()(Wt::NoClass) [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/signal_template.hpp:695
#15 0x000000010027da0a in Wt::EventSignal<Wt::NoClass>::processDynamic(Wt::JavaScriptEvent const&) at /Developer/usr/share/wt/src/Wt/WSignal:1142
#16 0x00000001005847e0 in Wt::WebSession::processSignal(Wt::EventSignalBase*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Wt::WebRequest const&, Wt::WebSession::SignalKind) [inlined] at /Developer/usr/share/wt/src/web/WebSession.C:2625
#17 0x0000000100584792 in Wt::WebSession::notifySignal(Wt::WEvent const&) at /Developer/usr/share/wt/src/web/WebSession.C:2599
#18 0x000000010058be98 in Wt::WebSession::notify(Wt::WEvent const&) at /Developer/usr/share/wt/src/web/WebSession.C:2160
#19 0x00000001005872fe in Wt::WebSession::handleRequest(Wt::WebSession::Handler&) at /Developer/usr/share/wt/src/web/WebSession.C:1509
#20 0x0000000100576e44 in Wt::WebController::handleRequest(Wt::WebRequest*) at /Developer/usr/share/wt/src/web/WebController.C:668
#21 0x000000010007b747 in boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>::operator()(Wt::WebController*, Wt::WebRequest*) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/bind/mem_fn_template.hpp:165
#22 0x000000010007b739 in void boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> >::operator()<boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>&, boost::_bi::list0&, int) [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind.hpp:313
#23 0x000000010007b729 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > >::operator()() [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind_template.hpp:20
#24 0x000000010007b729 in void boost::asio::asio_handler_invoke<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > >, ...) at /Developer/usr/share/boost_1_54_0/include/boost/asio/handler_invoke_hook.hpp:64
#25 0x000000010007b67c in boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/completion_handler.hpp:64
#26 0x000000010004d083 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/task_io_service_operation.hpp:37
#27 0x000000010004d06f in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/impl/task_io_service.ipp:384
#28 0x000000010004cc38 in boost::asio::detail::task_io_service::run(boost::system::error_code&) at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/impl/task_io_service.ipp:153
#29 0x0000000100333e44 in boost::asio::io_service::run() [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/asio/impl/io_service.ipp:59
#30 0x0000000100333e24 in Wt::WIOService::run() at /Developer/usr/share/wt/src/Wt/WIOService.C:180
#31 0x00000001005b8a78 in thread_proxy ()
#32 0x00007fff8cdcd899 in _pthread_body ()
#33 0x00007fff8cdcd72a in _pthread_start ()
#34 0x00007fff8cdd1fc9 in thread_start ()

... and here is the call stack when the changed-triggered function is called the second time:

#0  0x00000001013f9e81 in tTSelectedSelector::checkstateChanged() at /Users/stefanhainzl/Documents/Projects/TOM/Code/Development/projects/TOM_GUILib/common/TFilteredListView/TFilteredListView.h:35
#1  0x00000001013fce22 in boost::_mfi::mf0<void, tTSelectedSelector>::operator()(tTSelectedSelector*) const at /Developer/usr/share/boost_1_54_0/include/boost/bind/mem_fn_template.hpp:49
#2  0x00000001013fcd85 in void boost::_bi::list1<boost::_bi::value<tTSelectedSelector*> >::operator()<boost::_mfi::mf0<void, tTSelectedSelector>, boost::_bi::list1<Wt::NoClass&> >(boost::_bi::type<void>, boost::_mfi::mf0<void, tTSelectedSelector>&, boost::_bi::list1<Wt::NoClass&>&, int) at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind.hpp:253
#3  0x00000001013fccf2 in void boost::_bi::bind_t<void, boost::_mfi::mf0<void, tTSelectedSelector>, boost::_bi::list1<boost::_bi::value<tTSelectedSelector*> > >::operator()<Wt::NoClass>(Wt::NoClass&) at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind_template.hpp:32
#4  0x00000001013fca61 in boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void, boost::_mfi::mf0<void, tTSelectedSelector>, boost::_bi::list1<boost::_bi::value<tTSelectedSelector*> > >, void, Wt::NoClass>::invoke(boost::detail::function::function_buffer&, Wt::NoClass) at /Developer/usr/share/boost_1_54_0/include/boost/function/function_template.hpp:153
#5  0x000000010027e51c in boost::function1<void, Wt::NoClass>::operator()(Wt::NoClass) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/function/function_template.hpp:766
#6  0x000000010027e505 in boost::signals2::detail::void_type boost::signals2::detail::call_with_tuple_args<boost::signals2::detail::void_type>::m_invoke<boost::function<void (Wt::NoClass)>, 0u, Wt::NoClass&>(void*, boost::function<void (Wt::NoClass)>&, boost::signals2::detail::unsigned_meta_array<0u>, std::__1::tuple<Wt::NoClass&>) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:92
#7  0x000000010027e505 in boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >::operator->() const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:81
#8  0x000000010027e4fc in boost::signals2::detail::void_type boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>::m_invoke<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> > >(boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> > const&, boost::signals2::detail::void_type const*) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:117
#9  0x000000010027e4fc in std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>::operator*() const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/variadic_slot_invoker.hpp:109
#10 0x000000010027e4f9 in boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >::dereference() const at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/slot_call_iterator.hpp:82
#11 0x000000010027dbe8 in void boost::signals2::optional_last_value<void>::operator()<boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> > >(boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, Wt::NoClass>, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (Wt::NoClass), boost::function<void (Wt::NoClass)> >, boost::signals2::mutex> >) const [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/list:342
#12 0x000000010027dbd3 in boost::signals2::detail::signal_impl<void (Wt::NoClass), boost::signals2::optional_last_value<void>, int, std::__1::less<int>, boost::function<void (Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass)>, boost::signals2::mutex>::invocation_state::connection_bodies() [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/result_type_wrapper.hpp:64
#13 0x000000010027dba7 in boost::signals2::detail::signal_impl<void (Wt::NoClass), boost::signals2::optional_last_value<void>, int, std::__1::less<int>, boost::function<void (Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass)>, boost::signals2::mutex>::operator()(Wt::NoClass) at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/signal_template.hpp:245
#14 0x000000010027da18 in boost::signals2::signal<void (Wt::NoClass), boost::signals2::optional_last_value<void>, int, std::__1::less<int>, boost::function<void (Wt::NoClass)>, boost::function<void (boost::signals2::connection const&, Wt::NoClass)>, boost::signals2::mutex>::operator()(Wt::NoClass) [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/signals2/detail/signal_template.hpp:695
#15 0x000000010027da0a in Wt::EventSignal<Wt::NoClass>::processDynamic(Wt::JavaScriptEvent const&) at /Developer/usr/share/wt/src/Wt/WSignal:1142
#16 0x00000001005847e0 in Wt::WebSession::processSignal(Wt::EventSignalBase*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Wt::WebRequest const&, Wt::WebSession::SignalKind) [inlined] at /Developer/usr/share/wt/src/web/WebSession.C:2625
#17 0x0000000100584792 in Wt::WebSession::notifySignal(Wt::WEvent const&) at /Developer/usr/share/wt/src/web/WebSession.C:2599
#18 0x000000010058be98 in Wt::WebSession::notify(Wt::WEvent const&) at /Developer/usr/share/wt/src/web/WebSession.C:2160
#19 0x00000001005872fe in Wt::WebSession::handleRequest(Wt::WebSession::Handler&) at /Developer/usr/share/wt/src/web/WebSession.C:1509
#20 0x0000000100576e44 in Wt::WebController::handleRequest(Wt::WebRequest*) at /Developer/usr/share/wt/src/web/WebController.C:668
#21 0x000000010007b747 in boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>::operator()(Wt::WebController*, Wt::WebRequest*) const [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/bind/mem_fn_template.hpp:165
#22 0x000000010007b739 in void boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> >::operator()<boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>&, boost::_bi::list0&, int) [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind.hpp:313
#23 0x000000010007b729 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > >::operator()() [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/bind/bind_template.hpp:20
#24 0x000000010007b729 in void boost::asio::asio_handler_invoke<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > >, ...) at /Developer/usr/share/boost_1_54_0/include/boost/asio/handler_invoke_hook.hpp:64
#25 0x000000010007b67c in boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf1<void, Wt::WebController, Wt::WebRequest*>, boost::_bi::list2<boost::_bi::value<Wt::WebController*>, boost::_bi::value<http::server::HTTPRequest*> > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/completion_handler.hpp:64
#26 0x000000010004d083 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/task_io_service_operation.hpp:37
#27 0x000000010004d06f in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/impl/task_io_service.ipp:384
#28 0x000000010004cc38 in boost::asio::detail::task_io_service::run(boost::system::error_code&) at /Developer/usr/share/boost_1_54_0/include/boost/asio/detail/impl/task_io_service.ipp:153
#29 0x0000000100333e44 in boost::asio::io_service::run() [inlined] at /Developer/usr/share/boost_1_54_0/include/boost/asio/impl/io_service.ipp:59
#30 0x0000000100333e24 in Wt::WIOService::run() at /Developer/usr/share/wt/src/Wt/WIOService.C:180
#31 0x00000001005b8a78 in thread_proxy ()
#32 0x00007fff8cdcd899 in _pthread_body ()
#33 0x00007fff8cdcd72a in _pthread_start ()
#34 0x00007fff8cdd1fc9 in thread_start ()

I did a line-by-line comparison of the stack and it is identical, but in the second time stateChanged_ is true, while the first time it is false.

I could also confirm that just calling setCheckState does not trigger changed.

Please let me know what else I can provide.

Thanks a lot & Best regards,

Stefan

RE: User-selectable, tri-state WCheckBox - Added by Stefan Hainzl almost 9 years ago

Hello Koen,

After finally trying out Firefox, it appears the problem is Safari specific (the Safari workaround?).

I also tried to strip my code down to not even setting the overriden state, but even then changed apparently was called twice.

Shall I raise a bug report for this?

Thanks & Best regards,

Stefan

RE: User-selectable, tri-state WCheckBox - Added by Koen Deforche almost 9 years ago

Hey Stefan,

Thanks for digging into this, and yes, please file a bug. We'll want to fix this for 3.3.2.

Regards,

koen

RE: User-selectable, tri-state WCheckBox - Added by Stefan Hainzl almost 9 years ago

Thanks Koen,

I have raised http://redmine.webtoolkit.eu/issues/2701.

Is there an ETA for 3.3.2?

Thanks & Best regards,

Stefan

RE: User-selectable, tri-state WCheckBox - Added by Koen Deforche almost 9 years ago

Hey Stefan,

Thanks. We hope to have a final 3.3.2 after the next RC, which we plan to have this early week (e.g. tomorrow or wednesday).

Regards,

koen

RE: User-selectable, tri-state WCheckBox - Added by Stefan Hainzl almost 9 years ago

Wow, that's excellent!

As a feature request, would it be possible to have a real tri-state Check Box? With my current solution I still see the checked state flickering when transitioning to partially checked ...

Thanks!

Stefan

RE: User-selectable, tri-state WCheckBox - Added by Koen Deforche almost 9 years ago

Hey Stefan,

Surely that's a useful feature, so please file a request.

To avoid the flicker, you could do the update in JavaScript, but indeed that requires relying on some internal detail of how an indeterminate is actually represented in the browser.

Regards,

koen

    (1-8/8)