Hi,
I have a question about these two classes.
They are both inherited from class window, why frame can be set to
transparent but panel can't?
And is there a way to set panel transparent?
Thanks
Hi,
I have a question about these two classes.
They are both inherited from class window, why frame can be set to
transparent but panel can't?
And is there a way to set panel transparent?
Thanks
Because the feature is implemented for frames but not for panels. IIRC it is because alpha transparency is only supported on all the platforms for top level windows.
On 3/4/11 5:48 PM, zhengqing wrote:
Hi,
I have a question about these two classes.
They are both inherited from class window, why frame can be set to
transparent but panel can't?
And is there a way to set panel transparent?
--
Robin Dunn
Software Craftsman
Isn't it also true that Frame creation and control is largely
implemented by the particular platform's OS so as not to have to
"recreate the wheel" while Panels are created and controlled mostly by
wxWidgets/wxPython ?
Consider that dynamic transparency is difficult to implement smoothly.
This must be done at a very low level in relation to the OS and must
use the unique intricacies that only the particular OS platform has
available. Trying to duplicate this at the wxWidgets or wxPython level
for each platform would be mind-blowing! Sure, it could be done, but
it would end up doing what the OS already has provided, so why
"recreate the wheel" ?
On Mar 5, 11:44 am, Robin Dunn <ro...@alldunn.com> wrote:
On 3/4/11 5:48 PM, zhengqing wrote:
> Hi,
> I have a question about these two classes.
> They are both inherited from class window, why frame can be set to
> transparent but panel can't?
> And is there a way to set panel transparent?Because the feature is implemented for frames but not for panels. IIRC
it is because alpha transparency is only supported on all the platforms
for top level windows.--
Robin Dunn
Software Craftsmanhttp://wxPython.org
Not really. wxPanels are still a native window/widget/control on each platform with just about as much wx specific code on top as what wxFrames have.
On 3/5/11 9:09 AM, Ray Pasco wrote:
On Mar 5, 11:44 am, Robin Dunn<ro...@alldunn.com> wrote:
On 3/4/11 5:48 PM, zhengqing wrote:
Hi,
I have a question about these two classes.
They are both inherited from class window, why frame can be set to
transparent but panel can't?
And is there a way to set panel transparent?Because the feature is implemented for frames but not for panels. IIRC
it is because alpha transparency is only supported on all the platforms
for top level windows.
Isn't it also true that Frame creation and control is largely
implemented by the particular platform's OS so as not to have to
"recreate the wheel" while Panels are created and controlled mostly by
wxWidgets/wxPython ?
--
Robin Dunn
Software Craftsman
Thanks!
So is it possible to create child wx.Frame , and add it into a parent
wx.Frame?
I tried to create a shaped Frame, and add it into a sizer. it doesn't
work. Because I wonder if I could kind of replace the panel with this
shaped frame, and it failed.
If I want to know more about what can be done, and what is not, where
should I find those information?
On Mar 5, 9:24 am, Robin Dunn <ro...@alldunn.com> wrote:
On 3/5/11 9:09 AM, Ray Pasco wrote:
> On Mar 5, 11:44 am, Robin Dunn<ro...@alldunn.com> wrote:
>> On 3/4/11 5:48 PM, zhengqing wrote:>>> Hi,
>>> I have a question about these two classes.
>>> They are both inherited from class window, why frame can be set to
>>> transparent but panel can't?
>>> And is there a way to set panel transparent?>> Because the feature is implemented for frames but not for panels. IIRC
>> it is because alpha transparency is only supported on all the platforms
>> for top level windows.> Isn't it also true that Frame creation and control is largely
> implemented by the particular platform's OS so as not to have to
> "recreate the wheel" while Panels are created and controlled mostly by
> wxWidgets/wxPython ?Not really. wxPanels are still a native window/widget/control on each
platform with just about as much wx specific code on top as what
wxFrames have.--
Robin Dunn
Software Craftsmanhttp://wxPython.org
Thanks!
So is it possible to create child wx.Frame , and add it into a parent
wx.Frame?
No, not in the way that you are wanting. Frames are top-level windows, meaning that they are not constrained[1] to the client area of their parent, (if they have one) and that by default the user can move them and resize them.
[1] other than when using MDI classes, but I'd avoid that if possible as it is an archaic UI mechanism.
I tried to create a shaped Frame, and add it into a sizer. it doesn't
work. Because I wonder if I could kind of replace the panel with this
shaped frame, and it failed.If I want to know more about what can be done, and what is not, where
should I find those information?
The docs, demo, online tutorials, wiki, your own trial and error experimentation, and this mail list.
On 3/5/11 11:42 AM, zhengqing wrote:
--
Robin Dunn
Software Craftsman
Because the feature is implemented for frames but not for panels. IIRC
it is because alpha transparency is only supported on all the platforms
for top level windows.--
Robin Dunn
Software Craftsmanhttp://wxPython.org
Does this mean that no child control can have transparency ?
Yes and no. It means that wx doesn't support manipulating the transparency of child widgets. But on some platforms some widget types are implicitly transparent, such as wx.StaticText on GTK or OSX.
On 3/6/11 9:28 AM, Ray Pasco wrote:
Because the feature is implemented for frames but not for panels. IIRC
it is because alpha transparency is only supported on all the platforms
for top level windows.Does this mean that no child control can have transparency ?
--
Robin Dunn
Software Craftsman
Does this mean that no child control can have transparency ?
Yes and no. It means that wx doesn’t support manipulating the transparency of child widgets. But on some platforms some widget types are implicitly transparent, such as wx.StaticText on GTK or OSX.
Robin Dunn
Software Craftsman
I should have worded my question more clearly:
Q: Can a wx child control have transparency ?
I suppose I could deal with top level borderless Frame windows so that they visually appear to be child controls. That is, make sure they stay in the same position relative to their “parent window” [sic] by using screen coordinates and catching all OnMove events to reposition the partially transparent “pseudo-children” Frames. Getting them to act like real child controls seems much more difficult. This sounds like a lot of work.
I would guess that I’m hardly the first person to want this kind of functionality. I found an interesting thread from several years ago discussing control transparency:
An interesting statement made there is:
The fact is that wxWidgets simply does not fully support transparent windows. That’s because the toolkit it wraps don’t all support it, and certainly didn’t years ago when the [wx] design started – maybe in the future.
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception.
IIRC, isn’t that (graphics) toolkit GTK ? It’s too bad this doesn’t have general transparency capability so that its algorithms could be ported to wxPython. I bet that the limited use of transparency such as in StaticText and such is done with DCs which are difficult to get working uniformly across different platform types.
On Mon, Mar 7, 2011 at 2:09 PM, Robin Dunn robin@alldunn.com wrote:
A: Not directly.
Hi Ray,
Does this mean that no child control can have transparency ?
Yes and no. It means that wx doesn’t support manipulating the transparency of child widgets. But on some platforms some widget types are implicitly transparent, such as wx.StaticText on GTK or OSX.
Robin Dunn
Software Craftsman
I should have worded my question more clearly:
Q: Can a wx child control have transparency ?
A: Not directly.I suppose I could deal with top level borderless Frame windows so that they visually appear to be child controls. That is, make sure they stay in the same position relative to their “parent window” [sic] by using screen coordinates and catching all OnMove events to reposition the partially transparent “pseudo-children” Frames. Getting them to act like real child controls seems much more difficult. This sounds like a lot of work.
I would guess that I’m hardly the first person to want this kind of functionality. I found an interesting thread from several years ago discussing control transparency:
transparent background for a panel widget
An interesting statement made there is:
The fact is that wxWidgets simply does not fully support transparent windows. That’s because the toolkit it wraps don’t all support it, and certainly didn’t years ago when the [wx] design started – maybe in the future.
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception.
IIRC, isn’t that (graphics) toolkit GTK ? It’s too bad this doesn’t have general transparency capability so that its algorithms could be ported to wxPython. I bet that the limited use of transparency such as in StaticText and such is done with DCs which are difficult to get working uniformly across different platform types.
The main limiting platform is Windows. The core Windows controls were largely designed and coded when double-buffered drawing was too expensive to do. I don’t know why Windows has been unable to come up with a simple mechanism for transparency in child controls, but I’m pretty sure it has to do with keeping backwards compatibility with Win 9x era apps.
Regards,
Kevin
On Mar 7, 2011, at 5:26 PM, Ray Pasco wrote:
On Mon, Mar 7, 2011 at 2:09 PM, Robin Dunn robin@alldunn.com wrote:
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
I bet that the limited use of transparency such as
in StaticText and such is done with DCs which are difficult to get
working uniformly across different platform types.
Actually on some platforms (I think GTK), StaticText is not a "real window", rather it is siimpy text drawn on the underlying Window -- so it is inherently transparent (and doesn't fully support all Window behavior)
I don't know why Windows has been unable to come up
with a simple mechanism for transparency in child controls, but I'm
pretty sure it has to do with keeping backwards compatibility with Win
9x era apps.
Or maybe even Windows 3.1 Apps!
-Chris
On 3/7/11 8:38 PM, Kevin Ollivier wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov