[Gtk-sharp-list] Info dialog

Parrish M Myers parrishmyers@yahoo.com
Wed, 31 Dec 2003 11:31:10 -0800 (PST)


Hello,

I was wondering if I could get some advice...  I have been looking at
many examples of how to open a dialog window by looking at
"MonoTagEditor", "monodebugger", "f-spot", etc... and I think I came up
with some code to do one... But, it seems that every other time I try
to use the code below I get the message:

(SwTimer:11830): Gdk-CRITICAL **: file gdkwindow-x11.c: line 1993
(gdk_window_set_geometry_hints): assertion `window != NULL' failed
 
(SwTimer:11830): Gdk-CRITICAL **: file gdkwindow-x11.c: line 1370
(gdk_window_resize): assertion `window != NULL' failed

or the window opens with the wrong size... Can someone help?

--- code ---

namespace SwTimer {
	using Glade;
	using Gnome;
	using Gtk;
	using Gdk;
	using GtkSharp;
	using System;
	using System.Text;

	public class AlarmDialog
	{
		[Glade.Widget]
		Gtk.Dialog alarm_dialog;
		
		[Glade.Widget]
		Gtk.Label alarm_label;
		
		static AlarmDialog AlarmBox;
		
		private AlarmDialog()
		{
			Glade.XML gxml = new Glade.XML (null, "sw-timer.glade",
"alarm_dialog", null);
			gxml.Autoconnect (this);
		}
		
		private void OnOkClicked (object o, EventArgs e)
		{
			alarm_dialog.Hide();
		}
		
		static public void Show(string message)
		{
			if (AlarmBox == null) {
				AlarmBox = new AlarmDialog();
			}
			// set the message in the dialog
			string tmp1 = "<span weight=\"bold\" size=\"larger\">Alarm: ";
			string tmp2 = "</span>";
			AlarmBox.alarm_label.Markup = tmp1 + message + tmp2;
			AlarmBox.alarm_dialog.Show();
		}
	}
}

Thanks,
Parrish

=====
-----------------------------------------------------------
Academia is a little like child   | Parrish M. Myers
rearing, it provides a chance at  | The Wacked Jester
immortality without the stretch   | parrishmyers@yahoo.com
marks  -- (unknown source)        |
-----------------------------------------------------------

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/