rem: bouton = gtk_button_new_from_stock (GTK_STOCK_OK); gtk_button_set_relief ( GTK_BUTTON ( bouton ), GTK_RELIEF_NONE ); gtk_signal_connect ( GTK_OBJECT ( bouton ), "clicked", GTK_SIGNAL_FUNC ( fin_edition_ventilation ), NULL ); gtk_box_pack_end ( GTK_BOX ( hbox_valider_annuler_ventil ), bouton, FALSE, FALSE, 0 ); gtk_widget_show ( bouton );
context: GtkWidget *creation_formulaire_ventilation ( void ){    GtkWidget *onglet;    GtkTooltips *tips;    GtkWidget *table;    GtkWidget *bouton;    GtkWidget *menu;    /* on crée le tooltips */    tips = gtk_tooltips_new ();    /* création du formulaire */    onglet = gtk_vbox_new ( FALSE,			    5 );    gtk_container_set_border_width ( GTK_CONTAINER ( onglet ),				     10);    gtk_widget_show ( onglet );    /* mise en place de la table */    table = gtk_table_new ( 2,			    5,			    FALSE);    gtk_table_set_col_spacings ( GTK_TABLE ( table ),				 10 );    gtk_box_pack_start ( GTK_BOX ( onglet ),			 table,			 FALSE,			 FALSE,			 0 );    gtk_widget_show ( table );    /* mise en place des catégories */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY] = gtk_combofix_new_complex ( liste_categories_ventilation_combofix,								  FALSE,								  TRUE,								  TRUE,								  0 );    gtk_signal_connect ( GTK_OBJECT ( GTK_COMBOFIX ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY] ) -> entry ),			 "key_press_event",			 GTK_SIGNAL_FUNC ( appui_touche_ventilation ),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_CATEGORY ) );    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY]) -> entry),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation),			 NULL );    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY]) -> arrow),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation),			 NULL );    gtk_signal_connect_object ( GTK_OBJECT ( GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY]) -> entry ),				"focus_in_event",				GTK_SIGNAL_FUNC (entree_prend_focus),				GTK_OBJECT ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY] ) );    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY]) -> entry),			 "focus_out_event",			 GTK_SIGNAL_FUNC (entree_ventilation_perd_focus),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_CATEGORY ) );    gtk_table_attach ( GTK_TABLE (table),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY],		       0, 1, 0,1,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_widget_show ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY] );    /* mise en place des notes */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES] = gtk_entry_new ();    gtk_signal_connect ( GTK_OBJECT ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES] ),			 "key_press_event",			 GTK_SIGNAL_FUNC ( appui_touche_ventilation ),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_NOTES ) );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES]),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation ),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES]),			 "focus_in_event",			 GTK_SIGNAL_FUNC (entree_prend_focus),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES]),			 "focus_out_event",			 GTK_SIGNAL_FUNC (entree_ventilation_perd_focus),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_NOTES ) );    gtk_table_attach ( GTK_TABLE (table),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES],		       1, 3, 0,1,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_widget_show ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_NOTES] );    /* mise en place du débit */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT] = gtk_entry_new ();    gtk_signal_connect ( GTK_OBJECT ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT] ),			 "key_press_event",			 GTK_SIGNAL_FUNC ( appui_touche_ventilation ),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_DEBIT ) );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT]),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation ),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT]),			 "focus_in_event",			 GTK_SIGNAL_FUNC (entree_prend_focus),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT]),			 "focus_out_event",			 GTK_SIGNAL_FUNC (entree_ventilation_perd_focus),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_DEBIT ) );    gtk_table_attach ( GTK_TABLE (table),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT],		       3, 4, 0,1,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_widget_show ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_DEBIT] );    /* mise en place du crédit */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT] = gtk_entry_new ();    gtk_signal_connect ( GTK_OBJECT ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT] ),			 "key_press_event",			 GTK_SIGNAL_FUNC ( appui_touche_ventilation ),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_CREDIT ) );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT]),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation ),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT]),			 "focus_in_event",			 GTK_SIGNAL_FUNC (entree_prend_focus),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT]),			 "focus_out_event",			 GTK_SIGNAL_FUNC (entree_ventilation_perd_focus),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_CREDIT ) );    gtk_table_attach ( GTK_TABLE (table),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT],		       4, 5, 0,1,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_widget_show ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CREDIT] );    /*  Affiche l'imputation budgétaire */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY] = gtk_combofix_new_complex ( liste_imputations_combofix,								  FALSE,								  TRUE,								  TRUE,								  0 );    gtk_table_attach ( GTK_TABLE (table),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY],		       0, 1, 1, 2,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY]) -> entry),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation),			 NULL );    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY]) -> arrow),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation),			 NULL );    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY]) -> entry),			 "key_press_event",			 GTK_SIGNAL_FUNC (appui_touche_ventilation),			 GINT_TO_POINTER( TRANSACTION_BREAKDOWN_FORM_BUDGETARY ) );    gtk_signal_connect_object ( GTK_OBJECT ( GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY]) -> entry ),				"focus_in_event",				GTK_SIGNAL_FUNC (entree_prend_focus),				GTK_OBJECT ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY] ) );    gtk_signal_connect ( GTK_OBJECT (GTK_COMBOFIX (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY]) -> entry),			 "focus_out_event",			 GTK_SIGNAL_FUNC (entree_ventilation_perd_focus),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_BUDGETARY ) );    gtk_widget_show (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_BUDGETARY]);    /* mise en place du type de l'opé associée en cas de virement */    /* non affiché au départ */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CONTRA] = gtk_option_menu_new ();    gtk_tooltips_set_tip ( GTK_TOOLTIPS ( tips ),			   widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CONTRA],			   _("Associated method of payment"),			   _("Associated method of payment") );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CONTRA]),			 "key_press_event",			 GTK_SIGNAL_FUNC ( appui_touche_ventilation ),			 GINT_TO_POINTER( TRANSACTION_BREAKDOWN_FORM_CONTRA ) );    gtk_table_attach ( GTK_TABLE ( table ),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CONTRA],		       1, 2, 1, 2,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    /* création du bouton de l'exo */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_EXERCICE] = gtk_option_menu_new ();    gtk_tooltips_set_tip ( GTK_TOOLTIPS ( tips ),			   widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_EXERCICE],			   _("Choose the financial year"),			   _("Choose the financial year") );    menu = gtk_menu_new ();    gtk_option_menu_set_menu ( GTK_OPTION_MENU ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_EXERCICE] ),			       creation_menu_exercices (0) );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_EXERCICE]),			 "key_press_event",			 GTK_SIGNAL_FUNC (appui_touche_ventilation),			 GINT_TO_POINTER( TRANSACTION_BREAKDOWN_FORM_EXERCICE ) );    gtk_table_attach ( GTK_TABLE ( table ),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_EXERCICE],		       2, 3, 1, 2,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_widget_show ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_EXERCICE] );    /*   création de l'entrée du no de pièce comptable */    widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER] = gtk_entry_new();    gtk_table_attach ( GTK_TABLE (table),		       widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER],		       3, 5, 1, 2,		       GTK_SHRINK | GTK_FILL,		       GTK_SHRINK | GTK_FILL,		       0,0);    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER]),			 "button_press_event",			 GTK_SIGNAL_FUNC (clique_champ_formulaire_ventilation ),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER]),			 "key_press_event",			 GTK_SIGNAL_FUNC (appui_touche_ventilation),			 GINT_TO_POINTER( TRANSACTION_BREAKDOWN_FORM_VOUCHER ) );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER]),			 "focus_in_event",			 GTK_SIGNAL_FUNC (entree_prend_focus),			 NULL );    gtk_signal_connect ( GTK_OBJECT (widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER]),			 "focus_out_event",			 GTK_SIGNAL_FUNC (entree_ventilation_perd_focus),			 GINT_TO_POINTER ( TRANSACTION_BREAKDOWN_FORM_VOUCHER ) );    gtk_widget_show ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_VOUCHER] );    /* séparation d'avec les boutons */    separateur_formulaire_ventilations = gtk_hseparator_new ();    gtk_box_pack_start ( GTK_BOX ( onglet ),			 separateur_formulaire_ventilations,			 FALSE,			 FALSE,			 0 );    if ( etat.affiche_boutons_valider_annuler )	gtk_widget_show ( separateur_formulaire_ventilations );    /* mise en place des boutons */    hbox_valider_annuler_ventil = gtk_hbox_new ( FALSE,						 5 );    gtk_box_pack_start ( GTK_BOX ( onglet ),			 hbox_valider_annuler_ventil,			 FALSE,			 FALSE,			 0 );    if ( etat.affiche_boutons_valider_annuler )	gtk_widget_show ( hbox_valider_annuler_ventil );    bouton = gtk_button_new_from_stock (GTK_STOCK_CANCEL);    gtk_button_set_relief ( GTK_BUTTON ( bouton ),			    GTK_RELIEF_NONE );    gtk_signal_connect ( GTK_OBJECT ( bouton ),			 "clicked",			 GTK_SIGNAL_FUNC ( echap_formulaire_ventilation ),			 NULL );    gtk_box_pack_end ( GTK_BOX ( hbox_valider_annuler_ventil ),		       bouton,		       FALSE,		       FALSE,		       0 );    gtk_widget_show ( bouton );    bouton = gtk_button_new_from_stock (GTK_STOCK_OK);    gtk_button_set_relief ( GTK_BUTTON ( bouton ),			    GTK_RELIEF_NONE );    gtk_signal_connect ( GTK_OBJECT ( bouton ),			 "clicked",			 GTK_SIGNAL_FUNC ( fin_edition_ventilation ),			 NULL );    gtk_box_pack_end ( GTK_BOX ( hbox_valider_annuler_ventil ),		       bouton,		       FALSE,		       FALSE,		       0 );    gtk_widget_show ( bouton );    /*   met l'adr de l'opé dans le formulaire à -1 */    gtk_object_set_data ( GTK_OBJECT ( widget_formulaire_ventilation[TRANSACTION_BREAKDOWN_FORM_CATEGORY] ),			  "adr_struct_ope",			  GINT_TO_POINTER ( -1 ) );    return ( onglet );}