lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.83k stars 884 forks source link

ListBox ownerdraw support #295

Open kjk opened 7 years ago

kjk commented 7 years ago

I'm porting a winforms app to walk and want to re-implement this view:

find files_2017-07-14_14-10-05

i.e. highlight part of the text.

To do that I need to custom paint the item for which I need custom draw support, which ListBox doesn't have currently.

I'm thinking defining an interface like OwnerDrawn (or CustomPainter) with measure/paint methods. If an item from ListBoxModel implements that interface, those methods would be called. Otherwise standard string measuring/drawing would be used.

Does that sound reasonable?

When I get it to work, any interest in having that support merged into walk?

lxn commented 7 years ago

SGTM, would be glad to merge that.