X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/cd54ffa8f72331531d2fb4624c1259bbb023ce38..44e29ffea53b9da70e6b5e16f96aa0231540dd87:/gui/gui.c diff --git a/gui/gui.c b/gui/gui.c index 06aee1c..7a15fcd 100644 --- a/gui/gui.c +++ b/gui/gui.c @@ -6,6 +6,7 @@ #include #include "form.h" +#include "articulos.h" static void finish(int sig); @@ -14,6 +15,10 @@ int main(int argc, char *argv[]) /* initialize your non-curses data structures here */ WINDOW *mainwin; t_Form *form; + t_LstArticulos *articulos; + t_Articulo *art; + + articulos = art_cargar(argv[1]); /* Inicio Curses */ signal(SIGINT, finish); /* arrange interrupts to terminate */ @@ -53,23 +58,27 @@ 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); MD_Listar(); return 0;