Re: Clist/CTree source incompatible changes



I just tried fixing gcolorsel for recent gtk+ change - it now works,
but there is an assertion failure when I run it.  Can someone look at
this patch and comment?  I'm still quite new to all this :)

Also, the horizontal scrollbar probably isn't needed - is it possible
to can it?

(arg, how does one attach files with gnus?)

---
Sam Vilain, sam@whoever.com         work: sam.vilain@unisys.com
http://www.hydro.gen.nz                home: sam@hydro.gen.nz

Lars Hamann <lars@gtk.org> writes:

> I've just committed a patch to gtk+, which removes the scrollbars
> from GtkCList/CTree. So all gtk+ code, that uses a CList or CTree
> breaks. I.e. it will compile, but the scrollbars are gone. To make a
> CList scrollable you have to add it to a GtkScrolledWindow or just
> create the scrollbars on your own and set the adjustments in the clist.

---
Index: gcolorsel.c
===================================================================
RCS file: /cvs/gnome/gnome-utils/mini-utils/gcolorsel/gcolorsel.c,v
retrieving revision 1.2
diff -c -r1.2 gcolorsel.c
*** gcolorsel.c	1998/11/02 20:42:14	1.2
--- gcolorsel.c	1998/11/08 10:37:49
***************
*** 141,176 ****
  static GtkWidget *create_clist(void)
  {
          GdkColormap *colormap;
          
! 	clist = gtk_clist_new(3);
! 	gtk_clist_set_border(GTK_CLIST(clist), GTK_SHADOW_IN);
  
! 	gtk_clist_set_row_height(GTK_CLIST(clist), 18);
! 
! 	gtk_clist_set_column_width(GTK_CLIST(clist), 0, 52);
! 	gtk_clist_set_column_width(GTK_CLIST(clist), 1, 72);
! 	gtk_clist_set_column_title(GTK_CLIST(clist), 0, N_("Color"));
! 	gtk_clist_set_column_title(GTK_CLIST(clist), 1, N_("Value"));
! 	gtk_clist_set_column_title(GTK_CLIST(clist), 2, N_("Name"));
! 	gtk_clist_column_titles_show(GTK_CLIST(clist));
! 
! 	gtk_clist_set_policy(GTK_CLIST(clist), GTK_POLICY_AUTOMATIC, 
!         				       GTK_POLICY_AUTOMATIC);
! 
! 	gtk_signal_connect(GTK_OBJECT(clist), "select_row", 
  		GTK_SIGNAL_FUNC(select_row_cb), NULL);
  
!         colormap = gtk_widget_get_colormap(clist);
  	gdk_color_parse("black", &black);
  	gdk_color_alloc(colormap, &black);
  	
! 	gtk_object_set_data(GTK_OBJECT(clist), "colormap", colormap);
  
! 	gtk_clist_freeze(GTK_CLIST(clist));
! 	load_rgb(clist);
! 	gtk_clist_thaw(GTK_CLIST(clist));
  	
! 	return clist;
  }
  
  void set_swatch(RGBColor *c, GtkWidget *clist)
--- 141,181 ----
  static GtkWidget *create_clist(void)
  {
          GdkColormap *colormap;
+ 	GtkWidget *scrolled_win, *clist2;
          
! 	scrolled_win = gtk_scrolled_window_new (NULL, NULL);
! 	clist2 = gtk_clist_new(3);
! 	gtk_container_add (GTK_CONTAINER (scrolled_win), clist2);
! 
! 	gtk_clist_set_border(GTK_CLIST(clist2), GTK_SHADOW_IN);
! 
! 	gtk_clist_set_row_height(GTK_CLIST(clist2), 18);
! 
! 	gtk_clist_set_column_width(GTK_CLIST(clist2), 0, 52);
! 	gtk_clist_set_column_width(GTK_CLIST(clist2), 1, 72);
! 	gtk_clist_set_column_title(GTK_CLIST(clist2), 0, N_("Color"));
! 	gtk_clist_set_column_title(GTK_CLIST(clist2), 1, N_("Value"));
! 	gtk_clist_set_column_title(GTK_CLIST(clist2), 2, N_("Name"));
! 	gtk_clist_column_titles_show(GTK_CLIST(clist2));
! 
! 	gtk_clist_set_policy(GTK_SCROLLED_WINDOW (scrolled_win),
! 			     GTK_POLICY_AUTOMATIC, 
! 			     GTK_POLICY_AUTOMATIC);
  
! 	gtk_signal_connect(GTK_OBJECT(clist2), "select_row", 
  		GTK_SIGNAL_FUNC(select_row_cb), NULL);
  
!         colormap = gtk_widget_get_colormap(clist2);
  	gdk_color_parse("black", &black);
  	gdk_color_alloc(colormap, &black);
  	
! 	gtk_object_set_data(GTK_OBJECT(clist2), "colormap", colormap);
  
! 	gtk_clist_freeze(GTK_CLIST(clist2));
! 	load_rgb(clist2);
! 	gtk_clist_thaw(GTK_CLIST(clist2));
  	
! 	return scrolled_win;
  }
  
  void set_swatch(RGBColor *c, GtkWidget *clist)




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