Newsgroup: it.comp.os.linux.development
Titolo: Inviare Email

Salve
ho la necessità di inviare , tramite un programma scritto in c , email
a indirizzi di posta esterni al dominio.
Avevo trovato una libreria molto carina libsmtp ma non riesco a capire
il xke' ma non me le vuole installare....
qualcuno mi puo' dare dei consigli su come fare? o sa' come fare senza
usare questa libreria?
Grazie


Attento a quale libreria viene generata.  La versione che ho io è solo 
una libreria statica.
Non è strettamente necessario installarla, puoi semplicemente copiarla 
(assieme agli include file) nella directory dove stai sviluppando 
l'applicazione.
Ciao
Giovanni
-- 
   A computer is like an air conditioner,
   it stops working when you open Windows.
   Registered Linux user #337974  < 
http://giovanni.homelinux.net/
 >


scusa non l'ho mai fatto... come faccio? includo tutti i file presenti
nella cartella smtp?
e quando faccio gcc devo anche includere quelli?
grazie

 includere quelli?
È sufficiente copiare solo i files libsmtp.h, libsmtp_mime.h e 
libsmtp.a e libsmtp_mime.a.  In fase di link dovrai aggiungere
"-L . -lsmtp" in coda al comando.
Però dovresti spiegare perché non riesci ad installarla.  Io non avevo 
avuto problemi.


 qualcuno mi puo' dare dei consigli su come fare? 
Cos'ha il comando mail che non va?
Enrico


wrote:

che non riesce ad inviarmelo a email di posta qualsiasi....
io ho fatto:
system("mail 
em...@emial.it
 <  /home/utente/Scrivania/
messaggio.txt");
ma mi da' sempre errore....


nel comilare la libreria  quando lancio il comando make mi da' questi
errori
desktop:~/Scrivania/libsmtp-0.8.5$ make
make[1]: Entering directory `/home/diego/Scrivania/libsmtp-0.8.5/smtp'
gcc -I. -I../include `glib-config --cflags` -g -O2 -DUSE_MIME   -c -o
libsmtp_comm.o libsmtp_comm.c
/bin/sh: glib-config: not found
libsmtp_comm.c:28:20: error: glib.h: Nessun file o directory
In file included from libsmtp_comm.c:33:
../include/libsmtp.h:86: error: expected specifier-qualifier-list
before ‘GString’
../include/libsmtp.h:151: error: expected ‘)’ before ‘*’ token
../include/libsmtp.h:153: error: expected ‘)’ before ‘*’ token
libsmtp_comm.c:46: error: expected ‘)’ before ‘*’ token
libsmtp_comm.c:105: error: expected ‘)’ before ‘*’ token
libsmtp_comm.c: In function ‘libsmtp_int_send_body’:
libsmtp_comm.c:150: warning: incompatible implicit declaration of
built-in function ‘strlen’
libsmtp_comm.c:153: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:159: error: ‘struct libsmtp_session_struct’ has no
member named ‘BodyBytes’
libsmtp_comm.c: In function ‘libsmtp_dialogue’:
libsmtp_comm.c:169: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:169: error: (Each undeclared identifier is reported
only once
libsmtp_comm.c:169: error: for each function it appears in.)
libsmtp_comm.c:169: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:170: error: ‘GList’ undeclared (first use in this
function)
libsmtp_comm.c:170: error: ‘libsmtp_temp_glist’ undeclared (first use
in this function)
libsmtp_comm.c:177: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:178: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:180: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:191: error: ‘struct libsmtp_session_struct’ has no
member named ‘From’
libsmtp_comm.c:191: error: ‘struct libsmtp_session_struct’ has no
member named ‘Subject’
libsmtp_comm.c:191: error: ‘struct libsmtp_session_struct’ has no
member named ‘To’
libsmtp_comm.c:194: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:199: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:203: error: ‘struct libsmtp_session_struct’ has no
member named ‘From’
libsmtp_comm.c:208: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:216: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:220: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:222: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:229: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:233: error: ‘struct libsmtp_session_struct’ has no
member named ‘To’
libsmtp_comm.c:236: error: ‘struct libsmtp_session_struct’ has no
member named ‘To’
libsmtp_comm.c:240: error: expected ‘)’ before ‘gchar’
libsmtp_comm.c:248: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:255: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:262: error: ‘struct libsmtp_session_struct’ has no
member named ‘ToResponse’
libsmtp_comm.c:262: error: ‘struct libsmtp_session_struct’ has no
member named ‘ToResponse’
libsmtp_comm.c:262: warning: incompatible implicit declaration of
built-in function ‘strdup’
libsmtp_comm.c:266: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:268: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:272: error: ‘struct libsmtp_session_struct’ has no
member named ‘NumFailedTo’
libsmtp_comm.c:278: error: ‘struct libsmtp_session_struct’ has no
member named ‘CC’
libsmtp_comm.c:281: error: ‘struct libsmtp_session_struct’ has no
member named ‘CC’
libsmtp_comm.c:282: error: expected ‘)’ before ‘gchar’
libsmtp_comm.c:290: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:297: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:303: error: ‘struct libsmtp_session_struct’ has no
member named ‘CCResponse’
libsmtp_comm.c:303: error: ‘struct libsmtp_session_struct’ has no
member named ‘CCResponse’
libsmtp_comm.c:303: warning: incompatible implicit declaration of
built-in function ‘strdup’
libsmtp_comm.c:307: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:309: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:313: error: ‘struct libsmtp_session_struct’ has no
member named ‘NumFailedCC’
libsmtp_comm.c:319: error: ‘struct libsmtp_session_struct’ has no
member named ‘BCC’
libsmtp_comm.c:322: error: ‘struct libsmtp_session_struct’ has no
member named ‘BCC’
libsmtp_comm.c:323: error: expected ‘)’ before ‘gchar’
libsmtp_comm.c:331: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:338: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:345: error: ‘struct libsmtp_session_struct’ has no
member named ‘BCCResponse’
libsmtp_comm.c:345: error: ‘struct libsmtp_session_struct’ has no
member named ‘BCCResponse’
libsmtp_comm.c:345: warning: incompatible implicit declaration of
built-in function ‘strdup’
libsmtp_comm.c:349: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:351: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:353: error: ‘struct libsmtp_session_struct’ has no
member named ‘NumFailedBCC’
libsmtp_comm.c: In function ‘libsmtp_dialogue_send’:
libsmtp_comm.c:364: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:364: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:370: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:371: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:373: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:379: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:386: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c: In function ‘libsmtp_headers’:
libsmtp_comm.c:402: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:402: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:403: error: ‘GList’ undeclared (first use in this
function)
libsmtp_comm.c:403: error: ‘libsmtp_temp_glist’ undeclared (first use
in this function)
libsmtp_comm.c:414: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:414: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:417: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:422: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:434: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:438: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:440: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:447: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:454: error: ‘struct libsmtp_session_struct’ has no
member named ‘From’
libsmtp_comm.c:462: error: ‘struct libsmtp_session_struct’ has no
member named ‘Subject’
libsmtp_comm.c:474: warning: incompatible implicit declaration of
built-in function ‘sprintf’
libsmtp_comm.c:474: warning: incompatible implicit declaration of
built-in function ‘labs’
libsmtp_comm.c:486: error: ‘struct libsmtp_session_struct’ has no
member named ‘To’
libsmtp_comm.c:490: error: ‘struct libsmtp_session_struct’ has no
member named ‘To’
libsmtp_comm.c:493: error: ‘struct libsmtp_session_struct’ has no
member named ‘To’
libsmtp_comm.c:511: error: ‘struct libsmtp_session_struct’ has no
member named ‘CC’
libsmtp_comm.c:515: error: ‘struct libsmtp_session_struct’ has no
member named ‘CC’
libsmtp_comm.c:519: error: ‘struct libsmtp_session_struct’ has no
member named ‘CC’
libsmtp_comm.c:522: error: ‘struct libsmtp_session_struct’ has no
member named ‘CC’
libsmtp_comm.c: In function ‘libsmtp_header_send’:
libsmtp_comm.c:547: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:547: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:551: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:551: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:554: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:559: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:571: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:575: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:577: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:584: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c: In function ‘libsmtp_body_send_raw’:
libsmtp_comm.c:608: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:609: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:611: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:619: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:621: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:621: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:630: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c: In function ‘libsmtp_body_end’:
libsmtp_comm.c:644: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:644: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:649: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:651: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:656: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:676: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:680: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c: In function ‘libsmtp_quit’:
libsmtp_comm.c:695: error: ‘GString’ undeclared (first use in this
function)
libsmtp_comm.c:695: error: ‘libsmtp_temp_gstring’ undeclared (first
use in this function)
libsmtp_comm.c:698: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:698: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:703: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:716: error: ‘struct libsmtp_session_struct’ has no
member named ‘LastResponseCode’
libsmtp_comm.c:720: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:723: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:730: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
libsmtp_comm.c:733: error: ‘struct libsmtp_session_struct’ has no
member named ‘Stage’
libsmtp_comm.c:739: error: ‘struct libsmtp_session_struct’ has no
member named ‘ErrorCode’
make[1]: *** [libsmtp_comm.o] Error 1
make[1]: Leaving directory `/home/diego/Scrivania/libsmtp-0.8.5/smtp'
make: *** [all] Error 1

 libsmtp_comm.c:28:20: error: glib.h: Nessun file o directory
secondo me il problema sta qui....
ilSimo
-- 
now playing: 
All men come,
To see the king of the world
The time has come for everyone,
The saviour stands for all of us,
Now praise the one who'll destroy,
The evil abyss of the void
The evil abyss of the void
The evil abyss of the void
                                Gammaray - The Abyss Of The Void

salve a tutti,sto sviluppando,piů per gioco che altro,un'interfaccia 
grafica in C usando le GTK+,ora il programma funziona decentemente ma 
trovo dei problemi nel creare delle finestre di dialogo all'interno di 
un pthread che ho chiamato,il programma fa questo:
1-crea la finestra principale
2-crea un thread che fa dei controlli
3-a seconda del esito dei controlli il thread apre un MessageDialog
questo č il codice che crea il MessageDialog:
___
GtkWidget *WinTemp;
WinTemp=gtk_message_dialog_new(NULL,GTK_DIALOG_MODAL,GTK_MESSAGE_WARNING,GTK_BUTTONS_OK,"Primary_mes");
 
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(WinTemp),"secondary_mess");
gtk_widget_show(WinTemp);
//assign the clicked button event to function callback
g_signal_connect_swapped(WinTemp,"response",G_CALLBACK(gtk_widget_destroy),WinTemp);
___
dopo averlo compilato,l'ho eseguito cinque volte da terminale dandomi 
cinque errori diversi ???
*il primo errore recita cosě:*
(visualhunter:9023): Gdk-CRITICAL **: gdk_window_set_geometry_hints: 
assertion `GDK_IS_WINDOW (window)' failed
visualhunter: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int) 
((xcb_req) - (dpy->request)) >= 0)' failed.
Aborted
*il secondo cosě:*
(visualhunter:10490): Gdk-CRITICAL **: gdk_window_set_geometry_hints: 
assertion `GDK_IS_WINDOW (window)' failed
(visualhunter:10490): Gdk-CRITICAL **: gdk_window_resize: assertion 
`GDK_IS_WINDOW (window)' failed
(visualhunter:10490): Gdk-CRITICAL **: 
gdk_window_freeze_toplevel_updates_libgtk_only: assertion `window != 
NULL' failed
Segmentation fault
*mentre il terzo ...*
(visualhunter:15073): Gdk-CRITICAL **: gdk_window_set_geometry_hints: 
assertion `GDK_IS_WINDOW (window)' failed
**
** 
GLib-GObject:ERROR:(/build/buildd/glib2.0-2.16.3/gobject/gsignal.c:652):emission_pop: 
code should not be reached
Aborted
etc..mi servirebbe una mano a interpretare gli errori,non riesco a 
capire dove sbaglio ,pare che la sintassi che ho usato per creare il 
GtkMessageDialog sia corretta perché se lo faccio creare dal processo 
principale e non dal thread non mi da alcun errore
BYE :)
-- 
             ]f    ]QQQa.    ]m  ]f
   ,.        ]f    ]f -4L    ]WL ]f         _
   $Qa,      ]f    ]f  -Q    ]f$,]f      _aQV
    -?Qg/    ]f    ]f   Q    ]f)L]f    _y@?`
    _amV'    ]f    ]f  <D    ]f 4yf    )9Qa,
   y@?`      ]f    ]6awW'    ]f +Qf      -?Qw
   "         )'    )??"`     )'  ?'         "
CP : 
http://sourceforge.net/projects/visualhunter/
Skype: IacopoDeeNosee
LastFM: 
http://www.lastfm.it/user/IacopoDeeNosee/


wrote:

ciao, molto probabilmente ho configurato male il server exim4...
c'e' qualcun che mi sa dare 2 dritte?
Grazie

 libsmtp_comm.c:28:20: error: glib.h: Nessun file o directory
Non è che non riesci ad installarla :-) Proprio non si compila perché 
ti manca il pacchetto delle glib.  La Slackware ha installata la 
glib-1.2.10 in cui sono inclusi quei files.  C'è anche la glib2-2.10.3 
ma non so la differenza.
Tutti gli errori che seguono sono dovuti alla mancanza di quei files.


 ciao, molto probabilmente ho configurato male il server exim4...
Piu` che "molto probabilmente" direi "quasi sicuramente". Posto che non
e` qui il luogo adatto per disquisire la configurazione di un MTA, mi
preme avvertirti di una cosa: usando mail ti leghi al sistema[1], e
non so quanto sia importante per il tuo scopo questo punto
Enrico
[1] inteso come Linux, e non come distribuzione

 un pthread che ho chiamato,il programma fa questo:
Non puoi.
Le funzioni GTK vanno sempre chiamate TUTTE sullo stesso thread, se vuoi 
utilizzare il multithread con GTK ti conviene usare gtk_idle_add() per 
far aggiornare una finestra da un thread secondario.
GTK e` un sistema ad eventi, in un sistema ad eventi il multithread ti 
serve solo x eseguire funzioni che eseguono calcoli complessi, in quel 
caso il meccanismo di idling e' ottimo (pseudo esempio):
Callback di un pulsante:
creo finestra di rendering
lancio thread
fine callback.
thread di rendering:
loop di calcolo
eseguo calcolo
alloco una struttura contenente una COPIA dei parametri da visualizzare 
nella gui
aggiorno gui (chiamo gtk_idle_add con una funzione di aggiornamento)
fine loop
chiamo gtk_idle_add con una funzione che notifichi la chiusura della 
finestra.
funzione di aggiornamento (parametri i dati da visualizzare):
aggiorno le varie label e widget vari
libero la struttura contenente la copia dei parametri
esco con return FALSE perche` deve essere eseguita solo una volta.
funzione di notifica chiusura (parametro la finestra da chiudere):
chiudo la finestra
esco con return FALSE

 caso il meccanismo di idling e' ottimo CUT
in pratica usando *g_idle_add()* permetto al thread di intromettersi nel 
processo principale quando questo non è in attesa di eventi ad elevata 
priorità,giusto?comunque girovagando per la rete ho sbattuto il muso in 
questa pagina:
http://library.gnome.org/devel/gtk-faq/stable/x482.html
qui consigliano di chiamare *g_thread_init()* per poter bloccare 
l'accesso dati fra i processi,ora se voglio seguire questo metodo dovrò 
usare i *g_thread_create* invece dei *pthread_create*?
grazie per la pazienza :)
-- 
             ]f    ]QQQa.    ]m  ]f
   ,.        ]f    ]f -4L    ]WL ]f         _
   $Qa,      ]f    ]f  -Q    ]f$,]f      _aQV
    -?Qg/    ]f    ]f   Q    ]f)L]f    _y@?`
    _amV'    ]f    ]f  <D    ]f 4yf    )9Qa,
   y@?`      ]f    ]6awW'    ]f +Qf      -?Qw
   "         )'    )??"`     )'  ?'         "
CP : 
http://sourceforge.net/projects/visualhunter/
Skype: IacopoDeeNosee
OpenID: 
http://iacopodeenosee7.myopenid.com/
LastFM: 
http://www.lastfm.it/user/IacopoDeeNosee/

 *g_thread_create* invece dei *pthread_create*?
g_thread_init() serve per poter accedere alle stesse strutture dati di 
GLib (e quindi anche alla GUI in Gtk, visto che sono sempre oggetti GLib) 
contemporaneamente da due thread.
Quindi ti serve, per esempio, per aggiornare contemporaneamente due 
listview leggendo da due path diversi sul disco.
Se invece lasci a un solo thread la gestione dell'interfaccia (e delle 
altre strutture GLib), e demandi a thread diversi solo task di calcolo su 
aree di memoria o su variabili generiche (non GLib), non ti serve, e puoi 
usare normalmente i pthread.
Non so se mi sono spiegato bene... :)
In caso, dai un'occhiata anche a Vala (
http://live.gnome.org/Vala
) che 
astrae completamente l'accesso a GLib, e permette anche di creare 
programmi multithread in modo molto semplice (anche se non ho ancora 
provato).
Bye

 usare i *g_thread_create* invece dei *pthread_create*?
E' indifferente usare pthread direttamente o il wrapper che fornisce 
glib, per questioni di portabilita` ti consiglio di usare 
g_thread_create (visto che le pthread su windows dovresti scaricartele 
in un pacchetto a parte).
Occhio pero`, dopo aver usato g_thread_init() se vuoi accedere alle 
strutture dati gtk da thread concorrenti dovrai iniziare a fare una 
marea di chiamate a gdk_threads_enter() / gdk_threads_leave() intorno ad 
ogni chiamata GTK che non sia chiamata nel thread principale, inoltre 
quello che volevi fare inizialmente non potresti farlo comunque (aprire 
una finestra su un thread derivato), in quanto sdoppieresti il 
gtk_main() su due thread che e` una cosa non supportata.
Tra parentesi questo meccanismo (gdk_threads_enter/leave) non funziona 
del tutto su windows e anche su linux ha la brutta abitudine di portare 
a situazioni di deadlock (non e' facile stabilire quando va lockato gdk 
e quando no, ad esempio una callback locka di suo, ma un gestore di 
timer no).
Avevo una grossa applicazione che utilizzava questo approccio e non sono 
mai riuscito a renderla stabile e affidabile al 100%, al contrario 
convertendola all'uso di g_idle_add e` diventata solida come una roccia, 
anche su windows.
--
Bye,
  Gabry

grazie a entrambi per le delucidazioni,ho capito che dovrò impostare il
programma in modo tale che solo il thread principale gestisca la GUI per 
evitare inutili grattacapi ;)
Ho provato,per curiosità, i due metodi,il sistema del 
*gdk_threads_enter() / gdk_threads_leave()* funziona egregiamente mentre 
il sistema *g_idle_add* mi manda in loop il computer non presentandomi 
alcun errore nel terminale,dovrò studiarmelo meglio...
grazie ancora BYE :)
-- 
             ]f    ]QQQa.    ]m  ]f
   ,.        ]f    ]f -4L    ]WL ]f         _
   $Qa,      ]f    ]f  -Q    ]f$,]f      _aQV
    -?Qg/    ]f    ]f   Q    ]f)L]f    _y@?`
    _amV'    ]f    ]f  <D    ]f 4yf    )9Qa,
   y@?`      ]f    ]6awW'    ]f +Qf      -?Qw
   "         )'    )??"`     )'  ?'         "
CP : 
http://sourceforge.net/projects/visualhunter/
Skype: IacopoDeeNosee
LastFM: 
http://www.lastfm.it/user/IacopoDeeNosee/