Bug in Adjustment?
- From: Linus Gasser <urba2544 urbanet ch>
- To: gtk-list redhat com
- Subject: Bug in Adjustment?
- Date: Mon, 22 Jun 48409 18:13:49 +0200
Hello,
I just saw a bizarre thing in gtk 1.1.1. It's when I try to redraw a
range-widget. It changes the value on the top of the range-widget, but the
'button' itself doesn't move a single whee-bit. I just added a
little code to demonstrate this. Take care, I'm a newbi, and don't look at the
ugliness of the code ;-)
--------------------------- bug.c ----------------------------
#include <gtk/gtk.h>
GtkWidget *window;
GtkObject *adjustment;
void IncAdjust()
{
GtkAdjustment *Adj;
Adj = GTK_ADJUSTMENT(adjustment);
Adj->value++;
gtk_widget_draw_children(window);
}
main(int argc, char *argv[])
{
GtkWidget *box1, *box2;
GtkWidget *scale, *button;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
gtk_widget_show (box1);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0);
gtk_widget_show (box2);
adjustment = gtk_adjustment_new (0, 0, 128, 1, 1, 1);
scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
gtk_range_set_update_policy (GTK_RANGE (scale),
GTK_UPDATE_CONTINUOUS);
gtk_widget_set_usize (GTK_WIDGET (scale), 150, 30);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0);
gtk_widget_show (scale);
button = gtk_button_new_with_label ("Inc");
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (IncAdjust),
GTK_OBJECT (window));
gtk_widget_show(window);
gtk_main ();
}
------------------------------------ end ---------------------------
Any ideas/suggestions???
Greets
Ineiti
--
+------------------+-------------------+
I L.Gasser I MALKUTH I
I Marterey 23 I Simplon 12 I
I 1005 Lausanne I 1006 Lausanne I
I 021/320 02 94 I 021/617 84 55 I
+------------------+-------------------+
I http://194.38.81.99 I
+--------------------------------------+
Hass erregt Hader; aber die Liebe deckt alle Uebertretungen zu.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]