1. [wxEuphoria] how put Media control into a window?
- Posted by DanM Feb 09, 2009
- 866 views
Why doesn't the following work to create a window with the media player in it,
so I can put OTHER additional controls into the same window as the media player?
What should it be to do that?
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Media Demo"}), win = create( wxPanel, main), player = create( wxMediaCtrl, win )
Dan
2. Re: [wxEuphoria] how put Media control into a window?
- Posted by mattlewis (admin) Feb 09, 2009
- 842 views
Why doesn't the following work to create a window with the media player in it,
so I can put OTHER additional controls into the same window as the media player?
What should it be to do that?
It looks like it needs a size to be specified. Try this:
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Media Demo"}), win = create( wxPanel, main), player = create( wxMediaCtrl, {win,-1,"",-1,-1,300,100} ), button = create( wxButton, {win, -1, "Click Me"}), sizer = create( wxBoxSizer, wxVERTICAL ) add_window_to_sizer( sizer, player, 1, wxGROW, 0 ) add_window_to_sizer( sizer, button, 0, 0, 0 ) set_sizer( win, sizer) wxMain( main )
Matt
3. Re: [wxEuphoria] how put Media control into a window?
- Posted by DanM Feb 09, 2009
- 807 views
ok, that seems to work, but the added button at the bottom SHRINKS the Media control, and if I add another test button, at the top, it shrinks the Media control again. I guess this is because everything is being crammed into the set size of the top window? Is there some way to auto-magically cause that window to itself expand as controls are added, so the Media control keeps its set size, or do I have to get their sizes and reset the main window size?
Dan
4. Re: [wxEuphoria] how put Media control into a window?
- Posted by mattlewis (admin) Feb 09, 2009
- 811 views
ok, that seems to work, but the added button at the bottom SHRINKS the Media control, and if I add another test button, at the top, it shrinks the Media control again. I guess this is because everything is being crammed into the set size of the top window? Is there some way to auto-magically cause that window to itself expand as controls are added, so the Media control keeps its set size, or do I have to get their sizes and reset the main window size?
It requires a slight change in the way it's added to the sizer. Also, you'll want to put in the actual size that you want:
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Media Demo"}), win = create( wxPanel, main), player = create( wxMediaCtrl, {win,-1,"",-1,-1,300,100} ), button = create( wxButton, {win, -1, "Click Me"}), sizer = create( wxBoxSizer, wxVERTICAL ) add_window_to_sizer( sizer, player, 0, 0, 0 ) add_window_to_sizer( sizer, button, 0, 0, 0 ) set_sizer( win, sizer) wxMain( main )
Matt
5. Re: [wxEuphoria] how put Media control into a window?
- Posted by DanM Feb 09, 2009
- 791 views
ok, that seems to work, but the added button at the bottom SHRINKS the Media control, and if I add another test button, at the top, it shrinks the Media control again. I guess this is because everything is being crammed into the set size of the top window? Is there some way to auto-magically cause that window to itself expand as controls are added, so the Media control keeps its set size, or do I have to get their sizes and reset the main window size?
It requires a slight change in the way it's added to the sizer. Also, you'll want to put in the actual size that you want:
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Media Demo"}), win = create( wxPanel, main), player = create( wxMediaCtrl, {win,-1,"",-1,-1,300,100} ), button = create( wxButton, {win, -1, "Click Me"}), sizer = create( wxBoxSizer, wxVERTICAL ) add_window_to_sizer( sizer, player, 0, 0, 0 ) add_window_to_sizer( sizer, button, 0, 0, 0 ) set_sizer( win, sizer) wxMain( main )
Matt
that worked WORSE. It chopped off the whole bottom of the Media control.
I'll try to approach the question from a different direction in another thread.
Dan