Problem adding tooltips (in linux) Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
papafreebird
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Apr 02, 2008 6:54 pm
Location: United States

Problem adding tooltips (in linux)

Post by papafreebird »

I am having problems adding tooltips using wxGTK for linux.

I have tried
checkbox->SetToolTip("test");
checkbox->SetToolTip(_("test"));
checkbox->SetToolTip(wxT("test"));

and get no joy. All compile with no problems I just don't get tips on mouseover of the checkbox. Any help would be appreciated.
Last edited by papafreebird on Fri Apr 18, 2008 9:12 pm, edited 1 time in total.
SteveDowd
Experienced Solver
Experienced Solver
Posts: 62
Joined: Wed Sep 28, 2005 3:16 pm
Location: Florida

Post by SteveDowd »

you could also try _T("test");
I'm pretty sure that _T() and wxT() are the same, but its worth a shot.
Also, are you setting your tooltip in your createControls() function?
papafreebird
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Apr 02, 2008 6:54 pm
Location: United States

Post by papafreebird »

SteveDowd wrote:you could also try _T("test");
I'm pretty sure that _T() and wxT() are the same, but its worth a shot.
Also, are you setting your tooltip in your createControls() function?
Tried _T just now and no luck.
Not sure about the createcontrols funtion. I am using codeblocks to create my form and it has a way to set the properties of an object so I set the tooltip text there and codeblocks did the rest. When that didn't work I tried it manually like i mentioned above.
SteveDowd
Experienced Solver
Experienced Solver
Posts: 62
Joined: Wed Sep 28, 2005 3:16 pm
Location: Florida

Post by SteveDowd »

CreateControls is something that DialogBlocks does for you. its similar to CodeBlocks. i was just making sure you werent adding a tooltip some where that it wasnt stepping into. but if everything is drawing like it should, then you should be good. Maybe there is something weird with linux and tooltips. But i dont really know.
papafreebird
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Apr 02, 2008 6:54 pm
Location: United States

Post by papafreebird »

Well I'm sure it is probably something I'm doing wrong or a setting I'm missing in codeblocks. :lol:

As far as I know tooltips work fine in linux as an app I use from time to time in linux that is written in gtk does have tooltips.
Deschamps
Knows some wx things
Knows some wx things
Posts: 30
Joined: Tue May 01, 2007 12:16 pm

Post by Deschamps »

papafreebird wrote:Well I'm sure it is probably something I'm doing wrong or a setting I'm missing in codeblocks. :lol:

As far as I know tooltips work fine in linux as an app I use from time to time in linux that is written in gtk does have tooltips.
I'm using lots of tooltips for my controls (always with the wxT("tip") form) and I've also noticed that in Linux (wxGTK 2.8.7 Unicode), it is running fine for wxTextCtrl, wxColourPickerCtrl, wxSlider, ... and so, but not for wxCheckBox, as you've commented.

I suppose that it's an issue related to this control in wxGTK, but I should confirm this. In any case, you're not alone :D

Regards.
Misquotations are the only quotations that are never misquoted
papafreebird
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Apr 02, 2008 6:54 pm
Location: United States

Post by papafreebird »

Well that just stinks as checkboxes are primarily what I need the tooltips for. Hmmm. Hopefully I can find a workaround.
Deschamps
Knows some wx things
Knows some wx things
Posts: 30
Joined: Tue May 01, 2007 12:16 pm

Post by Deschamps »

Well. I've just done a dumb test creating a sample app from the C::B wizards and adding some controls to the frame (using wxFormBuider)... and all tooltips have been shown without problems, including checkboxes :shock:

I can't understand why they aren't showed for the two apps I run before posting my previous message.
Misquotations are the only quotations that are never misquoted
papafreebird
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Apr 02, 2008 6:54 pm
Location: United States

Post by papafreebird »

Must have been an issue with the way that I had created the project because I have also just created a small test project and was able to use tooltips just fine.

Thanks for all who have helped.
papafreebird
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Apr 02, 2008 6:54 pm
Location: United States

Post by papafreebird »

Here is the weird thing. Objects inside staticboxes don't work with tooltips but if you place an object outside of staticboxes then tooltips work just fine. Weird.
Deschamps
Knows some wx things
Knows some wx things
Posts: 30
Joined: Tue May 01, 2007 12:16 pm

Post by Deschamps »

papafreebird wrote:(..) Objects inside staticboxes don't work with tooltips but if you place an object outside of staticboxes then tooltips work just fine (..)
What do you mean?

The first test application I run before posting have some controls inside a wxStaticBoxSizer. To be concrete: two wxColourPickerControl, four wxCheckBox, four wxSlider and seven wxTextControl. All these controls (the sizer, in fact) are placed inside a wxPanel, and all of them show their tooltips, except for the checkboxes.

I tried recompiling the whole project again, and ... all remain as before. No tooltips for the checkboxes. But with the sample created from the C::B wizard (and edited with wxFormBuilder) that I commented in my last post, all is running fine.

The only difference I've seen is that in the fisrt case, I'm using a main frame created from an inherited class, and the second is using directly the class generated with wxFormBuilder. But the source code is almost identical (in a design sense).

Regards.
Misquotations are the only quotations that are never misquoted
Post Reply