1. [wxEuphoria] how put Media control into a window?

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

new topic     » topic index » view message » categorize

2. Re: [wxEuphoria] how put Media control into a window?

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: [wxEuphoria] how put Media control into a window?

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: [wxEuphoria] how put Media control into a window?

DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: [wxEuphoria] how put Media control into a window?

mattlewis said...
DanM said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu