How to do tooltips in ObjectListView

Hi,

Maybe I’m being dense, but I can’t find anything about how to set tooltips in ObjectListView. Does anyone know how to create one for each item in the control?

I am on Windows and can use wxPython 2.8 or 2.9.

Thanks,
Mike Driscoll

Hi Mike,

···

On 10/12/2013 21:15, Mike Driscoll wrote:

Hi,

Maybe I'm being dense, but I can't find anything about how to set tooltips in ObjectListView. Does anyone know how to create one for each item in the control?

Tooltips on the column or on the individual listitem?

IIRC the first one is only possible on Windows see link to wiki below and I don't think the second one is available out of the box.

http://wiki.wxpython.org/wxListCtrl%20ToolTips

Werner

The list item. I was beginning to suspect it wasn’t possible…although the C++ ObjectListView has it built-in, so I was hoping.

Mike

···

On Wednesday, December 11, 2013 2:58:45 AM UTC-6, werner wrote:

Hi Mike,

On 10/12/2013 21:15, Mike Driscoll wrote:

Hi,

Maybe I’m being dense, but I can’t find anything about how to set
tooltips in ObjectListView. Does anyone know how to create one for
each item in the control?

Tooltips on the column or on the individual listitem?

IIRC the first one is only possible on Windows see link to wiki below
and I don’t think the second one is available out of the box.

http://wiki.wxpython.org/wxListCtrl%20ToolTips

Werner

Hi Mike,

...

The list item. I was beginning to suspect it wasn't possible...although the C++ ObjectListView has it built-in, so I was hoping.

You mean the C# (.net) version? I think that one is using a different native listctrl, i.e. not the same one then wx is using.

Maybe it available with the DVC_* controls in 2.9?

Werner

···

On 11/12/2013 15:27, Mike Driscoll wrote:

Oh, is it C#? I didn’t know that. I don’t know if it’s available in DVC or not. I like OLV too much to switch to that right now though.

Mike

···

On Wednesday, December 11, 2013 8:33:22 AM UTC-6, werner wrote:

Hi Mike,

On 11/12/2013 15:27, Mike Driscoll wrote:

The list item. I was beginning to suspect it wasn’t
possible…although the C++ ObjectListView has it built-in, so I was
hoping.

You mean the C# (.net) version? I think that one is using a different
native listctrl, i.e. not the same one then wx is using.

Maybe it available with the DVC_* controls in 2.9?

Werner

Mike Driscoll wrote

Hi,

Maybe I'm being dense, but I can't find anything about how to set tooltips
in ObjectListView. Does anyone know how to create one for each item in the
control?

The ObjectListView
<http://objectlistview.sourceforge.net/python/index.html&gt; control is a
wrapper of wx.ListCtrl, so it's possible to show a tool tip when selected a
list item as SetToolTip is a base method of wx.Window(C++ version). The
attachment is a demo code to show a tool tip in objectlist view.

The key points.
1. bind the EVT_LIST_ITEM_SELECTED event
2. set the tooltip for the event source object SetToolTipString('List view
item tool tip')

Most of the demo code is a sample code copied from here
<http://www.blog.pythonlibrary.org/2009/12/23/wxpython-using-objectlistview-instead-of-a-listctrl/&gt;
, I just add the binding event and the handler method.

objectlistview_tooltip_demo.py
<http://wxpython-users.1045709.n5.nabble.com/file/n5719380/objectlistview_tooltip_demo.py&gt;

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/How-to-do-tooltips-in-ObjectListView-tp5719370p5719380.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Hi Mike,

...

Oh, is it C#? I didn't know that. I don't know if it's available in DVC or not. I like OLV too much to switch to that right now though.

Yeap, not ready to move away from OLV, although I am a bit concerned about lack of updates. Up to 2.9.5 and 2.9.5 Phoenix the necessary changes where not that big (whatever I had to do is up in the MediaLocker repo) but I wonder how much work will be needed to get it to work with wxPython 3.0 and Python 3.x.

Werner

···

On 11/12/2013 17:00, Mike Driscoll wrote:

Hi,

···

On Thursday, December 12, 2013 12:55:13 AM UTC-6, Erxin wrote:

Mike Driscoll wrote

Hi,

Maybe I’m being dense, but I can’t find anything about how to set tooltips
in ObjectListView. Does anyone know how to create one for each item in the
control?

The ObjectListView

<http://objectlistview.sourceforge.net/python/index.html> control is a

wrapper of wx.ListCtrl, so it’s possible to show a tool tip when selected a

list item as SetToolTip is a base method of wx.Window(C++ version). The

attachment is a demo code to show a tool tip in objectlist view.

The key points.

  1. bind the EVT_LIST_ITEM_SELECTED event
  2. set the tooltip for the event source object SetToolTipString('List view

item tool tip’)

Most of the demo code is a sample code copied from here

<http://www.blog.pythonlibrary.org/2009/12/23/wxpython-using-objectlistview-instead-of-a-listctrl/>
, I just add the binding event and the handler method.

objectlistview_tooltip_demo.py

<http://wxpython-users.1045709.n5.nabble.com/file/n5719380/objectlistview_tooltip_demo.py>

It’s always fun to see someone take one of my tutorials and use it as an example. That’s a pretty neat little trick.

Thanks for the tip!

Mike

Hi Werner,

···

On Thursday, December 12, 2013 2:49:09 AM UTC-6, werner wrote:

Hi Mike,

On 11/12/2013 17:00, Mike Driscoll wrote:

Oh, is it C#? I didn’t know that. I don’t know if it’s available in
DVC or not. I like OLV too much to switch to that right now though.

Yeap, not ready to move away from OLV, although I am a bit concerned
about lack of updates. Up to 2.9.5 and 2.9.5 Phoenix the necessary
changes where not that big (whatever I had to do is up in the
MediaLocker repo) but I wonder how much work will be needed to get it to
work with wxPython 3.0 and Python 3.x.

Werner

Yeah…I have a feeling one of us users is going to have to port it. I haven’t dug into the code, but I’m guessing it’s fairly complicated.

Mike

Mike Driscoll wrote

Hi,

Mike Driscoll wrote
> Hi,
>
> Maybe I'm being dense, but I can't find anything about how to set
tooltips
> in ObjectListView. Does anyone know how to create one for each item in
the
> control?

The ObjectListView
&lt;http://objectlistview.sourceforge.net/python/index.html&gt; control
is a
wrapper of wx.ListCtrl, so it's possible to show a tool tip when selected
a
list item as SetToolTip is a base method of wx.Window(C++ version). The
attachment is a demo code to show a tool tip in objectlist view.

The key points.
1. bind the EVT_LIST_ITEM_SELECTED event
2. set the tooltip for the event source object SetToolTipString('List
view
item tool tip')

Most of the demo code is a sample code copied from here
<
http://www.blog.pythonlibrary.org/2009/12/23/wxpython-using-objectlistview-instead-of-a-listctrl/&gt;

, I just add the binding event and the handler method.

objectlistview_tooltip_demo.py
<
http://wxpython-users.1045709.n5.nabble.com/file/n5719380/objectlistview_tooltip_demo.py&gt;

It's always fun to see someone take one of my tutorials and use it as an
example. That's a pretty neat little trick.

Thanks for the tip!

Mike

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to

wxpython-users+unsubscribe@

.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Mike,

Wow, you are the guy who wrote the blog, it's really helpful when I start to
use wx. It's glade to see you at here. Nice to meat you at wxpython-user,
I'm a freshman. :^D Thank you for your helps too.

Erxin

···

On Thursday, December 12, 2013 12:55:13 AM UTC-6, Erxin wrote:

-----
I become to love to write program ever since got in university. The programming languages I have learned from collage lessons are C and Assembly. My interest drive me to learn all the other things. Currently I'm working at Ideal Energy (http://www.idealenergy.com) as a software developer.
My undergraduate degree is Electrical Engineering and Automation. Graduate degree is Power Electronics and Power Drives. Personal favorite programming languages are C, C++, C# and Python.
--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/How-to-do-tooltips-in-ObjectListView-tp5719370p5719387.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Hi Erxin,

Hi Mike,

Wow, you are the guy who wrote the blog, it’s really helpful when I start to

use wx. It’s glade to see you at here. Nice to meat you at wxpython-user,

I’m a freshman. :^D Thank you for your helps too.

Erxin

After reading your example, I decided to write an article based on it: http://www.blog.pythonlibrary.org/2013/12/12/wxpython-adding-tooltips-objectlistview/

I always enjoy hearing from my readers. I’m glad you have found the blog helpful.

Have a great day and thanks again,

Mike

Well, with 3.0 ermm 2.9.5 basically ATM, there shouldn’t be too many changes for classic,
Tho I’m sure a phoenix working ver will need the general syntax changes.

For a widget that can easily do 10million items, I’m still not sure why it hasn’t worked its way into the standard wxPy lib…?
And it seems that Robin is rather busy at work or enjoying spare-time-time, so when the ever-growing list of DONE/WIPz finally gets to, then it will still be a while getting to everything/patches on it.

And yes, the OLV does seem a bit complex. Thankfully the wxPy port of it exists :slight_smile:
I guess a review of the code should be stuck into the TODO/Include lists.

···

On Thursday, December 12, 2013 11:00:53 AM UTC-6, Mike Driscoll wrote:

Yeah…I have a feeling one of us users is going to have to port it. I haven’t dug into the code, but I’m guessing it’s fairly complicated.

Mike