Ejemplo n.º 1
0
/**************************************************************************
...
**************************************************************************/
static void name_new_city_callback(Widget w, XtPointer client_data, 
				   XtPointer call_data)
{
  size_t unit_id=(size_t)client_data;
  
  if (unit_id) {
    dsend_packet_unit_build_city(&client.conn, unit_id,
				 input_dialog_get_input(w));
  }
    
  input_dialog_destroy(w);
}
Ejemplo n.º 2
0
/****************************************************************
...
*****************************************************************/
void rename_city_callback(Widget w, XtPointer client_data, 
			  XtPointer call_data)
{
  struct city_dialog *pdialog;
  struct packet_city_request packet;

  if((pdialog=(struct city_dialog *)client_data)) {
    packet.city_id=pdialog->pcity->id;
    strncpy(packet.name, input_dialog_get_input(w), MAX_LENGTH_NAME);
    packet.name[MAX_LENGTH_NAME-1]='\0';
    send_packet_city_request(&aconnection, &packet, PACKET_CITY_RENAME);
  }
  input_dialog_destroy(w);
}