URGENT: Problem with GtkPaned



hello, i have a problem with GtkPaned.
The attached file is a source that reproduce the
problem (build with gtk+-2.2.3 under win32).
The problem is that when the user move the first paned
the widget in the second paned is
not redraw correctly. What can i do ? Is a bug or i am
wrong ? 
This is a small problem but the release of application
is near.
NB: In the real application the problem appear also
when i use gtk_paned_set_position(): the widget
in the paned is not visible, but if i move with the
mouse the paned the widget magically appears.



thanks, hammer.



______________________________________________________________________
Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il filtro Anti-spam
http://it.yahoo.com/mail_it/foot/?http://it.mail.yahoo.com/
#include <gtk/gtk.h>


GtkWidget * create_item(GtkWidget * container, const char * t)
{
	GtkWidget * box;
	GtkWidget * label;
	GtkWidget * evtbox;


	box = gtk_vbox_new(FALSE,FALSE);
	gtk_widget_show(box);
	gtk_container_add(GTK_CONTAINER(container),box);
	
	evtbox = gtk_event_box_new();
	gtk_widget_show(evtbox);
	gtk_container_add(GTK_CONTAINER(box),evtbox);

	label = gtk_label_new(t);
	gtk_widget_show(label);
	gtk_container_add(GTK_CONTAINER(evtbox),label);


	return box;
}


GtkWidget*
create_window1 (void)
{
  GtkWidget *window1;
  GtkWidget *hpaned1;
  GtkWidget *hpaned2;
  GtkWidget *scrolledwindow1;
  GtkWidget *viewport2;
  GtkWidget *viewport10;
  GtkWidget *viewport20;
  GtkWidget *frame50;
  GtkWidget *vpaned1;
  GtkWidget *scrolledwindow4;
  GtkWidget *viewport1;
  GtkWidget *frame3;
  GtkWidget *vpaned2;
  GtkWidget *scrolledwindow3;
  GtkWidget *frame4;
  GtkWidget *scrolledwindow2;
  GtkWidget *frame5;

  window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window1), "window1");

  hpaned1 = gtk_hpaned_new ();
  gtk_widget_show (hpaned1);
  gtk_container_add (GTK_CONTAINER (window1), hpaned1);
  gtk_paned_set_position (GTK_PANED (hpaned1), 0);

  hpaned2 = gtk_hpaned_new ();
  gtk_widget_show (hpaned2);
  gtk_paned_pack1 (GTK_PANED (hpaned1), hpaned2, FALSE, TRUE);
  gtk_paned_set_position (GTK_PANED (hpaned2), 0);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_paned_pack1 (GTK_PANED (hpaned2), scrolledwindow1, FALSE, TRUE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  viewport2 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (viewport2);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport2);

  frame50 = gtk_frame_new("Menu");
  gtk_widget_show(frame50);
  gtk_container_add (GTK_CONTAINER (viewport2), frame50);
  {
	  GtkWidget * box;
	box = gtk_vbox_new(FALSE,FALSE);
	gtk_widget_show(box);
	gtk_container_add(GTK_CONTAINER(frame50),box);
  }

  vpaned1 = gtk_vpaned_new ();
  gtk_widget_show (vpaned1);
  gtk_paned_pack2 (GTK_PANED (hpaned2), vpaned1, TRUE, TRUE);
  gtk_paned_set_position (GTK_PANED (vpaned1), 0);

  scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow4);
  gtk_paned_pack1 (GTK_PANED (vpaned1), scrolledwindow4, FALSE, TRUE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  viewport1 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (viewport1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow4), viewport1);

  frame3 = gtk_frame_new ("Prova");
  gtk_widget_show (frame3);
  gtk_container_add (GTK_CONTAINER (viewport1), frame3);
  create_item(frame3,"Paned1");

  vpaned2 = gtk_vpaned_new ();
  gtk_widget_show (vpaned2);
  gtk_paned_pack2 (GTK_PANED (vpaned1), vpaned2, TRUE, TRUE);
  gtk_paned_set_position (GTK_PANED (vpaned2), 100);

  scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow3);
  gtk_paned_pack1 (GTK_PANED (vpaned2), scrolledwindow3, FALSE, TRUE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  viewport10 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (viewport10);
  gtk_container_add (GTK_CONTAINER (scrolledwindow3), viewport10);

  frame4 = gtk_frame_new ("Prova");
  gtk_widget_show (frame4);
  gtk_container_add (GTK_CONTAINER (viewport10), frame4);
  create_item(frame4,"Paned2 ERROR");

  scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow2);
  gtk_paned_pack2 (GTK_PANED (vpaned2), scrolledwindow2, TRUE, TRUE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  viewport20 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (viewport20);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), viewport20);

  frame5 = gtk_frame_new ("Prova");
  gtk_widget_show (frame5);
  gtk_container_add (GTK_CONTAINER (viewport20), frame5);
  create_item(frame5,"Paned 3");


  gtk_widget_show(window1);
  return window1;
}



main()
{
	gtk_init(NULL,NULL);
	create_window1();
	gtk_main();
}


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