rem: GtkRequisition *taille_entree; gint x, y;
add: GtkRequisition *taille_popup; gint x_cal, y_cal;
context: gboolean clique_champ_formulaire_echeancier ( GtkWidget *entree,					      GdkEventButton *ev,					      gint *no_origine ){  /* on rend sensitif tout ce qui ne l'tait pas sur le formulaire */  degrise_formulaire_echeancier ();  /* si l'entre de la date et grise, on met la date courante */  if ( gtk_widget_get_style ( widget_formulaire_echeancier[0] ) == style_entree_formulaire[1] )    {      entree_prend_focus ( widget_formulaire_echeancier[0] );      gtk_entry_set_text ( GTK_ENTRY ( widget_formulaire_echeancier[0] ),			   date_jour() );      /* si le click est sur l'entre de la date, on la slectionne et elle prend le focus */      if ( !no_origine )	{	  if ( ev )	    gtk_signal_emit_stop_by_name ( GTK_OBJECT ( entree ),					   "button-press-event");	  gtk_entry_select_region ( GTK_ENTRY ( entree ),				    0,				    -1);	  gtk_widget_grab_focus ( GTK_WIDGET ( entree ));	}    }  /*   si ev est null ( cad que a ne vient pas d'un click mais appel par ex  la fin */  /* de fin_edition ), on se barre */  if ( !ev )    return TRUE;  /* numration suivant l'entre o on clique */  switch ( GPOINTER_TO_INT ( no_origine ))    {    case 0:    case 16:      /* click sur l'entre de la date ou date limite */      /* si double click, on popup le calendrier */      if ( ev->type == GDK_2BUTTON_PRESS )	{	  GtkWidget *popup;	  GtkWidget *popup_boxv;	  GtkRequisition *taille_entree;	  gint x, y;	  GtkWidget *calendrier;	  int cal_jour, cal_mois, cal_annee;	  GtkWidget *bouton;	  GtkWidget *frame;	  /* cherche la position o l'on va mettre la popup */	  taille_entree = malloc ( sizeof ( GtkRequisition ));	  gdk_window_get_origin ( GTK_WIDGET ( entree ) -> window,				  &x,				  &y );	  gtk_widget_size_request ( GTK_WIDGET ( entree ),				    taille_entree );  	  y = y + taille_entree->height;	  /* cration de la popup */	  popup = gtk_window_new ( GTK_WINDOW_POPUP );	  gtk_window_set_modal ( GTK_WINDOW (popup),				 TRUE);	  gtk_widget_set_uposition ( GTK_WIDGET ( popup ),				     x,				     y );	  /* cration de l'intrieur de la popup */	  frame = gtk_frame_new ( NULL );	  gtk_container_add ( GTK_CONTAINER (popup),			      frame);	  gtk_widget_show ( frame );	  popup_boxv = gtk_vbox_new ( FALSE,				      5 );	  gtk_container_set_border_width ( GTK_CONTAINER ( popup_boxv ),					   5 );	  gtk_container_add ( GTK_CONTAINER ( frame ),			      popup_boxv);	  gtk_widget_show ( popup_boxv );	  if ( strlen ( g_strstrip ( (gchar *) gtk_entry_get_text ( GTK_ENTRY ( entree )))))	    {	      if ( modifie_date ( entree ))		sscanf ( (gchar *) gtk_entry_get_text ( GTK_ENTRY ( entree )),			 "%d/%d/%d",			 &cal_jour,			 &cal_mois,			 &cal_annee );	      else		sscanf ( date_jour(),			 "%d/%d/%d",			 &cal_jour,			 &cal_mois,			 &cal_annee);	    }	  else	    sscanf ( date_jour(),		     "%d/%d/%d",		     &cal_jour,		     &cal_mois,		     &cal_annee);	  calendrier = gtk_calendar_new();	  gtk_calendar_select_month ( GTK_CALENDAR ( calendrier ),				      cal_mois-1,				      cal_annee);	  gtk_calendar_select_day  ( GTK_CALENDAR ( calendrier ),				     cal_jour);	  gtk_calendar_display_options ( GTK_CALENDAR ( calendrier ),					 GTK_CALENDAR_SHOW_HEADING |					 GTK_CALENDAR_SHOW_DAY_NAMES |					 GTK_CALENDAR_WEEK_START_MONDAY );	  if ( no_origine )	    gtk_signal_connect ( GTK_OBJECT ( calendrier),				 "day_selected_double_click",				 GTK_SIGNAL_FUNC ( date_limite_selectionnee_echeancier ),				 popup );	  else	    gtk_signal_connect ( GTK_OBJECT ( calendrier),				 "day_selected_double_click",				 GTK_SIGNAL_FUNC ( date_selectionnee_echeancier ),				 popup );	  gtk_signal_connect ( GTK_OBJECT ( popup ),			       "key-press-event",			       GTK_SIGNAL_FUNC ( touche_calendrier ),			       NULL );	  gtk_signal_connect_object ( GTK_OBJECT ( popup ),				      "destroy",				      GTK_SIGNAL_FUNC ( gdk_pointer_ungrab ),				      GDK_CURRENT_TIME );	  gtk_box_pack_start ( GTK_BOX ( popup_boxv ),			       calendrier,			       TRUE,			       TRUE,			       0 );	  gtk_widget_show ( calendrier );	  /* ajoute le bouton annuler */	  bouton = gtk_button_new_with_label ( _("Cancel") );	  gtk_signal_connect_object ( GTK_OBJECT ( bouton ),				      "clicked",				      GTK_SIGNAL_FUNC ( gtk_widget_destroy ),				      GTK_OBJECT ( popup ));	  gtk_box_pack_start ( GTK_BOX ( popup_boxv ),			       bouton,			       TRUE,			       TRUE,			       0 );	  gtk_widget_show ( bouton );	  gtk_widget_show (popup);      	  gdk_pointer_grab ( popup -> window, 			     TRUE,			     GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |			     GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |			     GDK_POINTER_MOTION_MASK,			     NULL, 			     NULL, 			     GDK_CURRENT_TIME );	  gtk_widget_grab_focus ( GTK_WIDGET ( popup ));	}      break;    }  return FALSE;}