[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Label string affecting statusbar?
From:       "Brent M. Hendricks" <brentmh () rice ! edu>
Date:       1999-02-25 8:01:20
[Download RAW message or body]

Greetings,

I have a really bizzare problem invilving labels and a statusbar.  Here's
the deal.  In one part of my program, I initialize some labels:

.
.
.
playArea->tallys[0] = gtk_label_new("                   ");
playArea->tallys[1] = gtk_label_new("                   ");
playArea->tallys[2] = gtk_label_new("                   ");
playArea->tallys[3] = gtk_label_new("                   ");
.
.
.

I intialize them to be long strings of spaces so that when later in my
program I have things to put there, the labels will not force the window to
resize.

Then, in another part of my program I have a status bar that I write to like
this:

.
.
.
va_start( ap, format);
message = g_strdup_vprintf(format, ap);
va_end(ap);

gtk_statusbar_push( GTK_STATUSBAR(statusBar), id, message );

g_free( message );
.
.
.

These two code sections shouldn't have anything to do with each other. When
I run the program, at certain times, the status bar will unexpectedly go
blank instead of displaying the specified text.  If I change the label
initializations to just "", I get the correct behavior.

I am thoroughly confused, and don't see how the two are connected. If you
would like to look the at complete code, it's available at

http://www.ece.rice.edu/~brentmh/NetSpades-4.1.2pre1.tar.gz  

The label init gets done in CreatePlayArea() in gtk_play.c and the statusbar
stuff gets done in DisplayStatusLine() in gtk_io.c

Thanks for any help you can offer.
--Brent

-------------------------------------------------------------------------

"The programmer, like the poet, works only slightly removed from pure
 thought-stuff.  He builds his castles in the air, from air, creating
 by exertion of the imagination.  Few media of creation are so
 flexible, so easy to polish and rework, so readily capable of
 realizing grand conceptual structures."
                        -- Frederick Brooks, Jr., The Mythical Man Month


-- 
         To unsubscribe: mail gtk-app-devel-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

	Mailing list concerns should be mailed to <listmaster@redhat.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic