Hello,
stupid question from beginner - maybe.
I improve my beginner know how, and will call a function that displays source through libgtksourceview.
That function and it's callbacks is embedded in his own source-file, and has one header-file.
I defined a structure, which is declared in the function like this
Code:
static codeview_data data = {0};
and push it to the callpacks in the gpointer data argument of the g_signal_connect call.
The structure needs to be allocated statically, because the function builds up the gui, thread leaves ( and would free codeview_data if it isn't static ), and the main function calls gtk_main().
How to opereate to call the function several times using a new version of the structure without deleting the previous one ??
(i think similar to <object>.new() in c++, but dont know what to talk like that because not even familiar with)
I tried to allocate memory
Code:
codeview_data *data = malloc ( sizeof ( codeview_data ) );
but that doesnt work...tips anyhow??
greets chab