mail-archives/gtk-sharp-list/2008-February/008470.html

146 строки
6.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Notebook Widget
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Notebook%20Widget&In-Reply-To=fdf2899f0802240436g23b79a69scdc43c88f0c31893%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="008469.html">
<LINK REL="Next" HREF="008471.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Notebook Widget</H1>
<B>Darwin Reynoso</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Notebook%20Widget&In-Reply-To=fdf2899f0802240436g23b79a69scdc43c88f0c31893%40mail.gmail.com"
TITLE="[Gtk-sharp-list] Notebook Widget">monouser at gmail.com
</A><BR>
<I>Sun Feb 24 08:49:15 EST 2008</I>
<P><UL>
<LI>Previous message: <A HREF="008469.html">[Gtk-sharp-list] Notebook Widget
</A></li>
<LI>Next message: <A HREF="008471.html">[Gtk-sharp-list] Need help in compilation
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#8470">[ date ]</a>
<a href="thread.html#8470">[ thread ]</a>
<a href="subject.html#8470">[ subject ]</a>
<a href="author.html#8470">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Chris never mind i got it working anyway thanks so much for your help.
On Sun, Feb 24, 2008 at 7:36 AM, Darwin Reynoso &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">monouser at gmail.com</A>&gt; wrote:
&gt;<i> Hi Chris, can you please tell me what i'm doing wrong i'm using monodevelop RC1
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> //create a page with a textview widget
</I>&gt;<i> protected virtual void onclicked (object sender, System.EventArgs e)
</I>&gt;<i> {
</I>&gt;<i> string label = &quot;Hex File&quot;;
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> HBox hbox = new HBox();
</I>&gt;<i>
</I>&gt;<i> hbox.PackStart(new Label(label));
</I>&gt;<i>
</I>&gt;<i> Button close = new Button(&quot;X&quot;); // Set this up with an image or whatever.
</I>&gt;<i>
</I>&gt;<i> close.Relief = ReliefStyle.None;
</I>&gt;<i>
</I>&gt;<i> close.FocusOnClick = false;
</I>&gt;<i>
</I>&gt;<i> close.Clicked += delegate {
</I>&gt;<i> hbox.Destroy();
</I>&gt;<i> textview.Destroy();
</I>&gt;<i> };
</I>&gt;<i>
</I>&gt;<i> hbox.PackStart(close);
</I>&gt;<i>
</I>&gt;<i> hbox.ShowAll();
</I>&gt;<i>
</I>&gt;<i> notebook1.AppendPage(textview, hbox);
</I>&gt;<i> notebook1.ShowAll();
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> }
</I>&gt;<i>
</I>&gt;<i> On Sun, Feb 24, 2008 at 6:08 AM, Chris Howie &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">cdhowie at gmail.com</A>&gt; wrote:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; On Sat, Feb 23, 2008 at 7:36 PM, Darwin Reynoso &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">monouser at gmail.com</A>&gt; wrote:
</I>&gt;<i> &gt; &gt; Hi,
</I>&gt;<i> &gt; &gt; how do i add a close button widget to a notebook page kind of like
</I>&gt;<i> &gt; &gt; monodevelop tabs.
</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; here is my code
</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; //create a page with a textview widget
</I>&gt;<i> &gt; &gt; protected virtual void onclicked (object sender, System.EventArgs e)
</I>&gt;<i> &gt; &gt; {
</I>&gt;<i> &gt; &gt; //i need a textview so i can show a hex file
</I>&gt;<i> &gt; &gt; textview = new TextView();
</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; string label = &quot;Hex output&quot;;
</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; notebook1.AppendPage (textview , new Label (label));
</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; notebook1.ShowAll();
</I>&gt;<i> &gt; &gt; }
</I>&gt;<i> &gt; &gt; i need to be able to close the page
</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; thanks
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Replace your AppendPage call with something like:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; ------8&lt;------
</I>&gt;<i> &gt; HBox hbox = new HBox();
</I>&gt;<i> &gt; hbox.PackStart(new Label(label));
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Button close = new Button(&quot;X&quot;); // Set this up with an image or whatever.
</I>&gt;<i> &gt; close.Relief = ReliefStyle.None;
</I>&gt;<i> &gt; close.FocusOnClick = false;
</I>&gt;<i> &gt; close.Clicked += delegate {
</I>&gt;<i> &gt; hbox.Destroy();
</I>&gt;<i> &gt; textview.Destroy();
</I>&gt;<i> &gt; };
</I>&gt;<i> &gt; hbox.PackStart(close);
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; hbox.ShowAll();
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; notebook1.AppendPage(textview, hbox);
</I>&gt;<i> &gt; ------8&lt;------
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; --
</I>&gt;<i> &gt; Chris Howie
</I>&gt;<i> &gt; <A HREF="http://www.chrishowie.com">http://www.chrishowie.com</A>
</I>&gt;<i> &gt; <A HREF="http://en.wikipedia.org/wiki/User:Crazycomputers">http://en.wikipedia.org/wiki/User:Crazycomputers</A>
</I>&gt;<i> &gt;
</I>&gt;<i>
</I></PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="008469.html">[Gtk-sharp-list] Notebook Widget
</A></li>
<LI>Next message: <A HREF="008471.html">[Gtk-sharp-list] Need help in compilation
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#8470">[ date ]</a>
<a href="thread.html#8470">[ thread ]</a>
<a href="subject.html#8470">[ subject ]</a>
<a href="author.html#8470">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
mailing list</a><br>
</body></html>