Page 1 of 1

Use wxAnimationCtrl in wxDataViewCtrl

Posted: Wed May 05, 2021 10:11 am
by Schn1c0
Hi there,

can anybody tell me if there is any chance for using a wxAnimationCtrl in a wxDataViewCtrl? There doesn't seem to be a renderer for this control and I wonder if there is any possibility to render it in a custom renderer. I am aiming for a loading icon besides a tree entry.

Thanks a lot for you help.

Cheers
Nico

Re: Use wxAnimationCtrl in wxDataViewCtrl

Posted: Wed May 05, 2021 11:44 am
by doublemax
I don't think wxAnimationCtrl is going to work, as the cells of a wxDVC are not individual windows, so placing the wxAnimationCtrl might be difficult.

I think you need a custom renderer for this.
- use wxAnimation to load the animation, this also gives you access to each frame as wxImage

However, i can't think of an elegant solution to automatically refresh all cells that use this renderer. The best i came up with is to use a timer and update the value these cells, which will force a redraw.

Re: Use wxAnimationCtrl in wxDataViewCtrl

Posted: Wed May 05, 2021 12:19 pm
by Schn1c0
Thanks a lot for you reply. That's more or less what I had in mind as a workaround, but I wanted to make sure I am not overseeing something simple.