Alexander Gladysh | 6 Sep 20:25

Editor controls with Lua API?

Hi, list!

Are there any cross-platform GUI notepad-like editor controls,
scriptable in Lua, besides Scintilla? I need OS X / Linux / Win32
support and UTF-8. As I'm planning some custom usage, I do not need
most of usual fancy features -- just decent flexibility, and good
multi-style text output support (even multicolor-only would do).

On to the other hand, may be I'd prefer to get non-Lua editor control
with clean API (on Lua's level on cleanness ;-) ), and to bind it
myself to suit my needs. Are there any? What I've seen is a bit too
bloated to my taste...

Alexander.

Thomas Harning | 6 Sep 20:43
Gravatar

Re: Editor controls with Lua API?

You might want to check out Geany [1], a GTK+ editor w/ a Lua plugin  
[2].  It's pretty lean and the Lua plugin seems pretty clean.

1: http://www.geany.org/
2: http://www.geany.org/Support/Plugins

On Sep 6, 2008, at 2:26 PM, Alexander Gladysh wrote:

> Hi, list!
>
> Are there any cross-platform GUI notepad-like editor controls,
> scriptable in Lua, besides Scintilla? I need OS X / Linux / Win32
> support and UTF-8. As I'm planning some custom usage, I do not need
> most of usual fancy features -- just decent flexibility, and good
> multi-style text output support (even multicolor-only would do).
>
> On to the other hand, may be I'd prefer to get non-Lua editor control
> with clean API (on Lua's level on cleanness ;-) ), and to bind it
> myself to suit my needs. Are there any? What I've seen is a bit too
> bloated to my taste...
>
> Alexander.

Alexander Gladysh | 6 Sep 21:05

Re: Editor controls with Lua API?

On Sat, Sep 6, 2008 at 10:43 PM, Thomas Harning <harningt <at> gmail.com> wrote:
> You might want to check out Geany [1], a GTK+ editor w/ a Lua plugin [2].
>  It's pretty lean and the Lua plugin seems pretty clean.
>
> 1: http://www.geany.org/
> 2: http://www.geany.org/Support/Plugins

Thank you, but it seems that Geany is an IDE built on Scintilla.

I should have specified that in my first mail, but I'm not looking for
an IDE. I'm investigating possibility to make a custom editor for
non-programmers. So I do not need (almost) any of IDE features. I need
an embeddable editor control which I would drive with Lua by my own
unusual ways.

I'd rather teach some unambitious edit control new tricks than
struggle with full-blown IDE to behave against its nature.

Alexander.

Jeff Pohlmeyer | 6 Sep 21:32

Re: Editor controls with Lua API?

Alexander Gladysh wrote:

> I need an embeddable editor control which I would drive with
> Lua by my own unusual ways.
>
> I'd rather teach some unambitious edit control new tricks than
> struggle with full-blown IDE to behave against its nature.

Perhaps the edit control from Fox-Toolkit or FLTK might
better suit your needs. The FLTK control is derived from
an early version of the famous "NEdit" text editor.

The Fox control is AFAIK written from scratch, and the
"Adie"  text editor that comes with Fox might be a nice
starting point, it's a fairly complete editor in around
4000 lines of code.

There's also something called "GtkSourceView" but of course
that requires GTK, which is a rather large dependency for
systems that don't already use it. The nice thing about
FLTK or Fox is that they are lightweight enough to be
statically linked, so you won't need a bunch of extra
libraries installed if you distribute a pre-compiled
version of your editor.

http://fltk.org/
http://fox-toolkit.org/
http://projects.gnome.org/gtksourceview/

- Jeff
(Continue reading)

Alexander Gladysh | 6 Sep 22:45

Re: Editor controls with Lua API?

On Sat, Sep 6, 2008 at 11:32 PM, Jeff Pohlmeyer
<yetanothergeek <at> gmail.com> wrote:
> Alexander Gladysh wrote:
>
>> I need an embeddable editor control which I would drive with
>> Lua by my own unusual ways.
>>
>> I'd rather teach some unambitious edit control new tricks than
>> struggle with full-blown IDE to behave against its nature.

<...>

> http://fltk.org/
> http://fox-toolkit.org/
> http://projects.gnome.org/gtksourceview/

Thank you! This looks promising, I'd give these controls a try.
However, I've got a feeling that it is still too high-level. I'd like
to use something even more modest.

I need:

1. Full control on text display styles on my side backed up by
necessary OnChange-type notifications. That is, regular expressions
and such as highlighting tool are not acceptable. I would get text
style as a by-product of my app's internal logic.

2. Full control on context menus and dynamic toolbar content (if any,
toolbars are optional; context menus are required) based on current
cursor position (or click coordinates).
(Continue reading)

Matias Guijarro | 6 Sep 23:22
Favicon

Re: Editor controls with Lua API?

Hello :-)

Just to add that it seems to me that creating a FTLK application
using the Fl_Text_Editor widget (the one derived from NEdit)
will allow you to do everything you want (points 1, 2 and 3).

Moreover, FLTK can be linked statically to your executable as
it is quite small (around 700 ko), and it compiles at least on
Windows, Linux and MacOS X systems...

Why would you need a "big GUI library" ?

Cheers,
Matias.

Alexander Gladysh a écrit :
> On Sat, Sep 6, 2008 at 11:32 PM, Jeff Pohlmeyer
> <yetanothergeek <at> gmail.com> wrote:
>   
>> Alexander Gladysh wrote:
>>
>>     
>>> I need an embeddable editor control which I would drive with
>>> Lua by my own unusual ways.
>>>
>>> I'd rather teach some unambitious edit control new tricks than
>>> struggle with full-blown IDE to behave against its nature.
>>>       
>
> <...>
(Continue reading)

Alexander Gladysh | 7 Sep 09:22

Re: Editor controls with Lua API?

On Sun, Sep 7, 2008 at 1:22 AM, Matias Guijarro <matias.guijarro <at> free.fr> wrote:
> Just to add that it seems to me that creating a FTLK application
> using the Fl_Text_Editor widget (the one derived from NEdit)
> will allow you to do everything you want (points 1, 2 and 3).

After re-reading the Fl_Text_Editor docs, it seems that you're right
:-) I would start with FTLK then.

> Moreover, FLTK can be linked statically to your executable as
> it is quite small (around 700 ko), and it compiles at least on
> Windows, Linux and MacOS X systems...
>
> Why would you need a "big GUI library" ?

I do not need one of course :)

Thanks for advice,
Alexander.

Steve Donovan | 8 Sep 18:30

Re: Editor controls with Lua API?

From: "Alexander Gladysh" <agladysh <at> gmail.com>
> Thank you, but it seems that Geany is an IDE built on Scintilla.

There is an OS X port of Scintilla:

http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/2801349

Mentions a test suite, but no intentions to port SciTE, say.  That would be 
a mission.

> I'd rather teach some unambitious edit control new tricks than
> struggle with full-blown IDE to behave against its nature.

I like this sentence ;) Unfortunately, one of my new year resolutions is not 
to reinvent wheels, so I'm stuck with SciTE for a while.  Although, once you 
have a reasonably comprehensive binding to an edit control and an overall 
GUI framework (NB point) the rest should be fun...

steve d.


Gmane