projects
/
oftp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progress
[oftp]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index
329f053
..
721cd9a
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-1,15
+1,35
@@
#include "tgfx.h"
#include "input.h"
#include "tgfx.h"
#include "input.h"
+#include "tui.h"
+#include "ftp.h"
+
+struct ftp *ftp;
+struct tui_widget *uilist;
int main(void)
{
union event ev;
int main(void)
{
union event ev;
+ if(!(ftp = ftp_alloc())) {
+ return 1;
+ }
+ if(ftp_connect(ftp, "192.168.0.4", 21) == -1) {
+ ftp_free(ftp);
+ return 1;
+ }
+
init_input();
tg_bgchar(' ');
tg_clear();
init_input();
tg_bgchar(' ');
tg_clear();
+ uilist = tui_list("Remote", 0, 0, 40, 23, 0, 0);
+ tui_add_list_item(uilist, "first item");
+ tui_add_list_item(uilist, "second item");
+ tui_add_list_item(uilist, "another item");
+ tui_add_list_item(uilist, "foo");
+
+ /*
tg_bgcolor(1);
tg_rect("Remote", 0, 0, 40, 23, TGFX_FRAME);
tg_rect("Local", 40, 0, 40, 23, TGFX_FRAME);
tg_bgcolor(1);
tg_rect("Remote", 0, 0, 40, 23, TGFX_FRAME);
tg_rect("Local", 40, 0, 40, 23, TGFX_FRAME);
@@
-18,6
+38,9
@@
int main(void)
tg_fgcolor(7);
tg_text(0, 23, ">");
tg_setcursor(2, 23);
tg_fgcolor(7);
tg_text(0, 23, ">");
tg_setcursor(2, 23);
+ */
+
+ tui_draw(uilist);
while(wait_input(&ev)) {
switch(ev.type) {
while(wait_input(&ev)) {
switch(ev.type) {
@@
-37,5
+60,7
@@
done:
tg_clear();
cleanup_input();
tg_clear();
cleanup_input();
+
+ ftp_free(ftp);
return 0;
}
return 0;
}