RE: GGtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)` failed
- From: Jacob Wiltgen <jacobwiltgen hotmail com>
- To: <gtk-app-devel-list gnome org>
- Subject: RE: GGtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)` failed
- Date: Wed, 28 Jan 2009 20:28:51 -0700
Hi Everyone,
I apologize for the email. I figured it out so please disregard this last email.
Thanks,
Jake
From: jacobwiltgen hotmail com
To: gtk-app-devel-list gnome org
Subject: GGtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)` failed
Date: Wed, 28 Jan 2009 20:16:47 -0700
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. See how it works.
_________________________________________________________________
Hotmail® goes where you go. On a PC, on the Web, on your phone.
http://www.windowslive-hotmail.com/learnmore/versatility.aspx#mobile?ocid=TXT_TAGHM_WL_HM_versatility_121208
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]