Ruby Forum wxRuby > MediaCtrl with no parent?

Posted by Ryan Lewis (c00lryguy)
on 30.04.2008 19:59
Hiyas, I'm trying to make a mediactrl with no parent or with my
application as the parent, so it can play music in the background (I'm
making a simple alarm app), but I cant seem to get it workin. Any ideas
or does it need to have a frame as a parent?
Posted by Alex Fenton (Guest)
on 30.04.2008 20:10
(Received via mailing list)
Ryan Lewis wrote:
> Hiyas, I'm trying to make a mediactrl with no parent or with my
> application as the parent, so it can play music in the background (I'm
> making a simple alarm app), but I cant seem to get it workin. Any ideas
> or does it need to have a frame as a parent?
>   
Yes. Only descendants of Wx::TopLevelWindow - either Frames or Dialogs -
can have no parent. Any other Wx::Window has to have a valid parent.

If you want to show no Frame at all, just use Frame#hide.

If you want a minimal frame, you could use Wx::MiniFrame or perhaps a
shaped frame - there is an example of the latter in bigdemo.rb.

alex