Bug in gtk_tree
- From: Daniel Åborg <tjost ctrl-c liu se>
- To: gtk-devel-list gnome org
- Subject: Bug in gtk_tree
- Date: Sat, 13 Oct 2001 20:18:07 +0200
Hi!
I've just started trying to use GTK-- to develop a GUI and have run
into a bug in GTK+ which stops me from getting further. I can't access
the bug tracker, so I'm hoping I can get a hint on this list instead.
Basically, if I try to create a gtk_tree with a lot of sub items below
the root item, say 2000, it won't show the sub items when I expand the
tree. I've attached a program which exhibits this problem. I'm using
GTK+ 1.2.10 under Debian with libc6 2.2.4 and XFree86 4.1.0.
I'm hoping I'm doing something wrong or there's another version which
doesn't have the problem or something like that. I'd be very grateful
for any help in this matter, I'd rather that I'm able to use GTK+/--
than have to use Qt.
Thanks!
/Daniel
--
Daniel Åborg <tjost ctrl-c liu se>
#include <gtk/gtk.h>
#include <gtk/gtktree.h>
#include <gtk/gtkscrolledwindow.h>
int main(int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *scrolledWindow;
GtkWidget *rootTree;
GtkWidget *rootItem;
GtkWidget *subTree;
GtkWidget *subItem;
int i;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
scrolledWindow = gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_usize(scrolledWindow, 200, 500);
gtk_container_add(GTK_CONTAINER(window), scrolledWindow);
rootTree = gtk_tree_new();
rootItem = gtk_tree_item_new_with_label("Root Item");
gtk_tree_append(GTK_TREE(rootTree), rootItem);
subTree = gtk_tree_new();
for (i = 0; i < 2000; i++)
{
subItem = gtk_tree_item_new_with_label("Sub Item");
gtk_tree_append(GTK_TREE(subTree), subItem);
}
gtk_widget_show_all(subTree);
gtk_tree_item_set_subtree(GTK_TREE_ITEM(rootItem), subTree);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledWindow), rootTree);
gtk_widget_show_all(window);
gtk_main();
return(0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]