Re: Combo and glist destroy signal problem



In the example callback the contents of the combo is cleared without
destroying the combo so that new variables or strings can be added to it.
The line you are looking for is the one I pointed out with the asterix.

Then afterwards, inside the READ_DATA_MATRIX() function I call
gtk_combo_set_popdown_strings on the newly loaded values of the GList to
fill the combo again.

void
on_file_sel_ok_button_clicked          (GtkButton       *button,
                                        gpointer         user_data)
{
   int length;
   int i = 0;
   int j = 0;
   char temp_string[128];

   TAMAL_GLBL->ASCII_FILE_NAME = "";
   TAMAL_GLBL->ASCII_FILE_NAME =

gtk_file_selection_get_filename(GTK_FILE_SELECTION(TAMAL_GLBL->file_selection_dialog));

   length = strlen(TAMAL_GLBL->ASCII_FILE_NAME);

   if(TAMAL_GLBL->ASCII_FILE_NAME[length - 1] != '/')
   {
      TAMAL_GLBL->variable_index_list = NULL;
<---------------------------------******
      while(TAMAL_GLBL->ASCII_FILE_NAME[length] != '/')
      {
         temp_string[i] = TAMAL_GLBL->ASCII_FILE_NAME[length - 1];
         length = length - 1;
         ++i;
      }
      temp_string[i-1] = '\0';
      i = 0;
      length = strlen(temp_string) - 1;
      for(j = length; j >= 0; --j)
      {
         TAMAL_GLBL->SHORT_ASCII_FILE_NAME[j] = temp_string[i];
         ++i;
      }
      TAMAL_GLBL->SHORT_ASCII_FILE_NAME[i] = '\0';
      TAMAL_GLBL->PARAMETERS = 0;

      TAMAL_GLBL->OPENED_FILES = 1;

      UNCOMPRESS_SOURCE_FILE(TAMAL_GLBL->ASCII_FILE_NAME);

      gtk_object_destroy(GTK_OBJECT(TAMAL_GLBL->file_selection_dialog));

      READ_DATA_MATRIX();
   }
   else
   {
      gtk_statusbar_push( GTK_STATUSBAR(TAMAL_GLBL->statusbar),
                            TAMAL_GLBL->status_context_id, "You Sir, are and
IDIOT");

      while (gtk_events_pending())
      {
         gtk_main_iteration();
      }
   }
}


learfox furry ao net wrote:

I have a problem in which I have a GtkCombo set to recieve the "destroy"
signal.

Once the signal is recieved, I call gtk_get_object_user_data() on the
GtkCombo recieved as input on the signal handler.

The object's (GtkCombo's) user data is a glist that was passed to it
using gtk_combo_set_popdown_strings().

How can I deallocate the glist (and each of its datas) without messing up
the GtkCombo since it still needs it? gtk_combo_set_popdown_strings()
won't accept a NULL argument to remove the list from the GtkCombo.

--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                 http://furry.ao.net/~learfox/

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

--
Marco Quezada
Aerospaceo Engineero
NLX Corporation
22626 Sally Ride Dr.
Sterling, VA, 20164
mquezada nlxcorp com
703-234-2100 x1028
http://www.nlxcorp.com







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