Re: gtk_combo_set_popdown_strings() coppies data?



This 3 lines will assign the same strings (variables_list_items) to 3 different
combo boxes without having to recreate the GList 2 more times. Incidently, the
list was loaded with the following routine:

   while(NEXT_LINE_AVAILABLE(TDF_GLBL->VARIABLES_LIST_FILE, temp_string))
   {
      temp_string[strlen(temp_string) - 2] = '\0';
      variables_list_items = g_list_append(variables_list_items,
g_strdup(temp_string));
   }

Then if you want to empty the contents of the combo before reloading or just for
cleaning purposes then you can simply set the GList pointer to NULL as such:

         variables_list_items = NULL;

I do this when I need to refresh the list so that we don't end up with duplicate
values or strings being appended at the end of the current GList.

Hope this is clear and it helps, if you need more help don't hesitate to ask.


Thanks for the response!

So basically I would have to record the glist, then when destroy comes
around: first deallocate the glist and each data, then set each data on
each glist item to NULL, then destroy the combo widget?

Is there a way to quickly deallocate AND set each data on a glist to NULL?


--
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/





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