# MediaCtrl with no parent?

**URL:** <https://www.ruby-forum.com/t/mediactrl-with-no-parent/136319>\
**Category:** wxRuby\
**Created:** [April 30, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/mediactrl-with-no-parent/136319 "2008-04-30T19:59:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazukars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@lazukars](https://www.ruby-forum.com/u/lazukars)\
**Post date:** [April 30, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/mediactrl-with-no-parent/136319/1 "2008-04-30T19:59:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lazukars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@lazukars](https://www.ruby-forum.com/u/lazukars)\
**Post date:** [April 30, 2008, 8:10pm UTC](https://www.ruby-forum.com/t/mediactrl-with-no-parent/136319/2 "2008-04-30T20:10:32Z")

</div>

Ryan L. 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
