Re: resizing a media ctrl after creation

Transana <[email protected]> Mon, 20 Dec 2021 10:06:37 -0600
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
You absolutely can resize the media control after it is created.=20
GetBestSize() returns a wx.Size, which is a recommendation for what size=20
the MediaCtrl thinks you should set.=C2=A0 It's still up to you to set the=
=20
size of the MediaCtrl using SetSize().

I personally don't use GetBestSize().=C2=A0 For me, the best size is=20
determined by a number of factors related to my application and user=20
configuration rather than the video itself.=C2=A0 But that's just me.

David




On 12/19/21 10:32 AM, Nathan smith wrote:
> Hi list,
>
>
> I was wondering, is it possible to resize a media control after you=20
> have created it?
>
>
> I have the following in the code that adds the control to my screen:
>
> =C2=A0 hbox4 =3D wx.BoxSizer(wx.HORIZONTAL)
> =C2=A0 self.mediactrl=3Dwx.media.MediaCtrl(panel, size(700, 700),=20
> style=3Dwx.media.MEDIACTRLPLAYERCONTROLS_NONE)
> =C2=A0 self.mediactrl.SetName("Video.")
> =C2=A0 self.mediactrl.Bind(wx.media.EVT_MEDIA_LOADED, self.beginplay)
> =C2=A0 hbox4.Add(self.mediactrl,1,wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5)
>
>
> Then in beginplay I have a clal to play to start the media. I simply=20
> wondered if there was a way to resize the control to best fit the video?
>
> I see GetBestSize and assume I could use that when the video has been=20
> loaded, but that's about as far as I got.
>
>
> Best
>
> Nathan
>
>

--=20
You received this message because you are subscribed to the Google Groups "=
wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/=
wxpython-users/e34bb8e1-54dc-c421-1a05-042a26254ae8%40gmail.com.