Some little trouble with Phoenix

Thank you for all the work done for wxPython Phoenix.

I am trying to convert my applications wxPython 2.8.12 classic to Phoenix 3.0.1. It’s almost ready for normal production use.

Here are the latest trouble that I have.

(Window 7 64bits french, python 3.3.4 32bits, wxPython_Phoenix-3.0.1.dev76109-py3.3-win32.egg)

  1. wx.TheClipboard does not work
···

=========================

Text read and write (example on page http://www.wxpython.org/Phoenix/docs/html/Clipboard.html) does not work.

  1. wx.grid.GridCellCoordsArray conversion to list

===================================

wx.grid.GetSelectionBlockTopLeft() and wx.grid.GetSelectionBlockBottomRight() return a wx.grid.GridCellCoordsArray value.

This does not give the correct row value :

self.GetSelectionBlockTopLeft()[0][0]

Workaround with repr() or str() :

def GetSelectionBlockTopLeft(self):

return(eval(repr(super().GetSelectionBlockTopLeft()).replace("GridCellCoordsArray: ", “”).replace(“GridCellCoords”, “”)))

  1. Vertical scroll bar of the grid

======================

The problem happens with grids (wx.grid.Grid) without horizontal scroll bar.

When I reduce the vertical size of the window, the vertical scroll bar appears too late.

(the last row is hidden and no vertical scroll bar)

  1. wx.MessageBox()

===============

  • No icon with style wx.ICON_QUESTION.

  • First line is bold blue if message begins with 2 newlines ("\n\n")

jpverhulst@gmail.com wrote:

Thank you for all the work done for wxPython Phoenix.
I am trying to convert my applications wxPython 2.8.12 classic to
Phoenix 3.0.1. It's almost ready for normal production use.
Here are the latest trouble that I have.
(Window 7 64bits french, python 3.3.4 32bits,
wxPython_Phoenix-3.0.1.dev76109-py3.3-win32.egg)

1. wx.TheClipboard does not work

Text read and write (example on page
http://www.wxpython.org/Phoenix/docs/html/Clipboard.html) does not work.

I'm seeing this too, I'll try to find what's going wrong.

2. wx.grid.GridCellCoordsArray conversion to list

wx.grid.GetSelectionBlockTopLeft() and
wx.grid.GetSelectionBlockBottomRight() return a
wx.grid.GridCellCoordsArray value.
This does not give the correct row value :
self.GetSelectionBlockTopLeft()[0][0]
Workaround with repr() or str() :
def GetSelectionBlockTopLeft(self):
return(eval(repr(super().GetSelectionBlockTopLeft()).replace("GridCellCoordsArray:

", "").replace("GridCellCoords", "")))

A better workaround would be to simply assign the array to a variable first. It looks like there may be a reference count issue there somewhere and the returned object is being released before you do the indexing operations on it.

  >>> a = g.GetSelectedCells()
  >>> a
GridCellCoordsArray: [GridCellCoords(8, 3), GridCellCoords(7, 3), GridCellCoords(5, 1), GridCellCoords(2, 2)]
  >>> a[0]
GridCellCoords(8, 3)
  >>> a[0][0]
8
  >>> a[0][1]
3
  >>>

3. Vertical scroll bar of the grid

The problem happens with grids (wx.grid.Grid) without horizontal
scroll bar.
When I reduce the vertical size of the window, the vertical scroll bar
appears too late.
(the last row is hidden and no vertical scroll bar)

Please make a small runnable sample for this one that demonstrates the problem.

4. wx.MessageBox()

- No icon with style wx.ICON_QUESTION.
- First line is bold blue if message begins with 2 newlines ("\n\n")

This is due to a different native dialog being used by wxWidgets for wx.MessageDialog on Windows 7 and 8, and it not having support for the equivalent icon for wx.ICON_QUESTION. If you can't live without it then there is a wx.GenericMessageDialog and also one in agw.

-- Robin Dunn
Software Craftsman

As requested, here is a runnable sample showing the problem “Vertical scroll bar of the grid” :

gridVScrollProblem.py

It can be annoying with fixed size windows.

Thanks,

Jean-Paul

gridVScrollProblem.py (694 Bytes)

···

Le samedi 15 mars 2014 21:27:48 UTC+1, Robin Dunn a écrit :

jpver...@gmail.com wrote:

Thank you for all the work done for wxPython Phoenix.

I am trying to convert my applications wxPython 2.8.12 classic to

Phoenix 3.0.1. It’s almost ready for normal production use.

Here are the latest trouble that I have.

(Window 7 64bits french, python 3.3.4 32bits,

wxPython_Phoenix-3.0.1.dev76109-py3.3-win32.egg)

  1. wx.TheClipboard does not work

=========================

Text read and write (example on page

http://www.wxpython.org/Phoenix/docs/html/Clipboard.html) does not work.

I’m seeing this too, I’ll try to find what’s going wrong.

  1. wx.grid.GridCellCoordsArray conversion to list

===================================

wx.grid.GetSelectionBlockTopLeft() and

wx.grid.GetSelectionBlockBottomRight() return a

wx.grid.GridCellCoordsArray value.

This does not give the correct row value :

self.GetSelectionBlockTopLeft()[0][0]

Workaround with repr() or str() :

def GetSelectionBlockTopLeft(self):

return(eval(repr(super().GetSelectionBlockTopLeft()).replace("GridCellCoordsArray:

", “”).replace(“GridCellCoords”, “”)))

A better workaround would be to simply assign the array to a variable
first. It looks like there may be a reference count issue there
somewhere and the returned object is being released before you do the
indexing operations on it.

a = g.GetSelectedCells()

a

GridCellCoordsArray: [GridCellCoords(8, 3), GridCellCoords(7, 3),
GridCellCoords(5, 1), GridCellCoords(2, 2)]

a[0]

GridCellCoords(8, 3)

a[0][0]

8

a[0][1]

3

  1. Vertical scroll bar of the grid

======================

The problem happens with grids (wx.grid.Grid) without horizontal

scroll bar.

When I reduce the vertical size of the window, the vertical scroll bar

appears too late.

(the last row is hidden and no vertical scroll bar)

Please make a small runnable sample for this one that demonstrates the
problem.

  1. wx.MessageBox()

===============

  • No icon with style wx.ICON_QUESTION.
  • First line is bold blue if message begins with 2 newlines (“\n\n”)

This is due to a different native dialog being used by wxWidgets for
wx.MessageDialog on Windows 7 and 8, and it not having support for the
equivalent icon for wx.ICON_QUESTION. If you can’t live without it then
there is a wx.GenericMessageDialog and also one in agw.

– Robin Dunn

Software Craftsman

http://wxPython.org

wx.TheClipboard works but something is wrong with wx.TextDataObject.

See http://trac.wxwidgets.org/ticket/15488. It is the same problem.