ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Tooltips in wxWidgets not working

asked 2012-10-17 22:59:17 -0500

updated 2014-01-28 17:13:58 -0500

ngrennan gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-10-29 06:11:32 -0500

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?

edit flag offensive delete link more

Comments

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.

Lorenz gravatar image Lorenz  ( 2012-10-29 06:21:45 -0500 )edit

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.

Ola Ringdahl gravatar image Ola Ringdahl  ( 2012-10-29 22:51:14 -0500 )edit

Question Tools

Stats

Asked: 2012-10-17 22:59:17 -0500

Seen: 834 times

Last updated: Oct 29 '12