[Gtk-sharp-list] Accesing the Resize or Shrink property of a Paned Child

Daniel Kornhauser dkor@media.mit.edu
Wed, 8 Oct 2003 17:32:30 -0400 (EDT)


Hi, trying to port gtk-demo panes.c but I'm stuck.

I can't acces the Resize or Shrink properties of a paned Child.
Here is the c code I'm trying to port.

  resize = is_child1 ? paned->child1_resize : paned->child2_resize;
  shrink = is_child1 ? paned->child1_shrink : paned->child2_shrink;

Below is a simple example that doesn't compile if you uncomment the
two lines after //I CAN'T MAKE THIS LINES WORK.

Any suggestions ?

				Daniel.

//
// SimplePanes.cs
//
// Author: Daniel Kornhauser <dkor@alum.mit.edu>
//
// Copyright (C) 2002, Daniel Kornhauser, Ximian Inc.
//

using System;

using Gtk;
using GtkSharp;


public class SimplePanes
{
	static Window window;
	static void Main (string []args)
	{
		Application.Init ();

		window = new Window ("Panes");
		window.DeleteEvent += new DeleteEventHandler  (WindowDelete);
		window.BorderWidth = 0;

		VPaned vpaned = new VPaned ();
		window.Add (vpaned);

		Label label1 = new Label("pane1");
		vpaned.Add1(label1);
		Label label2 = new Label("pane2");
		vpaned.Add2(label2);

		// I CAN'T MAKE THIS LINE WORK
		// Console.WriteLine("Child 1 Resize Property pane  {0}:",vpaned.Child1.Resize);
		// Console.WriteLine("Child 1 Shrink Property pane  {0}:",vpaned.Child1.Shrink);

		window.ShowAll ();
		Application.Run ();

	}

	static void WindowDelete (object o, DeleteEventArgs args)
	{
		Application.Quit ();
	}
}