Hi David, Just keep a boolean field in the class, set it to true when you first add the frame and check it every time to avoid doing it again.
Nevertheless, that is not the way users expect 'about something' to work... Guidelines exist to make apps more consistent with each other to the benefit of users, but you're free to ignore my remarks. Have fun, On 2/25/07, David Griffith <[EMAIL PROTECTED]> wrote: > > 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 > [EMAIL PROTECTED] > > 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? > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > -- Rafael "Monoman" Teixeira --------------------------------------- "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man." George Bernard Shaw _______________________________________________ Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/gtk-sharp-list