Files
mercury/extras/curses/sample/smalltest.m
Julien Fischer 36ac2b4c77 Merge late changes from the 0.13 branch onto the main branch.
Estimated hours taken: 0.5
Branches: main

Merge late changes from the 0.13 branch onto the main branch.

BUGS:
	Merge in additions from the 0.12(!) branch.

HISTORY:
	Fix typos and be more consistent about the formatting of dates.

NEWS:
	Move the news about checking inst declarations for consistency
	with visible type constructors to the post-0.13 news where it belongs.

	Merge changes to the 0.13 branch.

README.Solaris:
	Merge changes from the 0.13 branch.

compiler/notes/todo.html:
	Merge changes from the 0.13 branch.

doc/user_guide.texi:
	Merge changes from 0.13 branch related to trace counts
	documentation.

extras/curses/sample/smalltest.m:
extras/gator/genotype.m:
extras/references/tests/ref_test.m:
samples/rot13/rot13_ralph.m:
tests/mmc_make/complex_test.m:
tests/mmc_make/lib/complex.m:
	Merge minor fixes from the 0.13 branch.
2006-09-15 09:11:24 +00:00

58 lines
1.7 KiB
Mathematica

%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
%
% This file is hereby placed into the public domain by the author (rejj).
%
% A simple test Mercury curses binding.
%
%-----------------------------------------------------------------------------%
:- module smalltest.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- implementation.
:- import_module mcurses.
:- import_module mcurses.basics.
:- import_module mcurses.user.
:- import_module int.
:- import_module list.
:- import_module pair.
%-----------------------------------------------------------------------------%
main(!IO) :-
init(Root, !IO),
start_colour(!IO),
cols(Cols, !IO),
rows(Rows, !IO),
create(Root, [], 0, 0, Cols, 3, TopWindow, !IO),
create(Root, [], 0, 4, Cols, Rows - 4, BottomWindow, !IO),
place_string(TopWindow, 0, 2, "Hi!", !IO),
place_char(BottomWindow, 10, 10, '@' - [bold, colour(yellow)], !IO),
redraw(!IO),
getkey(_, !IO),
scroll(TopWindow, 1, !IO),
place_string(TopWindow, 0, 2, "Bye!", !IO),
clear(BottomWindow, !IO),
place_char(BottomWindow, 10, 5, '@' - [bold, colour(green)], !IO),
redraw(!IO),
getkey(_, !IO),
endwin(!IO).
%-----------------------------------------------------------------------------%
:- end_module smalltest.
%-----------------------------------------------------------------------------%