Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 283005 Details for
Bug 563393
[GTK] Crash on selection in Tree
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
GTK3 snippet to reproduce the crash with. Alternate clicking on the button, scrolling in the tree and clicking in the tree.
tree_crash.cpp (text/x-c++src), 2.16 KB, created by
Simeon Andreev
on 2020-05-25 05:24:26 EDT
(
hide
)
Description:
GTK3 snippet to reproduce the crash with. Alternate clicking on the button, scrolling in the tree and clicking in the tree.
Filename:
MIME Type:
Creator:
Simeon Andreev
Created:
2020-05-25 05:24:26 EDT
Size:
2.16 KB
patch
obsolete
>#include <gtk/gtk.h> > >enum >{ > COL_URI = 0, > NUM_COLS >} ; > >int n = 20; >GtkWidget *tree; >GtkTreeStore *treestore; > >int >reset_tree_elements () >{ > gtk_tree_view_set_model(GTK_TREE_VIEW(tree), NULL); > gtk_tree_store_clear(treestore); > gtk_tree_view_set_model(GTK_TREE_VIEW(tree), GTK_TREE_MODEL(treestore)); > > GtkTreeIter iter; > for (int i = 0; i < n; ++i) { > gtk_tree_store_append(treestore, &iter, NULL); > gtk_tree_store_set(treestore, &iter, > COL_URI, "item1", -1); > } > > return FALSE; >} > >void >create_view_and_model (void) >{ > GtkTreeViewColumn *col1, *col2; > GtkCellRenderer *renderer; > > treestore = gtk_tree_store_new(NUM_COLS, G_TYPE_STRING); > tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(treestore)); > > col1 = gtk_tree_view_column_new(); > > renderer = gtk_cell_renderer_text_new(); > > gtk_tree_view_column_set_title(col1, "column"); > gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col1); > gtk_tree_view_column_pack_start(col1, renderer, TRUE); > gtk_tree_view_column_add_attribute(col1, renderer, "text", COL_URI); > gtk_tree_view_column_set_fixed_width(col1, 150); > > reset_tree_elements(); >} > >GtkWidget * >create_button (void) >{ > GtkWidget *button; > button = gtk_button_new_with_label("click"); > return button; >} > >// gcc -g tree_crash.cpp `pkg-config --cflags --libs gtk+-3.0` -o TreeCrash > >int >main (int argc, char **argv) >{ > GtkWidget *window, *scrolled_window, *box, *button; > > gtk_init(&argc, &argv); > > window = gtk_window_new(GTK_WINDOW_TOPLEVEL); > g_signal_connect(window, "delete_event", gtk_main_quit, NULL); > gtk_window_set_default_size(GTK_WINDOW(window), 200, 200); > > scrolled_window = gtk_scrolled_window_new (NULL, NULL); > gtk_container_add (GTK_CONTAINER (window), scrolled_window); > > box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); > gtk_container_add(GTK_CONTAINER(scrolled_window), box); > > button = create_button(); > create_view_and_model(); > > g_signal_connect(button, "focus-out-event", G_CALLBACK (reset_tree_elements), NULL); > > gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0); > gtk_box_pack_start(GTK_BOX(box), tree, TRUE, TRUE, 0); > > gtk_widget_show_all(window); > > gtk_main(); > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 563393
:
282951
|
282952
|
282971
|
282974
|
282987
|
282988
| 283005