diff --git a/ChangeLog b/ChangeLog index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6bac81d2de..dcd235c631 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Mon Jun 1 12:47:56 BST 1998 Tony Gale + + * docs/gtk_tut_it.sgml: Update of Italian Tutorial + to Tutorial of 24th May, from Daniele Canazza + Fri May 29 13:53:57 BST 1998 Tony Gale * docs/gtk_tut.sgml: diff --git a/docs/gtk_tut_it.sgml b/docs/gtk_tut_it.sgml index c524692731..72cbf6aeea 100644 --- a/docs/gtk_tut_it.sgml +++ b/docs/gtk_tut_it.sgml @@ -5,7 +5,7 @@ name="<imain@gtk.org>">, Tony Gale -April 6th, 1998 - Traduzione aggiornata al 1 Maggio 1998 +May 24th, 1998 - Traduzione aggiornata al 27 Maggio 1998 Tradotto da Michel Morelli, , Daniele Canazza, e Antonio Schifano, @@ -342,7 +342,7 @@ La funzione specificata come terzo argomento è chiamata ``funzione di ritorno (callback)'', e dovrebbe essere della forma: -void callback_func(GtkWidget *widget, gpointer *callback_data); +void callback_func(GtkWidget *widget, gpointer callback_data);

Dove il primo argomento sarà un puntatore al widget che emette il segnale @@ -391,7 +391,7 @@ difficile farci invece qualcosa. Il prossimo esempio userà l'argomento pa per dire quale bottone è stato premuto. -void hello (GtkWidget *widget, gpointer *data) +void hello (GtkWidget *widget, gpointer data) { g_print ("Hello World\n"); } @@ -423,7 +423,7 @@ chiamando gtk_main_quit(). Questa funzione dice a GTK che deve uscire da gtk_mai quando gli viene restituito il controllo. -void destroy (GtkWidget *widget, gpointer *data) +void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -661,13 +661,13 @@ l'impacchettamento dei widget. /* La nostra funzione di callback migliorata. I dati passati a questa * vengono stampati su stdout. */ -void callback (GtkWidget *widget, gpointer *data) +void callback (GtkWidget *widget, gpointer data) { g_print ("Hello again - %s was pressed\n", (char *) data); } /* Un'altra callback */ -void delete_event (GtkWidget *widget, gpointer *data) +void delete_event (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -901,7 +901,7 @@ problemi nel seguirlo. Compilatelo voi stessi e provate a giocarci un po'. #include "gtk/gtk.h" void -delete_event (GtkWidget *widget, gpointer *data) +delete_event (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -1348,13 +1348,13 @@ Ecco il codice sorgente: /* la nostra funzione di ritorno. * i dati passati a questa funzione vengono stampati su stdout */ -void callback (GtkWidget *widget, gpointer *data) +void callback (GtkWidget *widget, gpointer data) { g_print ("Hello again - %s was pressed\n", (char *) data); } /* questa funzione fa uscire dal programma */ -void delete_event (GtkWidget *widget, gpointer *data) +void delete_event (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -1699,7 +1699,7 @@ GtkWidget *xpm_label_box (GtkWidget *parent, gchar *xpm_filename, gchar *label_t } /* la nostra solita funzione di callback */ -void callback (GtkWidget *widget, gpointer *data) +void callback (GtkWidget *widget, gpointer data) { g_print ("Hello again - %s was pressed\n", (char *) data); } @@ -1922,7 +1922,7 @@ Nel seguente esempio creiamo un gruppo di tre radio-bottoni. #include #include -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } @@ -2059,8 +2059,8 @@ distribuito con GTK. Con alcuni widget (per esempio con l'etichetta) i suggerimenti non funzionano.

La prima chiamata che si usa per creare un nuovo tooltip è la seguente. -In una data funzione, è necessario chiamarla una sola volta: il GtkTooltip -che viene ritornato da questa funzione può essere usato per creare suggerimenti +In una data funzione, è necessario chiamarla una sola volta: il @@ -2071,14 +2071,15 @@ Una volta creato un nuovo suggerimento e il widget su cui lo volete usare, basta usare la seguente chiamata per fare l'assegnazione: -void gtk_tooltips_set_tips (GtkTooltips *tooltips, - GtkWidget *widget, - gchar *tips_text); +void gtk_tooltips_set_tip (GtkTooltips *tooltips, + GtkWidget *widget, + const gchar *tip_text, + const gchar *tip_private); Il primo argomento è il suggerimento che era già stato creato, che è seguito dal widget da cui volete che spunti il suggerimento e dal testo che volete -venga mostrato. +venga mostrato. L'ultimo argomento può essere posto a NULL.

Ecco un piccolo esempio: @@ -2089,9 +2090,8 @@ GtkWidget *button; tooltips = gtk_tooltips_new (); button = gtk_button_new_with_label ("button 1"); ... -gtk_tooltips_set_tips (tooltips, button, "This is button 1"); +gtk_tooltips_set_tips (tooltips, button, "This is button 1", NULL); - Ci sono anche altre funzioni che si usano con i suggerimenti. Eccone una lista con una breve descrizione di quello che fanno. @@ -2209,7 +2209,7 @@ void progress_r (void) pstat = FALSE; } -void destroy (GtkWidget *widget, gpointer *data) +void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -2331,7 +2331,7 @@ GtkWidget* gtk_dialog_new (void); Per cui, per creare una nuova finestra di dialogo, uate: -GtkWidget window; +GtkWidget *window; window = gtk_dialog_new (); @@ -2521,12 +2521,12 @@ static const char * xpm_data[] = { /* quando invocata (con il segnale delete_event), termina l'applicazione. */ -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } /* invocata se il bottone è clickato. Stampa semplicemente un messaggio */ -void button_clicked( GtkWidget *widget, gpointer *data ) { +void button_clicked( GtkWidget *widget, gpointer data ) { printf( "button clicked\n" ); } @@ -2724,7 +2724,7 @@ static char * WheelbarrowFull_xpm[] = { /* quando invocata (con il segnale delete_event), termina l'applicazione. */ -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } @@ -2884,7 +2884,7 @@ La sistemazione dell'area di disegno e dei righelli viene fatta usando una tabel /* il controllo raggiunge questa routine quando si preme il bottone close */ -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } @@ -3010,7 +3010,7 @@ elementi sulla barra di stato e l'altro per riuovere l'ultimo elemento.. GtkWidget *status_bar; -void push_item (GtkWidget *widget, gpointer *data) +void push_item (GtkWidget *widget, gpointer data) { static int count = 1; char buff[20]; @@ -3021,7 +3021,7 @@ void push_item (GtkWidget *widget, gpointer *data) return; } -void pop_item (GtkWidget *widget, gpointer *data) +void pop_item (GtkWidget *widget, gpointer data) { gtk_statusbar_pop( GTK_STATUSBAR(status_bar), (guint) &data ); return; @@ -3559,7 +3559,7 @@ void file_ok_sel (GtkWidget *w, GtkFileSelection *fs) g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); } -void destroy (GtkWidget *widget, gpointer *data) +void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -3752,7 +3752,7 @@ void remove_book (GtkButton *button, GtkNotebook *notebook) gtk_widget_draw(GTK_WIDGET(notebook), NULL); } -void delete (GtkWidget *widget, gpointer *data) +void delete (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -3930,7 +3930,7 @@ visualizzata, mentre con GTK_POLICY_ALWAYS la barra verrà sempre mostrata #include -void destroy(GtkWidget *widget, gpointer *data) +void destroy(GtkWidget *widget, gpointer data) { gtk_main_quit(); } @@ -5116,7 +5116,7 @@ void gtk_menu_bar_append( GtkMenuBar *menu_bar, GtkWidget *menu_item); che nel nostro caso è: -gtk_menu_bar_append( menu_bar, file_item ); +gtk_menu_bar_append( GTK_MENU_BAR(menu_bar), file_item ); @@ -5855,7 +5855,7 @@ caldamente di dare un'occhiata ai loro rispettivi file header nella distribuzione di GTK. I nomi delle funzioni di GTK sono molto descrittivi. Non appena si capisce come funzionano le cose, non è difficile dedurre il modo d'uso di un widget semplicemente guardando la -dichiarazione di funzione ad esso associata. Aggiungendo a questo qualche +dichiarazione di funzione associata ad esso. Aggiungendo a questo qualche spunto tratto dal codice di altri non dovrebbero esserci problemi. Quando avrete raggiunto una comprensione globale di tutte le funzioni diff --git a/docs/tutorial/gtk_tut_it.sgml b/docs/tutorial/gtk_tut_it.sgml index c524692731..72cbf6aeea 100644 --- a/docs/tutorial/gtk_tut_it.sgml +++ b/docs/tutorial/gtk_tut_it.sgml @@ -5,7 +5,7 @@ name="<imain@gtk.org>">, Tony Gale -April 6th, 1998 - Traduzione aggiornata al 1 Maggio 1998 +May 24th, 1998 - Traduzione aggiornata al 27 Maggio 1998 Tradotto da Michel Morelli, , Daniele Canazza, e Antonio Schifano, @@ -342,7 +342,7 @@ La funzione specificata come terzo argomento è chiamata ``funzione di ritorno (callback)'', e dovrebbe essere della forma: -void callback_func(GtkWidget *widget, gpointer *callback_data); +void callback_func(GtkWidget *widget, gpointer callback_data);

Dove il primo argomento sarà un puntatore al widget che emette il segnale @@ -391,7 +391,7 @@ difficile farci invece qualcosa. Il prossimo esempio userà l'argomento pa per dire quale bottone è stato premuto. -void hello (GtkWidget *widget, gpointer *data) +void hello (GtkWidget *widget, gpointer data) { g_print ("Hello World\n"); } @@ -423,7 +423,7 @@ chiamando gtk_main_quit(). Questa funzione dice a GTK che deve uscire da gtk_mai quando gli viene restituito il controllo. -void destroy (GtkWidget *widget, gpointer *data) +void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -661,13 +661,13 @@ l'impacchettamento dei widget. /* La nostra funzione di callback migliorata. I dati passati a questa * vengono stampati su stdout. */ -void callback (GtkWidget *widget, gpointer *data) +void callback (GtkWidget *widget, gpointer data) { g_print ("Hello again - %s was pressed\n", (char *) data); } /* Un'altra callback */ -void delete_event (GtkWidget *widget, gpointer *data) +void delete_event (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -901,7 +901,7 @@ problemi nel seguirlo. Compilatelo voi stessi e provate a giocarci un po'. #include "gtk/gtk.h" void -delete_event (GtkWidget *widget, gpointer *data) +delete_event (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -1348,13 +1348,13 @@ Ecco il codice sorgente: /* la nostra funzione di ritorno. * i dati passati a questa funzione vengono stampati su stdout */ -void callback (GtkWidget *widget, gpointer *data) +void callback (GtkWidget *widget, gpointer data) { g_print ("Hello again - %s was pressed\n", (char *) data); } /* questa funzione fa uscire dal programma */ -void delete_event (GtkWidget *widget, gpointer *data) +void delete_event (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -1699,7 +1699,7 @@ GtkWidget *xpm_label_box (GtkWidget *parent, gchar *xpm_filename, gchar *label_t } /* la nostra solita funzione di callback */ -void callback (GtkWidget *widget, gpointer *data) +void callback (GtkWidget *widget, gpointer data) { g_print ("Hello again - %s was pressed\n", (char *) data); } @@ -1922,7 +1922,7 @@ Nel seguente esempio creiamo un gruppo di tre radio-bottoni. #include #include -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } @@ -2059,8 +2059,8 @@ distribuito con GTK. Con alcuni widget (per esempio con l'etichetta) i suggerimenti non funzionano.

La prima chiamata che si usa per creare un nuovo tooltip è la seguente. -In una data funzione, è necessario chiamarla una sola volta: il GtkTooltip -che viene ritornato da questa funzione può essere usato per creare suggerimenti +In una data funzione, è necessario chiamarla una sola volta: il @@ -2071,14 +2071,15 @@ Una volta creato un nuovo suggerimento e il widget su cui lo volete usare, basta usare la seguente chiamata per fare l'assegnazione: -void gtk_tooltips_set_tips (GtkTooltips *tooltips, - GtkWidget *widget, - gchar *tips_text); +void gtk_tooltips_set_tip (GtkTooltips *tooltips, + GtkWidget *widget, + const gchar *tip_text, + const gchar *tip_private); Il primo argomento è il suggerimento che era già stato creato, che è seguito dal widget da cui volete che spunti il suggerimento e dal testo che volete -venga mostrato. +venga mostrato. L'ultimo argomento può essere posto a NULL.

Ecco un piccolo esempio: @@ -2089,9 +2090,8 @@ GtkWidget *button; tooltips = gtk_tooltips_new (); button = gtk_button_new_with_label ("button 1"); ... -gtk_tooltips_set_tips (tooltips, button, "This is button 1"); +gtk_tooltips_set_tips (tooltips, button, "This is button 1", NULL); - Ci sono anche altre funzioni che si usano con i suggerimenti. Eccone una lista con una breve descrizione di quello che fanno. @@ -2209,7 +2209,7 @@ void progress_r (void) pstat = FALSE; } -void destroy (GtkWidget *widget, gpointer *data) +void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -2331,7 +2331,7 @@ GtkWidget* gtk_dialog_new (void); Per cui, per creare una nuova finestra di dialogo, uate: -GtkWidget window; +GtkWidget *window; window = gtk_dialog_new (); @@ -2521,12 +2521,12 @@ static const char * xpm_data[] = { /* quando invocata (con il segnale delete_event), termina l'applicazione. */ -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } /* invocata se il bottone è clickato. Stampa semplicemente un messaggio */ -void button_clicked( GtkWidget *widget, gpointer *data ) { +void button_clicked( GtkWidget *widget, gpointer data ) { printf( "button clicked\n" ); } @@ -2724,7 +2724,7 @@ static char * WheelbarrowFull_xpm[] = { /* quando invocata (con il segnale delete_event), termina l'applicazione. */ -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } @@ -2884,7 +2884,7 @@ La sistemazione dell'area di disegno e dei righelli viene fatta usando una tabel /* il controllo raggiunge questa routine quando si preme il bottone close */ -void close_application( GtkWidget *widget, gpointer *data ) { +void close_application( GtkWidget *widget, gpointer data ) { gtk_main_quit(); } @@ -3010,7 +3010,7 @@ elementi sulla barra di stato e l'altro per riuovere l'ultimo elemento.. GtkWidget *status_bar; -void push_item (GtkWidget *widget, gpointer *data) +void push_item (GtkWidget *widget, gpointer data) { static int count = 1; char buff[20]; @@ -3021,7 +3021,7 @@ void push_item (GtkWidget *widget, gpointer *data) return; } -void pop_item (GtkWidget *widget, gpointer *data) +void pop_item (GtkWidget *widget, gpointer data) { gtk_statusbar_pop( GTK_STATUSBAR(status_bar), (guint) &data ); return; @@ -3559,7 +3559,7 @@ void file_ok_sel (GtkWidget *w, GtkFileSelection *fs) g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); } -void destroy (GtkWidget *widget, gpointer *data) +void destroy (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -3752,7 +3752,7 @@ void remove_book (GtkButton *button, GtkNotebook *notebook) gtk_widget_draw(GTK_WIDGET(notebook), NULL); } -void delete (GtkWidget *widget, gpointer *data) +void delete (GtkWidget *widget, gpointer data) { gtk_main_quit (); } @@ -3930,7 +3930,7 @@ visualizzata, mentre con GTK_POLICY_ALWAYS la barra verrà sempre mostrata #include -void destroy(GtkWidget *widget, gpointer *data) +void destroy(GtkWidget *widget, gpointer data) { gtk_main_quit(); } @@ -5116,7 +5116,7 @@ void gtk_menu_bar_append( GtkMenuBar *menu_bar, GtkWidget *menu_item); che nel nostro caso è: -gtk_menu_bar_append( menu_bar, file_item ); +gtk_menu_bar_append( GTK_MENU_BAR(menu_bar), file_item ); @@ -5855,7 +5855,7 @@ caldamente di dare un'occhiata ai loro rispettivi file header nella distribuzione di GTK. I nomi delle funzioni di GTK sono molto descrittivi. Non appena si capisce come funzionano le cose, non è difficile dedurre il modo d'uso di un widget semplicemente guardando la -dichiarazione di funzione ad esso associata. Aggiungendo a questo qualche +dichiarazione di funzione associata ad esso. Aggiungendo a questo qualche spunto tratto dal codice di altri non dovrebbero esserci problemi. Quando avrete raggiunto una comprensione globale di tutte le funzioni