Skip to content
Mono/.NET bindings to the Unix Curses as well as GUI framework for creating text applications with Curses
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs update mainloop with Windows support Feb 16, 2018
.gitignore
AUTHORS Add files Apr 6, 2007
AssemblyInfo.cs Add Oct 12, 2008
ChangeLog 2010-05-25 Miguel de Icaza <miguel@novell.com> May 25, 2010
Makefile
README.md Update Jan 11, 2018
TODO Add some docs Jan 18, 2011
attrib.c Add other ncurses characters Jan 26, 2018
binding.cs Support for bindings to different ncurses version Feb 25, 2018
configure Remove MonoTorrent from here, keep this Curses-only, add some tiny do… Oct 12, 2008
gtest.cs
gtestshot.png Add Nov 11, 2017
gui.cs Drop native library requirement Jan 11, 2018
guitest.cs Move some classes inside Curses, re-namespace, add some public methods Dec 12, 2017
handles.cs Move some classes inside Curses, re-namespace, add some public methods Dec 12, 2017
mainloop.cs Do not echo character, backport Feb 25, 2018
mltest.cs
mono-curses.csproj Go bold - based on my research, poll definitions are stable across OS… Feb 14, 2018
mono-curses.pc.in Fix Sep 12, 2009
mono-curses.sln Update solution files. Mar 13, 2011
mono-curses.snk
mono-curses.source * mono-curses.source: Add a /monodoc/node element so that Feb 9, 2009
monotorrent.in Make this distributable Apr 25, 2007
test.cs Move some classes inside Curses, re-namespace, add some public methods Dec 12, 2017

README.md

mono-curses

This provides both a low-level API, as well as a simple console UI toolkit called gui.cs.

The goal of this library was to bind curses. There is a low-level binding in binding.cs and a few chunks in handles.cs that provide a basic abstraction.

The focus of this work though has been on a simple GUI toolkit for writing desktop applications, inspired on the 15 year old work that I did for the Midnight Commander (you can tell I like those colors).

The work in `gui' does not take advantage of curses "WINDOWS" or the Panel library as am not familiar with them, instead we create our own abstraction here.

Example

I recently added a neutered version of an old UI I did for MonoTorrent that has the actual torrent code removed, but shows how to use the gui.cs toolkit.

To run, just type make grun

sample guitest.cs in action

License

This is an ncurses binding licensed under the terms of the MIT X11 license.

Features

Detects window changes, invokes event for widgets to relayout if the user wishes to.

Hotkeys (Alt-letter) are handled by buttons and a handful others.

Dialog boxes automatically get centered (even with window size change scenarios).

Entry widget has emacs keybindings.

ListView widget uses Model/View setup.

Color and black and white support (first parameter to Application.Init)

Setup and Building

To build, make sure that you run the configure script, where you can specify an installation prefix, and then run make. Like this:

$ configure 
$ make

The above defaults to installing in /usr/local, if you want to change that use the --prefix flag, like this:

$ configure --prefix=/opt/mono-curses/my-install
$ make

Once you do a first build with the above, you can use the provided solution file to rebuild.

Demo

You can see how to use the curses API by running the test.exe, which only shows some letters on the screen with curses, or the guitest.exe which is a fake application using gui.cs

TODO for the tiny Gui.cs library

I started an alternative version for gui.cs here:

github.com/migueldeicaza/gui.cs
  • Rename x,y,w,h into something better, expose rects?
  • Merge Widget and Container?
  • Add scrollbar and thumb to listviews
  • Add text view widget
  • Add scrollable control
  • Checkbox/Radio button are missing
  • Date/Time widget
  • Process widget
  • Command line parsing to demo (to active B&W support).
  • Implement Layout managers, which?
  • Write a manual/tutorial
You can’t perform that action at this time.