mcorino / wxRuby3

Ruby Cross-Platform GUI extension
https://mcorino.github.io/wxRuby3/
MIT License
66 stars 5 forks source link

Add support for Wx::GenericAnimationCtrl so that wxGTK can display .ANI files #282

Open Randalphwa opened 1 month ago

Randalphwa commented 1 month ago

Description

I don't have a way to verify with 100% certainty that it doesn't exist since I can't get wxRuby3 correctly installed on Windows or Fedora (see update in #275), but grepping doesn't indicate Wx::GenericAnimationCtrl exists, and it certainly didn't exist back in the 0.94 version.

The generic version is required when loading .ANI files on wxGTK as the native implementation of wxAnimationCtrl only supports .GIF files. Note that implementation might be a bit different depending on how wxRuby3 implemented wxAnimationCtrl. In particular, you cannot just create animation = Wx::Animation.new and pass animation to Wx::AnimationCtrl.new(self, Wx::ID_ANY, animation, ...) as this will crash on wxGTK. Instead, you have to create the ctrl, call CreateAnimation() from that control, use that to load the .ANI file and then call SetAnimation(). Sorry if you already knew that, or are doing that, just wanted to save you some time if you do decide to add the generic version.

mcorino commented 1 month ago

I'll put this on the list for a next update. This will not be very soon though as I do not have much time the coming 2-3 months.