FloatCanvas - samples

3 views
Skip to first unread message

Werner

unread,
Apr 27, 2013, 12:59:32 PM4/27/13
to wxpyth...@googlegroups.com
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
floatcanvas 3.patch

Robin Dunn

unread,
Apr 30, 2013, 1:16:31 AM4/30/13
to wxPyth...@googlegroups.com
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
http://wxPython.org

werner

unread,
Apr 30, 2013, 4:01:59 AM4/30/13
to wxPyth...@googlegroups.com
Hi Robin,

On 30/04/2013 07:16, Robin Dunn wrote:
...
>> 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

werner

unread,
Apr 30, 2013, 5:03:48 PM4/30/13
to wxPyth...@googlegroups.com
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

Robin Dunn

unread,
May 1, 2013, 8:20:51 PM5/1/13
to wxPyth...@googlegroups.com
Thanks.

werner

unread,
May 3, 2013, 4:27:23 AM5/3/13
to wxPyth...@googlegroups.com
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

Robin Dunn

unread,
May 3, 2013, 2:32:52 PM5/3/13
to wxPyth...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages