FloatCanvas - samples

Hi Robin,

If I don't copy the source from my SVN checkout to the installed version, e.g. r73873 the whole file is shown as changed.

In other words I make changes in wx.lib.floatcanvas then copy the file to by SVN check out and then generate a patch it shows the whole file as changed, could it be that the code in e.g. r73873 uses different line endings?

Most of them work now, I attach a patch to get rid of deprecation warnings in them - should I add "phoenix-port" flag to them?

Note that the following samples have problems which I can't figure out.

MovingPlot when clicking on "Run" throws this exception:

AssertionError:
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\MovingPlot.py", line 236, in <module>
   app.MainLoop()
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py", line 1859, in MainLoop
   rv = wx.PyApp.MainLoop(self)
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\MovingPlot.py", line 176, in RunTest
   wx.EVT_TIMER(self,self.timerID, self.OnTimer)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py", line 79, in deprecated_func
   return item(*args)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py", line 1292, in __call__
   assert len(args) == 2 + self.expectedIDs

SplitterWindow seems to be missing SetSashSize:

AttributeError: 'SplitterWindow' object has no attribute 'SetSashSize'
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py", line 71, in <module>
   app = MyApp(0)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py", line 1830, in __init__
   self._BootstrapApp()
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py", line 66, in OnInit
   frame = MyFrame(None, title='splitter test')
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py", line 57, in __init__
   splitter.SetSashSize(10)

MovingTriangle:

Sometimes closes without showing the frame, for me every second or third time.

Have a nice weekend
Werner

floatcanvas samples.patch (31.7 KB)

floatcanvas 3.patch (4.91 KB)

Werner wrote:

Hi Robin,

If I don't copy the source from my SVN checkout to the installed
version, e.g. r73873 the whole file is shown as changed.

In other words I make changes in wx.lib.floatcanvas then copy the file
to by SVN check out and then generate a patch it shows the whole file as
changed, could it be that the code in e.g. r73873 uses different line
endings?

Probably. I added the files via git and so it probably didn't propagate the correct end of line properties to SVN. I'll fix that after I apply your patch. (If you have other changes you may want to save them in patch files before doing another update so the changed line-endings don't cause you to have conflicts.)

Most of them work now, I attach a patch to get rid of deprecation
warnings in them - should I add "phoenix-port" flag to them?

It's not necessary, the tags are mainly to help us track the library migration. Most of the samples so far are new code, or new code adapted from the old, so no migration was needed there.

Note that the following samples have problems which I can't figure out.

MovingPlot when clicking on "Run" throws this exception:

AssertionError:
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\MovingPlot.py", line
236, in <module>
app.MainLoop()
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py",
line 1859, in MainLoop
rv = wx.PyApp.MainLoop(self)
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\MovingPlot.py", line
176, in RunTest
wx.EVT_TIMER(self,self.timerID, self.OnTimer)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py",
line 79, in deprecated_func
return item(*args)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py",
line 1292, in __call__
assert len(args) == 2 + self.expectedIDs

This can be fixed by changing wx.EVT_TIMER() --> self.Bind()

SplitterWindow seems to be missing SetSashSize:

AttributeError: 'SplitterWindow' object has no attribute 'SetSashSize'
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py",
line 71, in <module>
app = MyApp(0)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py",
line 1830, in __init__
self._BootstrapApp()
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py",
line 66, in OnInit
frame = MyFrame(None, title='splitter test')
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py",
line 57, in __init__
splitter.SetSashSize(10)

It's a gonner. From splitter.h:

     // Sets the sash size: this doesn't do anything and shouldn't be used at
     // all any more.
     wxDEPRECATED_INLINE( void SetSashSize(int WXUNUSED(width)), return; )

···

--
Robin Dunn
Software Craftsman

Hi Robin,

...

SplitterWindow seems to be missing SetSashSize:

AttributeError: 'SplitterWindow' object has no attribute 'SetSashSize'
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py",
line 71, in <module>
app = MyApp(0)
File "c:\Python27\Lib\site-packages\wx-2.9.6-msw-phoenix\wx\core.py",
line 1830, in __init__
self._BootstrapApp()
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py",
line 66, in OnInit
frame = MyFrame(None, title='splitter test')
File "h:\devProjectsT\wxPhoenix\samples\floatcanvas\SplitterWindow.py",
line 57, in __init__
splitter.SetSashSize(10)

It's a gonner. From splitter.h:

    // Sets the sash size: this doesn't do anything and shouldn't be used at
    // all any more.
    wxDEPRECATED_INLINE( void SetSashSize(int WXUNUSED(width)), return; )

Hhm, the second time you got me with one of these, and I thought I didn't need to look at the wx doc any more:-(

Will make these changes after I see that the other stuff is commited and add this to classic vs phoenix.

Werner

···

On 30/04/2013 07:16, Robin Dunn wrote:

Hi Robin,

One of the samples uses the attached image, I had added it to "data" folder below the "samples/floatcanvas" folder.

Werner

TestMap.png

werner wrote:

Hi Robin,

One of the samples uses the attached image, I had added it to "data"
folder below the "samples/floatcanvas" folder.

Thanks.

···

--
Robin Dunn
Software Craftsman

Hi Robin,

It looks like the floatcanvas 3 patch didn't get applied - is there an issue with it or did it just get over looked.

See you
Werner

werner wrote:

Hi Robin,

It looks like the floatcanvas 3 patch didn't get applied - is there an
issue with it or did it just get over looked.

Overlooked.
Thanks.

-- Robin Dunn
Software Craftsman