Re: BUG in gtk_scrolled_window ?



Owen Taylor wrote:
> 
> Lee <drazka@geocities.com> writes:
> > However, once I add the list/ctree to the scrolled window container, any
> > events that occur, including clicking on an item, resizing the main
> > program window, or expanding a tree, seems to increase the _horizontal_
> > logical size of the scrolled window. This has the undesired effect of
> > shrinking the horizontal scrollbar by more and more the longer the
> > application is being used.
> 
> Well, nobody else is seeing this problem. So:
> 
>  - First check if it occur in testgtk? If it does,
>    then there is probably something about your system
>    that is triggering the bug. So, we'll have to
>    know something about your system. (See the "Reporting Bugs"
>    section of the tutorial)

The bug I'm seeing does _not_ appear to be present in testgtk of 1.1.14.
 
>  - If it doesn't occur in testgtk, then you should
>    try to figure out what you are doing differently.

I've been through every example I can find, read and re-read the
tutorial, and combed the relevent header files. As far as I can tell I'm
doing just what every body else is doing. However, the one thing that
*is* different is that I'm using a scrolled window in a hpaned.

>    If you can't find anything you are doing wrong, then
>    create a short test program that exhibits the problem
>    and post it here. Either somebody will be able
>    to tell you how to fix your problem, or we'll be
>    able to track down the bug in GTK+.

I have attached a fairly small test program that exhibits the bug
*every* time I click on the paned divider. Each time this is done, the
horizontal scrollbar shrinks, thus making it possible to scroll to a
greater amount of blank space.

This is persistant when built against both gtk+-1.1.13 and 1.1.14, so I
hope it is reproducable elsewhere. 
I am running on a P133 with Redhat 5.1. Kernel 2.0.36; in case that's of
any help.

Regards,

Lee Mallabone.
http://atlas.cs.york.ac.uk/~lrpm100/
#include <gtk/gtk.h>

void main (int argc, char *argv[]) {
   
   GtkWidget *window, *ctree, *ctree_scrolled_win, *paned, *hbox;
   GtkCTreeNode *top_item, *lower_item;
   int i, j;
   char *node_label[1];
   
   gtk_init (&argc, &argv);
   
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   
   ctree = gtk_ctree_new (1, 0);
   gtk_widget_show (ctree);
   
   for (i=0; i < 10; i++) {
      node_label[0] = "test item";
      top_item = gtk_ctree_insert_node (GTK_CTREE (ctree), NULL, NULL, node_label,
					0, NULL, NULL, NULL, NULL, FALSE, FALSE);
      node_label[0] = "test leaf";
      for (j=0; j < 25; j++) {
	 lower_item = gtk_ctree_insert_node (GTK_CTREE (ctree), top_item, NULL, node_label,
					     0, NULL, NULL, NULL, NULL, TRUE, TRUE);
      }
   }
	 
   gtk_widget_show (ctree);
   paned = gtk_hpaned_new ();
   gtk_widget_show (paned);
   
   ctree_scrolled_win = gtk_scrolled_window_new (NULL, NULL);
   gtk_container_add (GTK_CONTAINER (ctree_scrolled_win), ctree);
   gtk_widget_show (ctree_scrolled_win);
   
   hbox = gtk_hbox_new (FALSE, 2);
   gtk_widget_show (hbox);
   
   gtk_paned_pack1 (GTK_PANED (paned), ctree_scrolled_win, FALSE, FALSE);
   gtk_paned_pack2 (GTK_PANED (paned), hbox, FALSE, FALSE);
   
   gtk_container_add (GTK_CONTAINER (window), paned);
   gtk_widget_show (window);
   
   gtk_main();
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]