[Previo por Fecha] [Siguiente por Fecha] [Previo por Hilo] [Siguiente por Hilo]
[Hilos de Discusión] [Fecha] [Tema] [Autor]Bueno con la ayuda de un amigo del irc tengo que decirles que ya me salio el grid :) ufff bueno esta interesante esto de libgnomedb :) Ahora una pregunta interesante ... Se podran colocar datos como imágenes o archivos a la salidas de las consultas ¿? Eso seria super genial Saludos PD: Aquí el código base gcc 017.c -o programa `pkg-config libgda libgnomedb --cflags --libs glib-2.0 gtk+-2.0` -- +----------+-------------------------------------------+ | .---. | www.unimauro.pe.kz || www.perupymes.net | | |º_º| | Carlos Mauro Cárdenas Fernández | | |:_/| |*irc.freenode.net #apesol | | // \\ |*irc.gimp.org #gnome-hispano | |(| |) | 051-001-4582877 || 051-001-97079624 | |/'\_ _/'\ | Jr.Las Cidras 664, Lima Peru | |\__) (__/ |*Lo hacemos por diversion."Linus T" | |__________|___________________________________________|
#include <stdio.h> #include <gtk/gtk.h> #include <libgda/libgda.h> #include <libgnomedb/gnome-db-grid.h> #include <libgnomedb/libgnomedb.h> int main (int argc, char **argv) { GdaClient *client; GdaConnection *connection; gchar *buffer; GList *r; GdaCommand *command; GdaDataModel *model; GList *list; gtk_init(&argc, &argv); gda_init("TestGrid", "0.1", argc, argv); client = gda_client_new(); connection = gda_client_open_connection (client, "Usuarios", "root", "", 0); buffer = "select * from foro;"; command = gda_command_new ( buffer, GDA_COMMAND_TYPE_SQL, GDA_COMMAND_OPTION_STOP_ON_ERRORS); model = gda_connection_execute_single_command (connection, command, NULL); // r = execute_sql_command(connection, "SELECT * FROM foro"); gda_command_free (command); char *label= "hola"; gnome_db_init("TestGDA", "0.1", argc, argv); GtkWidget *window; window= gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window),"Abrete Cesamo"); gtk_signal_connect(GTK_OBJECT(window),"delete_event",gtk_main_quit,NULL); GtkWidget *listmodel; listmodel = gnome_db_new_grid_widget ( model); gtk_container_add(GTK_CONTAINER(window),listmodel); gtk_widget_show_all(window); gtk_main(); gnome_db_main_quit (); }