[Gtk-sharp-list] Don't do myframe.Add(mylabel) if it was already done

David Griffith dgriffi at cs.csubak.edu
Sun Feb 25 17:40:08 EST 2007


I'm building a C# app using Stetic.  There's one Notebook widget.  On each
page of the Notebook there's an HBox with a VButtonBox at the left.  All
the business happens on the right HBox slot.  On the "Management" page, is
the "About" button.  Here's the code for the About button:

protected virtual void OnAbout(object sender, System.EventArgs e)
	{
		Frame myframe = new Frame();
		Label label = new Label();
		myframe.Label = "About Dave's Pizza Helper";
		label.Text = "Dave's App";
		myframe.Add(label);
		ManagementHbox.Add(myframe);
		ManagementHbox.ShowAll();
	} // end method OnAbout

My problem is that this repeatedly adds myframe to ManagementHbox.  How do
I avoid this?

-- 
David Griffith
dgriffi at cs.csubak.edu

A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


More information about the Gtk-sharp-list mailing list