XwtPlus.TextEditor - A port of Mono.TextEditor

341 views
Skip to first unread message

Luís Reis

unread,
Apr 14, 2014, 7:55:26 PM4/14/14
to xwt-...@googlegroups.com
I have ported parts of Mono.TextEditor (used by MonoDevelop) to Xwt.

https://github.com/luiscubal/XwtPlus.TextEditor

It currently only works with a special branch of Xwt.WPF, but I hope this can be a good demonstration of what is possible to do with Xwt and some of the changes that are needed for Xwt to be capable of completely replacing GTK+ in MonoDevelop.

It is licensed under the MIT license, like Mono.TextEditor itself.

I made this over a month ago, but I figured it wasn't doing anything on my hard drive so I decided to publish it. Even if it does not have the code quality I'd like it have, it's better than nothing.

Unfortunately, I used Visual Studio, which tends to reformat everything it can. This makes it harder to compare (diff) this to the real Mono.TextEditor, which is practically required in order to reach parity.

I restarted this project several times. I tried starting from Mono.TextEditor and moving to Xwt, and I tried starting a fresh Xwt project and importing the parts of Mono.TextEditor that were useful.
Each time I did one of those things, I learned a bit more about the original project, so each effort got farther. Eventually, I got this result (can't remember which approach I settled for). It does include a lot of Mono.TextEditor classes with virtually no changes, and it also contains a lot of completely original code.

Luís Reis

jmalcolm

unread,
May 6, 2014, 12:05:23 PM5/6/14
to xwt-...@googlegroups.com
Very interesting. I tried to build it on Linux with limited success. I got window up with the digit 1 displayed but it did not seem to do anything. There were quite a few errors including the inability to find libpango-1.0-0.dll so perhaps my the Xwt I am using is broken (the sample files work though).

Perhaps this will be a solution to the lack of a multi-line TextEntry on GTK+. I know this is overkill but I really cannot use Xwt without it.

Luís Reis

unread,
May 6, 2014, 12:12:25 PM5/6/14
to xwt-...@googlegroups.com
Right now, this does not have a GTK+ implementation at all (it is missing the required text input APIs), but this is not enough to explain the specific error you're getting.
libpango should handle the *rendering* of the text, not the input, so that part should work just like standard Xwt does.
Does the DrawText sample work for you?


--
You received this message because you are subscribed to the Google Groups "XWT Widget Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xwt-list+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

just cra0zy

unread,
Jun 11, 2015, 6:39:07 PM6/11/15
to xwt-...@googlegroups.com

It looks god awful, but I got it running... also I recommend using OpenTK for getting input.

just cra0zy

unread,
Jun 12, 2015, 9:46:05 AM6/12/15
to xwt-...@googlegroups.com

A bit of updating later and all is well :D. For getting input I had to move code from HandlePreviewTextInput to HandleKeyPressed, and setup input events there. Also since I forgot to mention this is in Linux, Gtk3 Backend.


Reply all
Reply to author
Forward
0 new messages