X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/02e27a9ec780fe569744b52463eabdd83c8cf68f..44e29ffea53b9da70e6b5e16f96aa0231540dd87:/gui/gui.c diff --git a/gui/gui.c b/gui/gui.c index fec8758..7a15fcd 100644 --- a/gui/gui.c +++ b/gui/gui.c @@ -16,6 +16,7 @@ int main(int argc, char *argv[]) WINDOW *mainwin; t_Form *form; t_LstArticulos *articulos; + t_Articulo *art; articulos = art_cargar(argv[1]); @@ -57,21 +58,24 @@ int main(int argc, char *argv[]) /* Creo el formulario */ form = form_crear(mainwin); - form_agregar_widget(form, INPUT, "Nombre", 15, ""); - form_agregar_widget(form, RADIO, "Voto", 3, "Si,No,No Corresponde"); - form_agregar_widget(form, INPUT, "Datos", 30, ""); + form_agregar_widget(form, INPUT, "Numero de Articulo", 8, ""); form_ejecutar(form, 10, 10); delwin(mainwin); endwin(); + art = art_obtener(articulos, form_obtener_valor(form, "Numero de Articulo")); + /* Imprimo los datos! */ - printf("Datos Ingresados : \n"); - printf("\tNombre : %s\n", form_obtener_valor(form, "Nombre")); - printf("\tVoto : %s\n", form_obtener_valor(form, "Voto")); - printf("\tDatos : %s\n", form_obtener_valor(form, "Datos")); - + printf("Datos : \n"); + if (art != NULL) { + printf("\tDescripcion : %s\n", art->desc); + printf("\tPresentacion : %s\n", art->presentacion); + printf("\tExistencia : %s\n", art->existencia); + } else { + printf("NO EXISTE!\n"); + } /* Libero el formulario */ form_destruir(form); art_liberar(articulos);