[Gtk-sharp-list] editing widget for c#

Fabian Sturm f at rtfs.org
Sun Nov 19 18:37:50 EST 2006


Hi!


On Sun, 2006-11-19 at 17:45 +0100, mlgs wrote:

> > I am looking for an editing widget for c#.



> Gtk.TextView


Yeah I know, but with this I will still have to write all the text
formatting code on my own I guess?

So I have to cut the selection and scan it for already existing tags
and reinsert it with the new tags.

E.g. if I have "this is italic and this too" and I select the whole text
and make it bold I want to get
"this is italic and this too"

To make it work I have to scan the text and to cut the text into pieces
"this is", "italic", "and this", "too" and insert it with

InsertWithTagsByName(iter, this is", ["bold"])
InsertWithTagsByName(iter, "italic", ["bold", "italic"])
...

Which seems to be more complicated then necessary :-(

What I want to say is 

OnItalicClicked()
{
    textbuffer.SetSelection("italic") 
}

OnBoldClicked()
{
    textbuffer.SetSelection("bold") 
}


And to update the editing buttons I would like an event like this:

OnSelectionChanged()
{
  // change the togglebutton appearance according to text state
  if (textbuffer.IsItalic)
  {
    italic_button.Active = true;
  }
  else
  {
    italic_button.Active = false;
  }
}

...

Am I the only one in need of something like this?

Thanks a lot, Fabian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061120/fe57fc1c/attachment.html 


More information about the Gtk-sharp-list mailing list