Odd problem...



-----BEGIN PGP SIGNED MESSAGE-----



Maybe one of you gtk gurus out there can shed some light on why this is 
seg faulting..

I have the following structure declared:

typedef struct __edit_host {
  GtkWidget     *window;
  GtkWidget     *widget[5];
} edit_host;

which is bundled inside another struct

typedef struct __app_info {
{
   edit_host    *edith_panel;
} app_info;

I do the following to create this 'panel':
  app_info->edith_panel = (edit_host *)g_malloc (sizeof (edit_host));
  app_info->edith_panel->window = new_window ("Edit Host", GTK_WINDOW_DIALOG,
					      GTK_WIN_POS_MOUSE, 2);
  gtk_signal_connect (GTK_OBJECT (app_info->edith_panel->window),
		      "delete_event",
		      GTK_SIGNAL_FUNC (epanel_delete_cb),
		      NULL);
  for (i = 0; i < ELABELS_NUM ; i++)
    {
      label = gtk_label_new (edit_labels[i]);
      gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
      gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, (i + 1),
			GTK_SHRINK | GTK_FILL, GTK_SHRINK, 1, 2);
      gtk_widget_show (label);
      app_info->edith_panel->widget[i] = gtk_entry_new ();
      gtk_object_set_data (GTK_OBJECT (app_info->edith_panel->widget[i]),
				 "which_button", (int *)i);
      gtk_signal_connect (GTK_OBJECT (app_info->edith_panel->widget[i]),
			  "activate", GTK_SIGNAL_FUNC (edit_entry_cb),
			  NULL);
      gtk_table_attach (GTK_TABLE (table), app_info->edith_panel->widget[i],
			1, 2, i, (i + 1),
			GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_EXPAND, 1, 2);
      gtk_widget_show (app_info->edith_panel->widget[i]);
    }
  gtk_widget_grab_focus (app_info->edith_panel->widget[0]);

All that works just fine...

Here comes the problem:
  if (app_info->edith_panel)
    {
      gtk_widget_destroy (app_info->edith_panel->window);
    }

It seg faults on the destroy... What am I missing here?

Elliot,
  I ran it with DMC() all around every call (man that was slow). 
It still dies on the destroy...

I have ten other panels set up in a similar fashion, this is the only 
one that is using an array for the widgets...

Hopefully someone can clue me in on what I did wrong...


- -- 
Gregory A. Mclean   |-------------------------------------------------------|
Systems Engineer    |          This space for rent!!                        |
Random Access Inc.  |                                                       |
InterNIC: GM1152    ---------------------------------------------------------



-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNPcrErVWe0kTMI75AQFhMAQAnX53GqmjzPlTe1TjE8RIJJwwftjgi5DG
/y0u7NFLTLoRviBObt9CLXSfpf2pyNARGLTiNow7AMQ7KlcSOS/IceaoWr5kIo6H
n7IhpcwhzfQb1wcZllyDTMNyoV/skroYhJKC+x9Mq6ORQV7oXmRcL5DjjYnOfdGK
4bf4C1VbLlE=
=BKYl
-----END PGP SIGNATURE-----



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