-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YComboBox addItem/addItems become very slow when the number of items is big #49
Comments
I can reproduce the issue but unfortunately I cannot help much, because I don't know GTK. From the libyui side, |
@mvidner i haven't understood if you mean to add start/end Multiple selection into gtk implementation or not, but i can confirm that adding that for the combobox widget defintely increase the performance. |
No, I don't plan to fix it now. Go ahead, and mention here the patch that has helped. |
i didn't fix anything :) just used the xxxxMultipleChanges methods on combo: diff --git a/examples/ManyWidgets.cc b/examples/ManyWidgets.cc
index 743def1..d645fe5 100644
--- a/examples/ManyWidgets.cc
+++ b/examples/ManyWidgets.cc
@@ -298,10 +298,15 @@ int main( int argc, char **argv )
cbox->setNotify( true );
{
YItemCollection items;
- items.push_back( new YItem( "Item 1" ) );
- items.push_back( new YItem( "Item 2" ) );
- items.push_back( new YItem( "Item 3" ) );
+ for (int i=0; i<11822;i++)
+ {
+ std::stringstream str;
+ str << "Item " << i;
+ items.push_back( new YItem( str.str() ) );
+ }
+ cbox->startMultipleChanges();
cbox->addItems( items ); // This is more efficient than repeatedly calling cbox->addItem
+ cbox->doneMultipleChanges();
}
cbox = YUI::widgetFactory()->createComboBox( atLeft(frame), "Editable:", true );
cbox->setNotify( true ); |
That is strange, I thought |
I see, but if you try my patch, you should easy verify what i mean :/ |
Since the Gtk backend is not developed or maintained by the YaST Team at SUSE, I'm adding the "other-maintainer" label to this in order to help filtering the various list of issues. |
I tested it with 2000 and i got it running after a while, qt and ncurses seem not to be affected.
I gave up waiting, with a bigger number (11821 items)
To test it patch ManyWidgets,cc as following:
The text was updated successfully, but these errors were encountered: