gtk combo



Greetings, 

This is a fairly simple question I am sure, but I can't quite figure out why 
this bug is here... For some reason when the user changes the text field the 
program loses it upon second function call. Can someone please explain to me 
what I have done wrong? Thanks!

gchar*
ReturnTemplate( void )
{
	static GtkWidget *combo;
	gchar *string;

	if( !combo ) {
		GList *items=NULL;
		items = g_list_append (items, "/usr/local/template/templates/article.html");
		items = g_list_append (items, "/usr/local/template/templates/writer.html");
		items = g_list_append (items, "/usr/local/template/templates/intro.html");
		combo = gtk_combo_new();
		gtk_combo_set_popdown_strings (GTK_COMBO (combo), items);
		gtk_table_attach( GTK_TABLE(table), combo, 1, 3, 0, 1, GTK_FILL, GTK_FILL, 
1, 1 );
	}
	string = gtk_entry_get_text( GTK_ENTRY(GTK_COMBO(combo)->entry) );
	return( string );
}



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