GGtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)` failed




Hello everyone,

I am currently developing my first GTK+ GUI using glade to initiate bus master DMA.  The GUI is set to take 
DMA transfer specifics (payload, number of packets, etc).  Based on these inputs, I need to set a label or 
text box showing the total amount of bytes to be transferred from an add in card to the chipset.  

The GUI loads fine.  When the user changes payload, the handler is called and inside the handler is a call to 
change the bytes to be transfered label/text widget.  When this call is made, a failure is reported to the 
console saying it failed to set the text.  I have tried both a textview widget and also a label widget 
without success.  The main file is a C++ file that will call other C++ functions to run the DMA transfer.  I 
use extern "C" {} around each handler and function prototypes and I haven't seen an issue doing this yet.

Below is the code used:

// HANDLER:
   void on_wr_tlp_size_changed(GtkComboBox *wr_size, xbmd_app *app) {
      wr_tlp_size = gtk_combo_box_get_active_text(wr_size); 
      gtk_label_set_text(GTK_LABEL(app->write_bytes_to_transfer), "TEST");  //this is the line that is 
failing.  
   }

Below is more of the code:

// declaring the widget structure so each widget can be accessed within handlers
typedef struct
{
        GtkWidget               *write_bytes_to_transfer;
} xbmd_app;


int
main (int argc, char *argv[])
{
        xbmd_app      *app;

        /* allocate the memory needed by our TutorialTextEditor struct */
        app = g_slice_new (xbmd_app);

        /* initialize GTK+ libraries */
        gtk_init (&argc, &argv);

        if (init_app (app) == FALSE) return 1; /* error loading UI */

        /* show the window */   
        gtk_widget_show (app->window);

        /* enter GTK+ main loop */                   
        gtk_main ();

        /* free memory we allocated for TutorialTextEditor struct */
        g_slice_free (xbmd_app, app);
        
        return 0;
}

partial code:

gboolean 
init_app (xbmd_app *app)
{
        
       app->write_bytes_to_transfer = GTK_WIDGET (gtk_builder_get_object (builder, 
                                                             "wr_bytes_to_trans"));

Any assistance is appreciated.

Thanks,
Jake

_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_allup_howitworks_012009


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