[Gtk-sharp-list] Gnome.app issue

Scott Ellington scottellington@comcast.net
Sun, 09 Jan 2005 16:23:36 -0500


Hello everyone,

I am having problems creating a simple gnome application using
gnome-sharp.  The window appears correctly, as does the status bar, but
I cannot get the menubar or the toolbar to appear correctly. 

Below is some sample code illustrating the problem.  At first I thought
the toolbar was not visible, but it is actually just very small (about a
pixel in height).  I was able to corroborate this output with some
people in #monodevelop.  

I am running dev-dotnet/gtk-sharp-1.0.4-r1, and
dev-dotnet/mono-1.0.5-r3 on Gentoo.  Any assistance would be
appreciated.

----------------------------

using System;
using Gtk;
using Gnome;

public class MyProgram
{
	public static void Main(string [] args)
	{
		Program program = new Program ("MyProgram", "0.0", Modules.UI, args);
		App app = new App ("MyProgram", "MyWindow");
		Button button = new Button(Gtk.Stock.Open);

		app.Statusbar = new AppBar (true, true, PreferencesType.Never);

		Toolbar t = new Toolbar();
		t.AppendWidget(button,"Open","Open");
		app.Toolbar = t;

		MenuBar mb = new MenuBar();
		Menu file_menu = new Menu ();
		MenuItem exit_item = new MenuItem("Exit");
		file_menu.Append (exit_item);
		MenuItem file_item = new MenuItem("File");
		file_item.Submenu = file_menu;
		mb.Append (file_item);          
		app.Menus = mb;

		app.SetDefaultSize (700, 700);
		app.DeleteEvent += new DeleteEventHandler (OnAppDelete);

		app.ShowAll ();
		program.Run ();
	}

	private static void OnAppDelete (object o, DeleteEventArgs args)
	{
		Application.Quit ();
	}
}
-- 
Scott Ellington <scottellington@comcast.net>