Skip to content

Commit c8c0b0b

Browse files
committed
removed form_simple.d, broken.
1 parent 5e454c5 commit c8c0b0b

File tree

5 files changed

+16
-77
lines changed

5 files changed

+16
-77
lines changed

examples/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DC=rdmd -g -w --build-only -ofbin/$@ -I../ -L-lncursesw $^
22

3-
all: init helloUnicode helloWorld simpleColor simpleKey simpleSpectrum keyCode chgat acsVars printw simplePanel
3+
all: init helloUnicode helloWorld simpleColor simpleKey simpleSpectrum keyCode chgat acsVars printw simplePanel winBorder.d
4+
45

56
init:
67
@echo "building all examples..."
@@ -39,6 +40,8 @@ tempLeave: tempLeave.d
3940
printw: printw.d
4041
$(DC)
4142

43+
winBorder: winBorder.d
44+
$(DC)
4245
clean:
4346
@rm bin/*
4447
@echo "done."

examples/form_simple.d

Lines changed: 0 additions & 66 deletions
This file was deleted.

examples/helloUnicode.d

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ void main()
2424
// like systems, you can use the `locale` command to show the
2525
// current settings for your environment.
2626

27-
auto hello = toStringz("日本語からの「Hello World!」");
27+
immutable hello = toStringz("日本語からの「Hello World!」");
2828

2929
initscr(); //initialize the screen
30+
scope(exit) endwin(); //for the love of all that is holy, alway exit cleanly.
31+
3032
printw(hello); //prints the char[] hello to the screen
3133
refresh(); //actually does the writing to the physical screen
34+
3235
getch(); //gets a single character from the screen.
33-
endwin(); //Routine to call before exiting, or leaving curses mode temporarily
3436
}

examples/helloWorld.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* Modified by: 1100110
1414
*/
15-
import std.string: toStringz;
15+
import std.string: toStringz;
1616
import deimos.ncurses.ncurses;
1717

1818
void main()
@@ -21,7 +21,7 @@ void main()
2121
//work as nicely as it does.
2222
//D string d = "stuff" will never work with these functions.
2323
//they expect char* see below.
24-
auto hello = toStringz("Hello ncurses World!\nPress any key to continue...");
24+
immutable hello = toStringz("Hello ncurses World!\nPress any key to continue...");
2525

2626
/* D char[]s are not 0 terminated, so you'll probably want to do that manually
2727
* with hello ~= '\0';
@@ -32,14 +32,14 @@ void main()
3232
*/
3333

3434
initscr(); //initialize the screen
35+
scope(exit) endwin(); //always exit cleanly
3536
printw(hello); //prints the char[] hello to the screen
3637
refresh(); //actually does the writing to the physical screen
38+
3739
getch(); //gets a single character from the screen.
3840
//here it is just used to hold the terminal open.
39-
//remove it and see what happens.
41+
4042
endwin(); //Routine to call before exiting, or leaving curses mode temporarily
4143
//failure to endwin() seems to clear all terminal history
4244
//as well as other bad things. just endwin().
43-
//Your terminal might be left in an unusable state if you don't.
44-
//Mine certainly was.
4545
}

examples/win_border.d renamed to examples/winBorder.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#!/usr/bin/rdmd -L-lncursesw
12
//Modified by: 1100110
23

3-
import std.string: toStringz;
4+
import std.string: toStringz;
45
import deimos.ncurses.ncurses;
56

67

@@ -11,6 +12,7 @@ void main()
1112
int ch;
1213

1314
initscr(); //Start curses mode
15+
scope(exit) endwin();
1416
cbreak(); //Line buffering disabled, Pass on everty thing to me
1517
keypad(stdscr, true); //I need that nifty F1
1618

@@ -46,8 +48,6 @@ void main()
4648
break;
4749
}//switch-case
4850
}//while()
49-
50-
endwin(); //End curses mode
5151
}
5252

5353
WINDOW* create_newwin(int height, int width, int starty, int startx)

0 commit comments

Comments
 (0)