context help and prob.

My app heavily used context help and on ms-win help frame is showing
help text without any problem. How ever on Linux it seems the width of
generated help frame is constant and it actually adjust it's height to
fit in the text. This breaks the help string badly and string looses
it's readability.

For example:

# Set context help.

self.SetHelpText("Node Browser:\

                    \nYou can drag and drop a image node to canvas.\

                    \nRight click context menu is also available.")

On ms-win help frame shows help in three lines as exactly it has been
defined but on Linux it breaks the string to fit in a certain width
which user has no control over it.

I think it's SWIG wrapped class and modifications won't be possible.

Any pointers will be greatly appreciated.

Thanks

#---- System Information ----#
System: Linux 2.6.31-14-generic i686
Python Version: 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11)
[GCC 4.4.1]
wxPython Version: 2.8.10.1 (gtk2-unicode)
wxPython Info: (__WXGTK__, wxGTK, unicode, gtk2, wx-assertions-off,
SWIG-1.3.29)
Python Encoding: Default=UTF-8 File=UTF-8
wxPython Encoding: utf-8
System Architecture: 32bit i686
Byte order: little
Frozen: False
#---- End System Information ----#

Yes, the width and behavior of the native tooltips varies across platforms. IIRC on Windows it sets the width to the length of the first line in the first tooltip shown, which can cause some problems if you have longer second lines or later tooltips are very different in size. (I think some of that may have already been fixed, and there has been some recent discussion about the rest of it.)

What I've done in the past is to simply remove the \n's from the text when running on non-MSW platforms, and let them wrap it however they want. The other option of course is to not use native tooltips, but to show the text yourself using something like wx.TipWindow.

···

On 2/21/10 7:39 AM, King wrote:

My app heavily used context help and on ms-win help frame is showing
help text without any problem. How ever on Linux it seems the width of
generated help frame is constant and it actually adjust it's height to
fit in the text. This breaks the help string badly and string looses
it's readability.

For example:

# Set context help.

self.SetHelpText("Node Browser:\

                     \nYou can drag and drop a image node to canvas.\

                     \nRight click context menu is also available.")

On ms-win help frame shows help in three lines as exactly it has been
defined but on Linux it breaks the string to fit in a certain width
which user has no control over it.

--
Robin Dunn
Software Craftsman

No difference between self.SetHelpText & wx.TipWindow. They both
generate the same size of frame.
Any other hack or idea? I must solve this problem.

Prashant

Have you tried removing the \n's from the text on GTK as I suggested so it can do the word-wrap itself?

Have you looked at wx.lib.agw.supertooltip?

···

On 2/23/10 10:33 AM, King wrote:

No difference between self.SetHelpText& wx.TipWindow. They both
generate the same size of frame.
Any other hack or idea? I must solve this problem.

--
Robin Dunn
Software Craftsman

Hi,

No difference between self.SetHelpText & wx.TipWindow. They both
generate the same size of frame.
Any other hack or idea? I must solve this problem.

Prashant

wx.TipWindow is fairly customizable in terms of what you can write and
how you write it and how you position it on the screen. If for some
reason it doesn't work for you (and I am not sure you really explored
all the possibilities of wx.TipWindow), try SuperToolTip in
wx.lib.agw. However, I strongly suggest you to post a small runnable
sample that demonstrates the problems you are having with
wx.TipWindow.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 23 February 2010 18:33, King wrote: