Is it a bug or is me ?
- From: Bruno Mairlot <bruno virgoplus com>
- To: Gtk List <gtk-list redhat com>
- Subject: Is it a bug or is me ?
- Date: Sun, 31 Jan 1999 06:07:20 +0100
Helllo,
I'm using gtk+-1.1.14, and
the following program crash and core dump, desperately.  Is it a bug or
is it me that do it the wrong way (I'm always reluctant to say "it's a
bug" but this time ....it seems so !) I'd like to insert some text, in a
editabe widget (a text or an entry). So I chosed the
gtk_editable_insert_text function. Here is a small example that crash
on my box :
#include <stdio.h>
#include <gtk/gtk.h>
gint delete_event( GtkWidget *widget,
     GdkEvent  *event,
     gpointer   data )
{
  return(FALSE);
}
/* Another callback */
void destroy( GtkWidget *widget,
       gpointer   data )
{
  gtk_main_quit();
}
int main( int   argc,
   char *argv[] )
{
  gchar *text={"Bonjour"};
  GtkWidget *window;
  GtkWidget *button;
  GtkWidget *clist,*scroll;
  GtkWidget *txt;
  gtk_init(&argc, &argv);
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_signal_connect (GTK_OBJECT (window), "delete_event",
        GTK_SIGNAL_FUNC (delete_event), NULL);
  gtk_signal_connect (GTK_OBJECT (window), "destroy",
        GTK_SIGNAL_FUNC (destroy), NULL);
  gtk_container_border_width (GTK_CONTAINER (window), 10);
  txt=gtk_text_new(NULL,NULL);
  gtk_widget_set_usize(txt,200,200);
  gtk_widget_show(txt);
  gtk_container_add(GTK_CONTAINER(window),txt);
  gtk_text_set_editable(GTK_TEXT(txt),TRUE);
  /* if you remove this line, everything is ok ! */
  gtk_editable_insert_text(GTK_EDITABLE(txt),text,strlen(text),0);
  gtk_widget_show(window);
  gtk_main ();
  return(0);
}
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]