Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • wxListCtrl problems

    9 answers - 1070 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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, DWN), sometime I receive an error:
    wx.ListCtrl.Refre****ems(self, start, stop)
    File
    "/",
    line 4463, in Refre****ems
    return (*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) win the "return", "space", "escape", etc keys (so the function
    keys) are passed to the ListCtrl Char 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_REPRT|wx.LC_VIRTUAL|wx.LC_SINGLE_SEL|w x.WANTS_CHARS
    Thanks,
    Michele
    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.1 | | 987 bytes | |

    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, DWN), sometime I receive an error:

    wx.ListCtrl.Refre****ems(self, start, stop)
    File
    "/",
    line 4463, in Refre****ems
    return (*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.Refre****ems(self, start, stop)
    instead of self.Refre****ems(start, stop)? Second, is start stop?

    2) win the "return", "space", "escape", etc keys (so the function
    keys) are passed to the ListCtrl Char 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_DWN handler.
  • No.2 | | 926 bytes | |

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

    Any ideas will be much appreciated.

    Robert

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.3 | | 1059 bytes | |

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

    Any ideas will be much appreciated.

    Robert

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    --
  • No.4 | | 1396 bytes | |

    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 :(
    >
    >
    >Any ideas will be much appreciated.
    >
    >Robert
    >
    >
    >To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >


    bruce.who.hk
    2006-08-22

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.5 | | 1827 bytes | |

    2006/08/22, at 11:20, Nizam Sayeed 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.

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

    >Any ideas will be much appreciated.
    >>

    >Robert
    >>

    >
    >To unsubscribe, e-mail: wxPython-users-
    >unsubscribe (AT) lists (DOT) wxwidgets.org
    >For additional commands, e-mail: wxPython-users-
    >help (AT) lists (DOT) wxwidgets.org
    >>
    >>

    >
    >
    >
  • No.6 | | 1647 bytes | |

    Robert Gravina wrote:
    2006/08/22, at 11:20, Nizam Sayeed 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.


    >>

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

    Any ideas will be much appreciated.
  • No.7 | | 864 bytes | |

    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?

    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 S X.4.7

    Thank you,

    Harvey

    PGP SIGNATURE
    Version: GnuPG v1.4.1 (Darwin)

    kMhABq9YtZDPelzS+rHanHQ=
    =Mtm6
    PGP SIGNATURE
  • No.8 | | 545 bytes | |

    Richard Harvey Chapman wrote:
    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.
  • No.9 | | 361 bytes | |

    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 SIGNATURE
    Version: GnuPG v1.4.1 (Darwin)

    z/lcRnNdhh04x3oyujyiWV4=
    =X4yZ
    PGP SIGNATURE

Re: wxListCtrl problems


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "Python"

EMSDN.COM