Page 1 of 1

combogadgets very slow

Posted: Sun Oct 15, 2017 4:00 pm
by collectordave
When using a combogadget to allow the user to select from a list when there are a lot of items the combo becomes unusable.

Tested on ubuntu 16.04.3LTS and PB5.45LTS.

Code: Select all

Global Window_0

Global Combo_0,iLoop

  Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
  Combo_0 = ComboBoxGadget(#PB_Any, 120, 20, 170, 20)
  
  For iLoop = 0 To 1000
    AddGadgetItem(Combo_0,-1,"Item Number " + Str(iLoop))
  Next iLoop
  
  
  Repeat
      
    Event = WaitWindowEvent()
    Select Event
      Case #PB_Event_CloseWindow
        End

    EndSelect
    
  ForEver
Just try the above. Then reduce the number to 10 and it is reasonable.

It seems that the automatic resizing is taking a very long time making combogadgets unusable on older hardware.

Can the combogadget be created with a fixed width hopefully preventing the interminable resizeing code from running?

Re: combogadgets very slow

Posted: Sat Oct 28, 2017 4:06 pm
by freak
This is a Gtk issue. Its not something we can solve on the PB side.

My guess is that the Gtk ComboBox is simply not designed to handle that many elements since such a long list would not be very user-friendly anyway.

Re: combogadgets very slow

Posted: Mon Nov 20, 2017 7:08 am
by collectordave
It does appear to be a GTK issue but only the upgradedd gtk for later versions of LINUX. It seems it is nothing to do with the length of the list but that linux attempts to resize the combo box each time an element is added.

The linux community say it is a pb problem.

Could go round and round.

CD

Re: combogadgets very slow

Posted: Fri Dec 08, 2017 8:57 pm
by Shardik
collectordave wrote:The linux community say it is a pb problem.
Would you please post a link to that discussion?

Re: combogadgets very slow

Posted: Mon Dec 11, 2017 8:52 am
by collectordave
Will post link when I can.

Something else I have noticed if you create the combo gadget as an editable gadget it does not resize still takes a while though.

Regards
cd