1.2.10: CList bad behaviour



First of all, please forgive me if my message is out of topic, as I
haven't read the ML for a very long time.

I think I've found a bug with 1.2.10 while I was trying to implement a
2-column clist. When using gtk_clist_new(), I get only one column, and I
have to use gtk_clist_new_with_title() to obtain 2 columns. Here follows
the corresponding samples:

1/ GTK_CLIST_NEW
#include <gtk/gtk.h>
#include <string.h>
#include <stdlib.h>
[...]

GtkWidget winDebug, clReg;
unsigned int i;
char **txtReg;
txtReg=malloc(2*sizeof(char*));
txtReg[0]=malloc(16*sizeof(char));
txtReg[1]=malloc(64*sizeof(char));
strcpy(txtReg[0],"REGISTERS");
strcpy(txtReg[1],"UNDEFINED");

winDebug = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title( GTK_WINDOW(winDebug), "Debugger" );

clReg = gtk_clist_new(2);
for(i=0; i<16; i++)
{
  gtk_clist_append(GTK_CLIST(clReg), txtReg );
}



2/ GTK_CLIST_NEW_WITH_TITLES
GtkWidget winDebug, clReg;
unsigned int i;
char **txtReg;
txtReg=malloc(2*sizeof(char*));
txtReg[0]=malloc(16*sizeof(char));
txtReg[1]=malloc(64*sizeof(char));
strcpy(txtReg[0],"REGISTERS");
strcpy(txtReg[1],"UNDEFINED");

winDebug = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title( GTK_WINDOW(winDebug), "Debugger" );

clReg = gtk_clist_new_with_titles(2, txtReg );
for(i=0; i<16; i++)
{
  gtk_clist_append(GTK_CLIST(clReg), txtReg );
}


--------
Is there some bug in my code, or is it in gtk_clist_new code?
Thank you all.

David




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