wxListCtrl problems

Hi list,
I have two questions about ListCtrl. I create a small app that show db
data into a ListCtrl.

1) When I scroll data with the key (UP, DOWN), sometime I receive an error:

     wx.ListCtrl.RefreshItems(self, start, stop)
   File
"/usr/lib/python2.4/site-packages/wx-2.7.0-gtk2-unicode/wx/_controls.py",
line 4463, in RefreshItems
     return _controls_.ListCtrl_RefreshItems(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "lineFrom <= lineTo" failed at
../src/generic/listctrl.cpp(2498) in RefreshLines(): indices in disorder

What can be?

2) On win the "return", "space", "escape", etc... keys (so the function
keys) are passed to the ListCtrl OnChar event, but on lin not. Is there
a solution for say to wx to pass them (generate an event) on these keys?

Win2k and wx 2.6.3 unicode
debian 3.1 wx 2.6.3 and 2.7.0
wxListCtrl style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_SINGLE_SEL|wx.WANTS_CHARS

Thanks,
Michele

Michele Petrazzo wrote:

Hi list,
I have two questions about ListCtrl. I create a small app that show db
data into a ListCtrl.

1) When I scroll data with the key (UP, DOWN), sometime I receive an error:

    wx.ListCtrl.RefreshItems(self, start, stop)
  File
"/usr/lib/python2.4/site-packages/wx-2.7.0-gtk2-unicode/wx/_controls.py",
line 4463, in RefreshItems
    return _controls_.ListCtrl_RefreshItems(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "lineFrom <= lineTo" failed at
../src/generic/listctrl.cpp(2498) in RefreshLines(): indices in disorder

What can be?

First, why do you call wx.ListCtrl.RefreshItems(self, start, stop) instead of self.RefreshItems(start, stop)? Second, is start > stop?

2) On win the "return", "space", "escape", etc... keys (so the function
keys) are passed to the ListCtrl OnChar event, but on lin not. Is there
a solution for say to wx to pass them (generate an event) on these keys?

What is meant by "on lin" ? Whatever it is you can probably get it by using a EVT_KEY_DOWN handler.

···

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

Hello list!

This might be an obvious thing I am missing, but I can't figure out how to being a wx.Frame to the front. Normally, frames are automatically created on top of all the others, but for some reason since I am creating this frame after the user double clicks on a ListCtrl item (an EVT_LIST_ITEM_ACTIVATED event) that form stays on top with focus, as if the second click brings it forward. If use enter to select the item instead, the frame pops up in front like normal.

Robin mentioned once in a post you can get the top window by caling wx.GetActiveWindow(). I tried wx.SetActiveWindow(), but that method doesn't exist :frowning:
http://aspn.activestate.com/ASPN/Mail/Message/wxPython-users/1508295

Any ideas will be much appreciated.

Robert

After you create your frame, try something like

myframe.Raise()

To bring it to the top.

Robert Gravina wrote:

···

Hello list!

This might be an obvious thing I am missing, but I can't figure out how to being a wx.Frame to the front. Normally, frames are automatically created on top of all the others, but for some reason since I am creating this frame after the user double clicks on a ListCtrl item (an EVT_LIST_ITEM_ACTIVATED event) that form stays on top with focus, as if the second click brings it forward. If use enter to select the item instead, the frame pops up in front like normal.

Robin mentioned once in a post you can get the top window by caling wx.GetActiveWindow(). I tried wx.SetActiveWindow(), but that method doesn't exist :frowning:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Any ideas will be much appreciated.

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 8/18/2006

Hi, Robert Gravina

just try wx.Frame.Raise() or Show(),but it does not always works, I don't know why.

···

-------------------------------------------------------------

Hello list!

This might be an obvious thing I am missing, but I can't figure out
how to being a wx.Frame to the front. Normally, frames are
automatically created on top of all the others, but for some reason
since I am creating this frame after the user double clicks on a
ListCtrl item (an EVT_LIST_ITEM_ACTIVATED event) that form stays on
top with focus, as if the second click brings it forward. If use
enter to select the item instead, the frame pops up in front like
normal.

Robin mentioned once in a post you can get the top window by caling
wx.GetActiveWindow(). I tried wx.SetActiveWindow(), but that method
doesn't exist :frowning:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Any ideas will be much appreciated.

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

------------------
bruce.who.hk
2006-08-22

After you create your frame, try something like

myframe.Raise()

To bring it to the top.

Thanks, I did try that, and unfortunately didn't help. I've tried calling Raise at various times (as late as possible after the form is created, in the __init__ method for the form etc.) but no luck. I've tried calling Lower on the frame that's stubbornly staying on top, but that's not helping neither.

···

On 2006/08/22, at 11:20, Nizam Sayeed wrote:

Robert Gravina wrote:

Hello list!

This might be an obvious thing I am missing, but I can't figure out how to being a wx.Frame to the front. Normally, frames are automatically created on top of all the others, but for some reason since I am creating this frame after the user double clicks on a ListCtrl item (an EVT_LIST_ITEM_ACTIVATED event) that form stays on top with focus, as if the second click brings it forward. If use enter to select the item instead, the frame pops up in front like normal.

Robin mentioned once in a post you can get the top window by caling wx.GetActiveWindow(). I tried wx.SetActiveWindow(), but that method doesn't exist :frowning:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Any ideas will be much appreciated.

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 8/18/2006

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Robert Gravina wrote:

After you create your frame, try something like

myframe.Raise()

To bring it to the top.

Thanks, I did try that, and unfortunately didn't help. I've tried calling Raise at various times (as late as possible after the form is created, in the __init__ method for the form etc.) but no luck. I've tried calling Lower on the frame that's stubbornly staying on top, but that's not helping neither.

Try delaying the creation of the 2nd frame until all of the events associated with the double click have time to complete.

···

On 2006/08/22, at 11:20, Nizam Sayeed wrote:

Robert Gravina wrote:

Hello list!

This might be an obvious thing I am missing, but I can't figure out how to being a wx.Frame to the front. Normally, frames are automatically created on top of all the others, but for some reason since I am creating this frame after the user double clicks on a ListCtrl item (an EVT_LIST_ITEM_ACTIVATED event) that form stays on top with focus, as if the second click brings it forward. If use enter to select the item instead, the frame pops up in front like normal.

Robin mentioned once in a post you can get the top window by caling wx.GetActiveWindow(). I tried wx.SetActiveWindow(), but that method doesn't exist :frowning:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

Any ideas will be much appreciated.

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

How would I do this?

I am having a similar problem as this thread. I have a bunch of frames with plots in them. I have an additional frame that allows for analysis of the currently selected (or last selected) plot frame. To activate the analysis window, they Alt + right click on the plot and choose from a popup menu. I can never get the analysis frame to be on top. I have made a stripped down version of what I'm doing and am attaching it to this message.

Using 2.6.2.1 on OS X.4.7

Thank you,

Harvey

raise_window.py (6.44 KB)

PGP.sig (186 Bytes)

···

On Aug 22, 2006, at 12:23 PM, Robin Dunn wrote:

Try delaying the creation of the 2nd frame until all of the events associated with the double click have time to complete.

Richard Harvey Chapman wrote:

···

On Aug 22, 2006, at 12:23 PM, Robin Dunn wrote:

Try delaying the creation of the 2nd frame until all of the events associated with the double click have time to complete.

How would I do this?

The same as any other delayed effect in wxPython. Move the code that creates the new frame into another function, and then invoke that function via either wx.CallAfter or wx.FutureCall.

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

Thank you! I just grabbed a copy of the ...in Action book. I've been using the demo and the wxDocsViewer as my major source of information up to now, but they have been kind of lacking for this kind of information.

R.

PGP.sig (186 Bytes)