A struct crazy



Hi.

I writing a interface in GTK for a database postgresql. In running you
show me this:

Gtk-WARNING **: invalid cast from `GtkHSeparator' to `GtkEditable'

Gtk-CRITICAL **: file gtkeditable.c: line 489
(gtk_editable_get_chars): assertion `GTK_IS_EDITABLE (editable)'
failed.

This is the code critical:

/* ---------------------------------------- */

typedef struct{

  GtkWidget *item_code;
  gchar *query; 

} data_gtk;

gint
intro_data_1(GtkWidget *box, gchar *query , gchar *item){

  GtkWidget *botton;
  GtkTooltips *label;

  data_gtk_1 enters;

  enters.item_code = gtk_entry_new_with_max_length(10);
  gtk_box_pack_start(GTK_BOX(box), enters.item_code, FALSE, FALSE, 0);

  ..........

  botton = gtk_button_new_with_label("Enter Data");
  gtk_box_pack_start(GTK_BOX(box), botton, TRUE, TRUE, 0);
  GTK_WIDGET_SET_FLAGS(botton, GTK_CAN_DEFAULT);
  gtk_widget_grab_default(botton);
  gtk_widget_show(botton);

  gtk_signal_connect(GTK_OBJECT(botton), "clicked", GTK_SIGNAL_FUNC(request_DB), &enters);

  gtk_widget_show(enters.item_code);

  label = gtk_tooltips_new();
  gtk_tooltips_set_tip(label, enters.item_code, item, NULL);

  return 0;
}

void
request_DB(GtkWidget *widget, data_gtk *query_gtk){

  gchar *request;
  
  request = gtk_editable_get_chars(GTK_EDITABLE(query_gtk->item_code), 0, -1);
  
  exe_query_2(request, query_gtk->query, INT_GTK); /* This is other question */

}

/* --------------------------------- */

Thanks in advance.

-- 
Miguel Ángel Rodríguez                   | "Hay quien arroja un vidrio roto  
mailto:nahuana chilesat net              | sobre la playa, pero hay quien  
mailto:miguel_r entelchile net           | se agacha a recogerlo."
mailto:hermes-proyect technologist com   |
ICQ:91952832                             |                       J. Narosky  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%













[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]