Re: Problem with gtk_label_set_text



Hello....

Thanks I will surely remember this from next time :)

but I tried my program without updating the label its working absolutely
fine without any crashes, but with this code it does


bt_app_set_progress_value(bt_app_ui_state_t* this, bt_int32_t value)
{
gdouble fraction = 0;
gchar percentage[10];

if(value < 0 || value > 100)
 return FALSE;


if(value != 0)
 fraction = (gdouble)value / 100.0;

if (NULL != this->progress_bar)
{
 gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (this->progress_bar),
fraction);
 sprintf(percentage, "%d%%", value);

 gtk_label_set_text(GTK_LABEL(this->progress_counter), percentage);
 gtk_widget_show(this->progress_counter);
}

return TRUE;
}

commenting the gtk_label_text makes the code work absolutely fine.... but
with this line it gives me error saying about pango-layout.c


Regards

Divya
On 6/28/07, David Nečas (Yeti) <yeti physics muni cz> wrote:

On Thu, Jun 28, 2007 at 09:07:06AM +0530, Divya yadav wrote:
> I am using gtk_label_set_text in a dynamic gui and label keeps on
changing
> around 1-2 times every second.My program crashes because of this.

Why I can't see the backtrace in your post?
Not even any code?
You don't even say whether the program is single- or
multi-threaded.

Calling gtk_label_set_text() 1-2 times per second does not
crash programs.  That's a fact.

If you program crashes, it contains bugs.
Use valgrind and/or your preferred gdb frontend to debug it.
This is all one can say based on the detailed information
you provided.

Yeti

--
http://gwyddion.net/
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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