FXIconList with frequent changes

Discussion in 'Ruby' started by martinus, Dec 18, 2004.

  1. martinus

    martinus Guest

    Hi, I am writing an application where I add, remove and modify random
    items of an FXIconList quite frequently. The only possible way i know
    to remove an item is through the index number. Unfortunately, whenever
    I add/modify + sort the list, the index changes; and I have to do a
    linear search to find the item I want to remove, which is painfully
    slow. Does anyone know a better way to do this? I use fxruby 1.0.
    martinus
     
    martinus, Dec 18, 2004
    #1
    1. Advertising

  2. martinus

    Lyle Johnson Guest

    On Sun, 19 Dec 2004 01:47:08 +0900, martinus <> wrote:

    > Hi, I am writing an application where I add, remove and modify random
    > items of an FXIconList quite frequently. The only possible way i know
    > to remove an item is through the index number. Unfortunately, whenever
    > I add/modify + sort the list, the index changes; and I have to do a
    > linear search to find the item I want to remove, which is painfully
    > slow. Does anyone know a better way to do this?


    Right offhand, I don't think there's an easy fix, other than perhaps
    storing the items' indices as their user data (and of course updating
    each item's data ever time you make a change to the list that would
    disrupt the indices. What kind of identifying information about the
    item do you have when you get ready to remove it? Or do you have a
    reference to the item itself?
     
    Lyle Johnson, Dec 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thotatri

    Frequent session time Expiry

    Thotatri, Jul 21, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    479
    Thotatri
    Jul 21, 2003
  2. Ben Pfaff

    supplementary C frequent answers

    Ben Pfaff, Jan 3, 2004, in forum: C Programming
    Replies:
    26
    Views:
    783
    Ben Pfaff
    Jan 5, 2004
  3. Jon Davis

    Frequent re-precompile on large site

    Jon Davis, Oct 27, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    333
    Jon Davis
    Oct 29, 2006
  4. Chuck
    Replies:
    4
    Views:
    671
    Alexey Smirnov
    Nov 4, 2009
  5. Karl

    FXIconList Questions

    Karl, Aug 5, 2003, in forum: Ruby
    Replies:
    0
    Views:
    117
Loading...

Share This Page