wxPython 2.5.1.0p8 Preview

Robin Dunn wrote:

None. What version of the compiler do you have?

gcc 2.96

That's what I guessed. Probably some optimization flag that the RPM build was trying to use that made it choke.

In the end, it would be nice to have a source RPM that will build on older versions...where might I find these flags?

I've successfully compiled wxWindows (Widgets?) from source so far...still working on that.

While you're doing that please keep track of anything in wxPython/docs/BUILD.txt or .../INSTALL.txt that needs more explaination or are incorrect.

I've got it all built now, and it seems to be working fine. I found the BUILD.txt to work very well for me.

-Chris

···

--
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

Chris.Barker@noaa.gov

Duh! despite that error, I'm startign to test it, and it seems to be working. One quick observation on the demo:

whenever I select a new item in teh tree, I get a whole bunch of flashing of the notebook. It seems to be showing each page as it's added, or something like that.

-Chris

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

Chris.Barker@noaa.gov

···

On Mar 2, 2004, at 1:08 PM, Chris Barker wrote:

On Feb 27, 2004, at 11:11 AM, Robin Dunn wrote:

"There were errors installing the software."

Chris Barker wrote:

···

On Feb 27, 2004, at 11:11 AM, Robin Dunn wrote:

The next preview build of wxPython is now available at

http://starship.python.net/crew/robind/wxPython/preview/2.5.1.0p8/

Well, I tried to install it on OS-X (Panther), and it ran through the whole thing, then gave me:

"There were errors installing the software."

in the "Finishing Up" phase. Very helpful message, Isn't it?

Yeah. Were there any messages in the Console log?

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Chris Barker wrote:

Robin Dunn wrote:

None. What version of the compiler do you have?

gcc 2.96

That's what I guessed. Probably some optimization flag that the RPM build was trying to use that made it choke.

In the end, it would be nice to have a source RPM that will build on older versions...

I would have expected this one to build... :frowning:

where might I find these flags?

It could be either flags that distutils is inheriting from the Python build, or flags that RPM is wanting to use by default. (Or both!)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Chris Barker wrote:

···

On Mar 2, 2004, at 1:08 PM, Chris Barker wrote:

On Feb 27, 2004, at 11:11 AM, Robin Dunn wrote:

"There were errors installing the software."

Duh! despite that error, I'm startign to test it, and it seems to be working. One quick observation on the demo:

whenever I select a new item in teh tree, I get a whole bunch of flashing of the notebook. It seems to be showing each page as it's added, or something like that.

Yep. There are some extra Refreshes in there that used to be required to make things look right on the Mac, plus the page changes, delete, add and change again. I took out a couple of the Refreshes yesterday and it looks a bit better now, although you still see the page changes happening more than on the other platforms.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Chris Barker wrote:

where might I find these flags?

It could be either flags that distutils is inheriting from the Python build, or flags that RPM is wanting to use by default. (Or both!)

Well, Python built, so it shouldn't be that, and you'd think rpm's default flags would work on the system, but I'm out of my depth here, and I have the tarball built now, so I'm happy for the moment.

-Chris

···

--
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

Chris.Barker@noaa.gov

Robin Dunn wrote:

"There were errors installing the software."

in the "Finishing Up" phase. Very helpful message, Isn't it?

Yeah. Were there any messages in the Console log?

Sorry, I didn't check. However, I discovered that I had not completely removed some old Python2.3 stuff, including a previous build of wxPython. Once I did that, and now have just the Apple Python2.3, everything seems to be working.

-Chris

···

--
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

Chris.Barker@noaa.gov

I have it running now, and have gotten my FloatCanvas working ofr the most part, but have some strange behaviour:

1) wx.Bitmap.GetDepth returns -1, even though the bitmap clearly has a greater depth than that! On other platforms, I get the bitdepth of the display, as that is the default. In fact, you can't pass in any other depth except maybe 1 anyway.

I need to know the bitdepth of an offscreen bitmap, as I use it to do my hit-testing...each object is drawn in a different color,a nd I need to know how many distinct colors there are.

While we are on wx.Bitmap...I thought I heard that in 2.5, some kind of alpha support was going to built in for wx.Bitmap and blitting. Is this the case? I see no mention of it in the docs. I do see metion of it in wxImage, but you can't draw one of those directly to the screen.

2) What the heck is going on with screen buffering? I've heard that OS-X automatically double buffers the screen, but I have other reasons to buffer myself, in addition to other platforms where it's required. In any case, I now have the screen buffered, but when I blit the buffer to a wxClientDC in short succession, I don't see a change until I'm done. For example, accoring to my timing, there have been 100 blits to the screen in 2.23 seconds, but I only see the last one. This makes it impossible to do any kind of animation.

You can see this behaviour in my latest FloatCanvas, in the animation demo in the draw menu (and other places, but it's much more subtle there). If you want, I'll put together a small, self contained example.

Other than these issues, I'm vry impressed with how easy it was to get running on OS-X, and the performance is just fine.

-Chris

···

--
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

Chris.Barker@noaa.gov

Shoudl we include a utility script on the disk image to remove older versions of Python and wxPython from a Panther installation and/or should this be an option in the wxPython installation if an older version is detected? Given the potential problems of older versions, installing new versions over old, etc. I'm worried about bad user experiences and people getting turned off about wxPython. The Mac install/uninstall/upgrade needs to be at least as easy as Windows.

ka

···

On Mar 3, 2004, at 11:07 AM, Chris Barker wrote:

Robin Dunn wrote:

"There were errors installing the software."

in the "Finishing Up" phase. Very helpful message, Isn't it?

Yeah. Were there any messages in the Console log?

Sorry, I didn't check. However, I discovered that I had not completely removed some old Python2.3 stuff, including a previous build of wxPython. Once I did that, and now have just the Apple Python2.3, everything seems to be working.

Hi Chris,

I have it running now, and have gotten my FloatCanvas working ofr the most part, but have some strange behaviour:

1) wx.Bitmap.GetDepth returns -1, even though the bitmap clearly has a greater depth than that! On other platforms, I get the bitdepth of the display, as that is the default. In fact, you can't pass in any other depth except maybe 1 anyway.

I need to know the bitdepth of an offscreen bitmap, as I use it to do my hit-testing...each object is drawn in a different color,a nd I need to know how many distinct colors there are.

While we are on wx.Bitmap...I thought I heard that in 2.5, some kind of alpha support was going to built in for wx.Bitmap and blitting. Is this the case? I see no mention of it in the docs. I do see metion of it in wxImage, but you can't draw one of those directly to the screen.

2) What the heck is going on with screen buffering? I've heard that OS-X automatically double buffers the screen, but I have other reasons to buffer myself, in addition to other platforms where it's required. In any case, I now have the screen buffered, but when I blit the buffer to a wxClientDC in short succession, I don't see a change until I'm done. For example, accoring to my timing, there have been 100 blits to the screen in 2.23 seconds, but I only see the last one. This makes it impossible to do any kind of animation.

OS X does double-buffer the screen, and it does not automatically flush the port buffer when drawing calls happen, so this would be the "expected" behavior. Calling "update" on the window after each blit is the only way I know of with the current code to make it update immediately. Of course, this raises the question of whether or not wxDC::Blit on Mac is a special case where the buffer should be flushed immediately, but I'm not familiar with the DC operations to be able to make that call.

Thanks,

Kevin

···

On Mar 3, 2004, at 11:23 AM, Chris Barker wrote:

Kevin Ollivier wrote:

OS X does double-buffer the screen, and it does not automatically flush the port buffer when drawing calls happen, so this would be the "expected" behavior. Calling "update" on the window after each blit is the only way I know of with the current code to make it update immediately.

Nope, that doesn't do it. I guess it's time to make a small sample and try other options...

Of course, this raises the question of whether or not wxDC::Blit on Mac is a special case where the buffer should be flushed immediately, but I'm not familiar with the DC operations to be able to make that call.

I'm not sure wxDC.Blit is the only case. I imagine you'd have problems any time a wxClientDC is used. I've always expected stuff to be drawn right away when I use a wx.ClientDC.

I notice that the ScrolledWindow deom works, with the drawing happening right away...I'll take a look at that and see what I can figure out.

-Chris

···

--
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

Chris.Barker@noaa.gov

In the PythonCard life and hopalong samples I am calling wxSafeYield and the screen updates as expected on the Mac, so I'm guessing this is one of those cases where you need to do the same?!

ka

···

On Mar 3, 2004, at 12:36 PM, Chris Barker wrote:

Kevin Ollivier wrote:

OS X does double-buffer the screen, and it does not automatically flush the port buffer when drawing calls happen, so this would be the "expected" behavior. Calling "update" on the window after each blit is the only way I know of with the current code to make it update immediately.

Nope, that doesn't do it. I guess it's time to make a small sample and try other options...

Of course, this raises the question of whether or not wxDC::Blit on Mac is a special case where the buffer should be flushed immediately, but I'm not familiar with the DC operations to be able to make that call.

I'm not sure wxDC.Blit is the only case. I imagine you'd have problems any time a wxClientDC is used. I've always expected stuff to be drawn right away when I use a wx.ClientDC.

I notice that the ScrolledWindow deom works, with the drawing happening right away...I'll take a look at that and see what I can figure out.

Kevin Ollivier wrote:

OS X does double-buffer the screen, and it does not automatically flush the port buffer when drawing calls happen, so this would be the "expected" behavior. Calling "update" on the window after each blit is the only way I know of with the current code to make it update immediately.

Nope, that doesn't do it. I guess it's time to make a small sample and try other options...

Wow, that's really strange. Update explicitly calls QDFlushPortBuffer, which should force your drawing to the screen...

Of course, this raises the question of whether or not wxDC::Blit on Mac is a special case where the buffer should be flushed immediately, but I'm not familiar with the DC operations to be able to make that call.

I'm not sure wxDC.Blit is the only case. I imagine you'd have problems any time a wxClientDC is used. I've always expected stuff to be drawn right away when I use a wx.ClientDC.

It's mostly a performance issue. Apple's docs explicitly say not to flush the port buffer after each drawing call. The docs basically say to wait for drawing events to fire, which in my experience hasn't caused problems.

I notice that the ScrolledWindow deom works, with the drawing happening right away...I'll take a look at that and see what I can figure out.

Thanks, I'm stumped as to what could be causing this!

Kevin

···

On Mar 3, 2004, at 12:36 PM, Chris Barker wrote:

Chris Barker wrote:

Robin Dunn wrote:

Chris Barker wrote:

where might I find these flags?

It could be either flags that distutils is inheriting from the Python build, or flags that RPM is wanting to use by default. (Or both!)

Well, Python built, so it shouldn't be that, and you'd think rpm's default flags would work on the system,

But Python is C, wxWidgets is C++, and the error message you reported is definitly a C++ issue.

but I'm out of my depth here, and I have the tarball built now, so I'm happy for the moment.

:slight_smile:

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Chris Barker wrote:

I have it running now, and have gotten my FloatCanvas working ofr the most part, but have some strange behaviour:

1) wx.Bitmap.GetDepth returns -1, even though the bitmap clearly has a greater depth than that!

Please enter a bug report about this. In the meantime you could switch to using wx.GetDisplayDepth()

On other platforms, I get the bitdepth of the display, as that is the default. In fact, you can't pass in any other depth except maybe 1 anyway.

Actually, you can now, depending on platform.

I need to know the bitdepth of an offscreen bitmap, as I use it to do my hit-testing...each object is drawn in a different color,a nd I need to know how many distinct colors there are.

While we are on wx.Bitmap...I thought I heard that in 2.5, some kind of alpha support was going to built in for wx.Bitmap and blitting. Is this the case? I see no mention of it in the docs. I do see metion of it in wxImage, but you can't draw one of those directly to the screen.

On MSW and OSX, if an image file has an alpha channel it will be preserved when read into a wx.Image and converted to a wx.Bitmap, (or loaded from a file directly to wx.Bitmap) and dc.DrawBitmap and dc.Blit will draw the image with the alpha. There are also some classes that allow raw access to the bitmap data within wxBitmap, but I still need to figure out how to wrap it for wxPython. (It uses some nasty templates and such.)

Unfortunatly nothing has been done for wxGTK for alpha or raw bitmap access yet. :frowning:

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Kevin Altis wrote:

Robin Dunn wrote:

"There were errors installing the software."

in the "Finishing Up" phase. Very helpful message, Isn't it?

Yeah. Were there any messages in the Console log?

Sorry, I didn't check. However, I discovered that I had not completely removed some old Python2.3 stuff, including a previous build of wxPython. Once I did that, and now have just the Apple Python2.3, everything seems to be working.

Shoudl we include a utility script on the disk image to remove older versions of Python and wxPython from a Panther installation and/or should this be an option in the wxPython installation if an older version is detected?

The Installer gives us very little control to do things like that. It can show readme, license files, ask for an install location, run pre/post scripts, etc. but you can't add to the UI or do conditional things like you can with common Windows installer tools. (Or if you can I havn't seen how to do it yet.)

Given the potential problems of older versions, installing new versions over old, etc. I'm worried about bad user experiences and people getting turned off about wxPython.

I would be even more worried about blowing things away that shouldn't be.

The Mac install/uninstall/upgrade needs to be at least as easy as Windows.

That would be nice, but the ball is in Apple's court for at least some of that.

···

On Mar 3, 2004, at 11:07 AM, Chris Barker wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Kevin Altis wrote:

In the PythonCard life and hopalong samples I am calling wxSafeYield and the screen updates as expected on the Mac, so I'm guessing this is one of those cases where you need to do the same?!

This points to the issue being event related, but wx.Window.Update() is supposed to solve exactly this problem. From the docs:

"""
wxWindow::Update

virtual void Update()

Calling this method immediately repaints the invalidated area of the window while this would usually only happen when the flow of control returns to the event loop. Notice that this function doesn't refresh the window and does nothing if the window hadn't been already repainted. Use Refresh first if you want to immediately redraw the window unconditionally.
"""

Maybe I'll try Refresh() but I think there is a performance penalty to that. And I think that calls a Paint event, which could cause problems here too.

Calling a wx.SafeYield() has performance issues too....

Kevin Ollivier wrote:

Wow, that's really strange. Update explicitly calls QDFlushPortBuffer, which should force your drawing to the screen...

Maybe it's a bug then...

It's mostly a performance issue. Apple's docs explicitly say not to flush the port buffer after each drawing call.

well, I'm doing the double buffering myself, and not even using a wxBufferedDC, because I want to control what the users see. In the example I'm talking about, the screen is changing rapidly, It has to be updated rapidly. Another example is when I'm drawing 1000s of objects to the screen. This can take a little while, and I'd rather the user not sit there wondering if something is happening, so I do a blit every 500 objects or so, so they can see the screen getting drawn.

> The docs basically say to
> wait for drawing events to fire, which in my experience hasn't caused
> problems.

What are these drawing events? I tried something, and was surprised by the result. It takes a few seconds for all the frames to be shown (and nothing is changing on screen). If I click on another window, my window goes behind it. If I click back on my Window, it won't come to the top until it's done with the animation loop. This means that the system is telling my app to raise itself, and it's not procesing that evetn till it's done with the loop it's doing. This points to a need for Yield().

OK, I've tried it, and wx.GetApp.Yield(True) works. It does impact performance, but by 0.0025 seconds per Blit(), so I can't complain. In fact, generally during an animation, I'd want the Yield() there anyway.

-Chris

···

--
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

Chris.Barker@noaa.gov

Hi all,

In further testing of FloatCanvas, I've found another platfrom difference/bug:

When I click and drag the mouse on GTK and Windows, it appears to be automatically captured by the window. THat is, I continue to get Motion events after the mouse leaves the window, and an up event when I release the mouse.

On OS-X, the motion events stop when I leave the Window, and If I release the mouse whiole outside the window, I don't get hte up event. If I do a wx.Window.CaptureMouse() on the down event, and a ReleaseMouse() on the up event, it works fine

This is a platfrom difference that seems like a bug to me, and frankly, I like it the way it works on GTK and Window ( at least I think it works that way on Windows, I really need to get a copy of VMware! )

-Chris

···

--
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

Chris.Barker@noaa.gov

Chris Barker wrote:

Hi all,

In further testing of FloatCanvas, I've found another platfrom difference/bug:

When I click and drag the mouse on GTK and Windows, it appears to be automatically captured by the window. THat is, I continue to get Motion events after the mouse leaves the window, and an up event when I release the mouse.

Eeek!!

On OS-X, the motion events stop when I leave the Window, and If I release the mouse whiole outside the window, I don't get hte up event. If I do a wx.Window.CaptureMouse() on the down event, and a ReleaseMouse() on the up event, it works fine

This is how all the platforms are supposed to work, and in my experience is how they did work in the past... Are you sure it is not working correctly in Windows? My quickie test just now shows that it is, and only misbehaves in wxGTK and wxGTK2.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

When I click and drag the mouse on GTK and Windows, it appears to be automatically captured by the window. THat is, I continue to get Motion events after the mouse leaves the window, and an up event when I release the mouse.

Eeek!!

Oh. I liked it that way, it seems natural to me.

On OS-X, the motion events stop when I leave the Window, and If I release the mouse whiole outside the window, I don't get hte up event. If I do a wx.Window.CaptureMouse() on the down event, and a ReleaseMouse() on the up event, it works fine

This is how all the platforms are supposed to work, and in my experience is how they did work in the past...

I'm pretty sure it hasn't worked that way on GTK for a LONG time

Are you sure it is not working correctly in Windows?

No, I'm not. I havn't tested on Windows in a while. All I know is that I never noticed that it worked differently on Windows than GTK, and when I Zoom and Scroll with the FloatCanvas, it really breaks things fast if the mouse isn't captured.

Adding the Capture code doesn't seem to break anything on GTK, so I"ve got a fix that works, and appears that is will continue to work after this bug is fixed on GTK.

-Chris

···

--
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

Chris.Barker@noaa.gov