0
$\begingroup$

Rosanswers logo

I have implemented tooltips for buttons and such in my wxWidgets GUI, but they do not show. It has worked before, but I cannot get it to work now regardless of version of ROS and Ubuntu (tested electric and fuerte in 11.10 and 12.04). Implementing tooltips the same way in a simple GUI without any ROS code works fine. I use the setToolTip() method like this:

wxButton* myButton = new wxButton(...);
myButton->SetToolTip(_("this is a tooltip"));

Any suggestions on what might be wrong?


Originally posted by Ola Ringdahl on ROS Answers with karma: 328 on 2012-10-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I just found why the tooltips was not shown. I update the tooltip of one button in a callback (with status information from the callback). If this update is done too often (like >1 Hz) no tooltips are shown (even for the other elements which tooltips are not updated). When removing SetToolTip() in the callback (or setting the frequency really low) all other tooltips are shown again.

Anyone know how to update a tooltip without this error happening?


Originally posted by Ola Ringdahl with karma: 328 on 2012-10-29

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Lorenz on 2012-10-29:
I guess the problem has something to do with multithreading. ROS callbacks are executed in the spin thread an not in wxWidget's main thread. However, I would say, you should only change wxWidget properties in wxWidget's main loop. That should avoid the problem.

Comment by Ola Ringdahl on 2012-10-29:
Actually I tried to change the tooltip from the wxWidgets timer event, which I guess is the closest thing to a main loop (I run spinOnce() there every 100ms). The problem remains as long as the update frequency is higher than 1 Hz.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.