bug?



Hi people,

I have a window of two buttons and one label in a hbox.
If I change the text in the label, as a reaction on a signal, the hbox
will suddenly enlarge and be much larger than it should be...


Code of the window:

	hbox2 = gtk_hbox_new(FALSE, 10);

	button = gtk_button_new(); //_with_label("Stop []"); /* kill */
	pixmap_widget = gtk_widget_from_xpm_data(editor_stop_xpm);
	gtk_container_add(GTK_CONTAINER(button), pixmap_widget);
	gtk_widget_show (pixmap_widget);
	gtk_tooltips_set_tip(tooltip, button, "Stop Preview Video Stream",
NULL);
	gtk_widget_set_usize(button, 32, 32);
	gtk_signal_connect(GTK_OBJECT(button), "clicked",
		GTK_SIGNAL_FUNC(stop_scene_transition), NULL);
	gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE,FALSE, 0);
	gtk_widget_show (button);

	button = gtk_button_new(); //_with_label("Play |>"); /* lavpipe |
yuvplay */
	pixmap_widget = gtk_widget_from_xpm_data(editor_play_xpm);
	gtk_container_add(GTK_CONTAINER(button), pixmap_widget);
	gtk_widget_show (pixmap_widget);
	gtk_tooltips_set_tip(tooltip, button, "Preview the Scene Transition",
NULL);
	gtk_widget_set_usize(button, 32, 32);
	gtk_signal_connect(GTK_OBJECT(button), "clicked",
		GTK_SIGNAL_FUNC(play_scene_transition), (gpointer)options);
	gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE,FALSE, 0);
	gtk_widget_show (button);

	sprintf(temp, "0 / %d - 0:00:00.00",
GTK_IMAGEPLUG(image[current_image])->stopscene - 
		GTK_IMAGEPLUG(image[current_image])->startscene + 1);
	preview_frame_count_label = gtk_label_new(temp);
	gtk_box_pack_start (GTK_BOX (hbox2), preview_frame_count_label,
TRUE,FALSE, 0);
	gtk_widget_show (preview_frame_count_label);

	gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, FALSE, 0);
	gtk_widget_show(hbox2); 

The signal does the following:

			char temp[64];
			int d,h,m,s,f;
			sscanf(msg, "Playing frame %d - %d:%d:%d.%d", &d, &h, &m, &s, &f);
			sprintf(temp, "%d / %d - %d:%2.2d:%2.2d.%2.2d", d,
				GTK_IMAGEPLUG(image[current_image])->stopscene - 
				GTK_IMAGEPLUG(image[current_image])->startscene + 1,
				h,m,s,f);
			gtk_label_set_text(GTK_LABEL(preview_frame_count_label), temp);

And the first time this signal is called, the hbox enlarges. After that,
I can resize the window and it will stay small until I get back to
another callback which sets it back to the original state:

		char temp[64];
		sprintf(temp, "0 / %d - 0:00:00.00" ,
GTK_IMAGEPLUG(image[current_image])->stopscene - 
			GTK_IMAGEPLUG(image[current_image])->startscene + 1);
		gtk_label_set_text(GTK_LABEL(preview_frame_count_label), temp);

Then, it gets big again.

Is this a (known) bug? And is there a way to solve this?

Regards,

Ronald

-- 
-   .-.
-   /V\   | Ronald Bultje <rbultje ronald bitfreak net>
-  // \\  | Running: Linux 2.4.4 and OpenBSD 2.8
- /(   )\ | http://ronald.bitfreak.net/
-  ^^-^^





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