зеркало из https://github.com/mono/mail-archives.git
240 строки
12 KiB
HTML
240 строки
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Gtk-sharp-list] RichTextBox.TextChanged (event) equivalent in GTk.?
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20RichTextBox.TextChanged%20%28event%29%20equivalent%20in%0A%09GTk.%3F&In-Reply-To=1222362919.15118.3.camel%40ubuntu-tower">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="009052.html">
|
|
<LINK REL="Next" HREF="009048.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Gtk-sharp-list] RichTextBox.TextChanged (event) equivalent in GTk.?</H1>
|
|
<B>True Friend</B>
|
|
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20RichTextBox.TextChanged%20%28event%29%20equivalent%20in%0A%09GTk.%3F&In-Reply-To=1222362919.15118.3.camel%40ubuntu-tower"
|
|
TITLE="[Gtk-sharp-list] RichTextBox.TextChanged (event) equivalent in GTk.?">true.friend2004 at gmail.com
|
|
</A><BR>
|
|
<I>Thu Sep 25 21:58:36 EDT 2008</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="009052.html">[Gtk-sharp-list] RichTextBox.TextChanged (event) equivalent in GTk.?
|
|
</A></li>
|
|
<LI>Next message: <A HREF="009048.html">[Gtk-sharp-list] Fwd: Message Status - Undeliverable
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#9057">[ date ]</a>
|
|
<a href="thread.html#9057">[ thread ]</a>
|
|
<a href="subject.html#9057">[ subject ]</a>
|
|
<a href="author.html#9057">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>This was the reason. The unlimited loop was due to last change when it put
|
|
back the modified text. Thanks David, it should work now.
|
|
Regards
|
|
|
|
On Thu, Sep 25, 2008 at 10:15 PM, David Cantin <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">dcantin at gmail.com</A>> wrote:
|
|
|
|
><i> I can do something like :
|
|
</I>><i>
|
|
</I>><i> protected virtual void OnTextBufferChanged(object o, System.EventArgs e)
|
|
</I>><i> {
|
|
</I>><i> string temp = this.textview1.Buffer.Text;
|
|
</I>><i> string temp1 = Regex.Replace(temp, "[\x0011\x0012\u0060]","\'");
|
|
</I>><i> string temp2 = Regex.Replace(temp1, "[\x0013\x0014]", "\"");
|
|
</I>><i> string temp3 = Regex.Replace(temp2, "[+\x0017\x0005\x0015]", "");
|
|
</I>><i> string temp4 = Regex.Replace(temp3, "\x0016", "-");
|
|
</I>><i>
|
|
</I>><i> this.textview1.Buffer.Changed -= new
|
|
</I>><i> EventHandler(OnTextBufferChanged);
|
|
</I>><i>
|
|
</I>><i> this.textview1.Buffer.Text = temp4;
|
|
</I>><i>
|
|
</I>><i> this.textview1.Buffer.Changed += new
|
|
</I>><i> EventHandler(OnTextBufferChanged);
|
|
</I>><i>
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> Le jeudi 25 septembre 2008 à 21:50 +0500, True Friend a écrit :
|
|
</I>><i> >
|
|
</I>><i> > Ok I have added it to the MainWindow's constructor as follows.
|
|
</I>><i> >
|
|
</I>><i> > this.textview1.Buffer.Changed += new
|
|
</I>><i> > EventHandler(OnTextBufferChanged);
|
|
</I>><i> >
|
|
</I>><i> > The evnt handler is as follows.
|
|
</I>><i> > -----------------------------------------------
|
|
</I>><i> > protected virtual void OnTextBufferChanged(object o, System.EventArgs
|
|
</I>><i> > e)
|
|
</I>><i> > {
|
|
</I>><i> > string temp = this.textview1.Buffer.Text;
|
|
</I>><i> > string temp1 = Regex.Replace(temp, "[\x0011\x0012\u0060]",
|
|
</I>><i> > "\'");
|
|
</I>><i> > string temp2 = Regex.Replace(temp1, "[\x0013\x0014]",
|
|
</I>><i> > "\"");
|
|
</I>><i> > string temp3 = Regex.Replace(temp2, "[+\x0017\x0005
|
|
</I>><i> > \x0015]", "");
|
|
</I>><i> > string temp4 = Regex.Replace(temp3, "\x0016", "-");
|
|
</I>><i> > this.textview1.Buffer.Text = temp4;
|
|
</I>><i> > }
|
|
</I>><i> > -------------------------------------------
|
|
</I>><i> > And the result is an unlimited loop. Under is output at MD console
|
|
</I>><i> > output.
|
|
</I>><i> > --------------------------------------------
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x4f)
|
|
</I>><i> > [0xb6964aff]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1ff) [0xb695782f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb696c329]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8ef)
|
|
</I>><i> > [0xb696dc1f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb696df69]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0 [0xb6d56a7c]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0 [0xb6cb5b38]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb6956079]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1ff) [0xb695782f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb696c11a]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8ef)
|
|
</I>><i> > [0xb696dc1f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb696df69]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0 [0xb6d51422]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0(gtk_text_buffer_set_text+0xbe)
|
|
</I>><i> > [0xb6d5254e]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_object_set_property+0x403)
|
|
</I>><i> > [0xb695eb13]
|
|
</I>><i> > [0xb664c759]
|
|
</I>><i> > [0xb664c654]
|
|
</I>><i> > [0xb407f2da]
|
|
</I>><i> > [0xb407f526]
|
|
</I>><i> > [0xb6651733]
|
|
</I>><i> > [0xb66490d8]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x4f)
|
|
</I>><i> > [0xb6964aff]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1ff) [0xb695782f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb696c329]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8ef)
|
|
</I>><i> > [0xb696dc1f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb696df69]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0 [0xb6d56a7c]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0 [0xb6cb5b38]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb6956079]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1ff) [0xb695782f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb696c11a]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8ef)
|
|
</I>><i> > [0xb696dc1f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb696df69]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0 [0xb6d51422]
|
|
</I>><i> > /usr/lib/libgtk-x11-2.0.so.0(gtk_text_buffer_set_text+0xbe)
|
|
</I>><i> > [0xb6d5254e]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_object_set_property+0x403)
|
|
</I>><i> > [0xb695eb13]
|
|
</I>><i> > [0xb664c759]
|
|
</I>><i> > [0xb664c654]
|
|
</I>><i> > [0xb407f2da]
|
|
</I>><i> > [0xb407f526]
|
|
</I>><i> > [0xb6651733]
|
|
</I>><i> > [0xb66490d8]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x4f)
|
|
</I>><i> > [0xb6964aff]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1ff) [0xb695782f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0 [0xb696c329]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8ef)
|
|
</I>><i> > [0xb696dc1f]
|
|
</I>><i> > /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb696df69]
|
|
</I>><i> > ---------------------------------------------------
|
|
</I>><i> > So any ideas?
|
|
</I>><i> > Regards
|
|
</I>><i> > On Thu, Sep 25, 2008 at 9:27 PM, True Friend
|
|
</I>><i> > <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">true.friend2004 at gmail.com</A>> wrote:
|
|
</I>><i> > Thanks. After trying different events finally I added it to
|
|
</I>><i> > filesave event handler. I'll try this as well.
|
|
</I>><i> > Regards
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> > On Thu, Sep 25, 2008 at 9:22 PM, Chris Howie
|
|
</I>><i> > <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">cdhowie at gmail.com</A>> wrote:
|
|
</I>><i> > On Thu, Sep 25, 2008 at 7:00 AM, True Friend
|
|
</I>><i> > <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">true.friend2004 at gmail.com</A>> wrote:
|
|
</I>><i> > > HI
|
|
</I>><i> > > I am working on a simple application. I had same in
|
|
</I>><i> > winforms where I added
|
|
</I>><i> > > above (in subject) said event handler so when I
|
|
</I>><i> > pasted some text or text
|
|
</I>><i> > > changed in rich text box the method was called and
|
|
</I>><i> > it made some
|
|
</I>><i> > > modifications in text. Can you tell me what is its
|
|
</I>><i> > equal in gtk? I tried to
|
|
</I>><i> > > search textview events but couldn't find an
|
|
</I>><i> > appropriate one which can work
|
|
</I>><i> > > as textchanged event...
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> > Much of GTK+ uses the MVC (Model, View, and
|
|
</I>><i> > Controller) model. In
|
|
</I>><i> > this case, TextView is the view and TextBuffer is the
|
|
</I>><i> > model. The
|
|
</I>><i> > changed event is on the TextBuffer, so:
|
|
</I>><i> >
|
|
</I>><i> > this.someTextView.Buffer.Changed +=
|
|
</I>><i> > this.OnSomeTextViewChanged;
|
|
</I>><i> >
|
|
</I>><i> > --
|
|
</I>><i> > Chris Howie
|
|
</I>><i> > <A HREF="http://www.chrishowie.com">http://www.chrishowie.com</A>
|
|
</I>><i> > <A HREF="http://en.wikipedia.org/wiki/User:Crazycomputers">http://en.wikipedia.org/wiki/User:Crazycomputers</A>
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> > --
|
|
</I>><i> > Muhammad Shakir Aziz محمد شاکر عزیز
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> > --
|
|
</I>><i> > Muhammad Shakir Aziz محمد شاکر عزیز
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> > _______________________________________________
|
|
</I>><i> > Gtk-sharp-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>
|
|
</I>><i> > <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</A>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>
|
|
|
|
--
|
|
Muhammad Shakir Aziz محمد شاکر عزیز
|
|
-------------- next part --------------
|
|
An HTML attachment was scrubbed...
|
|
URL: <A HREF="http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080926/b3fa1960/attachment-0001.html">http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080926/b3fa1960/attachment-0001.html</A>
|
|
</PRE>
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="009052.html">[Gtk-sharp-list] RichTextBox.TextChanged (event) equivalent in GTk.?
|
|
</A></li>
|
|
<LI>Next message: <A HREF="009048.html">[Gtk-sharp-list] Fwd: Message Status - Undeliverable
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#9057">[ date ]</a>
|
|
<a href="thread.html#9057">[ thread ]</a>
|
|
<a href="subject.html#9057">[ subject ]</a>
|
|
<a href="author.html#9057">[ 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>
|