[gtk+osx] So any one got a debug build of GTK for X11 ??
Status: Beta
Brought to you by:
jralls
From: David B. <va...@nt...> - 2004-06-12 23:41:53
|
I've been trying to figure out why labels on gtk status bars do not draw if you change the text. Its one of the three* really obvious problems with GTK-OSX (obvious at least if you use gimp 1.2.5 as your test bed...). As far as I can see the reason it does not draw is due to the fact that it should not draw. gtk_labels only draw in response to a gtk_expose event, not as a direct to the text changing. The trouble is I have no idea what sets of that expose event when the change of the label does not lead to a resize of the status bar. I was hoping that some one would be in position to trace this through on X11 on some platform. I've pasted the source to my test program below *There other two are range control with labels do not track the cursor properly and the empty part of lists do not clear properly. /* example code */ #include <gtk/gtk.h> int counter; gint delete( GtkWidget *widget, GtkWidget *event, gpointer data ) { gtk_main_quit(); return(FALSE); } void hello (GtkWidget *button, GtkWidget *widget) { gchar text[1024]; sprintf (text, "%ld Hello", counter++); //gtk_label_set_text(widget, text); gtk_statusbar_push (widget, 1, text); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *status; GtkWidget *button; GtkWidget *main_vbox; gtk_init (&argc, &argv); counter = 0; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); main_vbox = gtk_vbox_new (FALSE, 2); status = gtk_statusbar_new (); //status = gtk_label_new("Test String"); /* This packs the button into the window (a gtk container). */ gtk_widget_show (status); button = gtk_button_new_with_label ("Big name to avoid Resize"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (hello), GTK_OBJECT (status)); gtk_container_add (GTK_CONTAINER (main_vbox), status); gtk_container_add (GTK_CONTAINER (main_vbox), button); gtk_container_add (GTK_CONTAINER (window), main_vbox); gtk_widget_show (button); gtk_widget_show (main_vbox); gtk_widget_show(window); gtk_main (); return(0); } /* example-end */ |