4am, school tomorrow, and these 5 lines of code are killing me!
- From: Derek Simkowiak <dereks animal blarg net>
- To: gtk-list redhat com
- Subject: 4am, school tomorrow, and these 5 lines of code are killing me!
- Date: Tue, 7 Apr 1998 02:59:04 -0700 (PDT)
Help. I have a text widget, a label widget, and I want the label
to show the number of characters in my text widget. I can't find any
freakin' docs on the Gstring, or gchar, or g_char (or whatever the hell
I'm supposed to use) so here's my fxn:
void message_label_update(GtkWidget *text, GtkLabel *label)
{
guint message_length;
GString *the_label_text; /* what should this be?! */
message_length = GTK_TEXT(text)->text_end - GTK_TEXT(text)->gap_size;
if (message_length == 1)
{
gtk_label_set(GTK_LABEL(label), "1 character");
}
else
{
g_string_sprintf(the_label_text,"%d characters", message_length);
gtk_label_set(GTK_LABEL(label), &the_label_text);
}
}
This is the warning I get when I try to compile:
MessageGordon.c: In function `message_label_update':
MessageGordon.c:80: warning: passing arg 2 of `gtk_label_set' from
incompatible pointer type
Yes, I know I'm making a stupid mistake. I don't care. I've lost
all sense of decency...somebody....PLEASE tell me what I'm doing
wrong....blrchzz psfft.... ack
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]