This repository has been archived by the owner on Oct 10, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
initial commit.
- Loading branch information
0 parents
commit 0771ccc
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include $(GOROOT)/src/Make.inc | ||
|
||
TARG=zzz | ||
GOFILES=zzz.go view.go | ||
|
||
include $(GOROOT)/src/Make.cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
vbox | ||
@label#style_normal:fg=yellow,bg=blue,attr=bold | ||
label | ||
text:"zzz 0.0" | ||
.expand:0 | ||
.height:1 | ||
list | ||
.expand:vh | ||
pos[listpos]:0 | ||
listitem text:"foo" | ||
label | ||
text[info]:"some general information about whatever" | ||
.expand:0 | ||
hbox | ||
.expand:0 | ||
label | ||
text[prompt]:"Prompt: " | ||
style_normal: | ||
.expand:0 | ||
input | ||
.expand:h | ||
text[mytext]:"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
import ( | ||
"stfl" | ||
) | ||
|
||
type View struct { | ||
f *stfl.Form | ||
} | ||
|
||
func CreateView() (v *View) { | ||
v = new(View) | ||
v.f = stfl.Create("<screen.stfl>") | ||
return | ||
} | ||
|
||
func(v View) Run() { | ||
|
||
quit := false | ||
|
||
for !quit { | ||
key := v.f.Run(0) | ||
switch key { | ||
case "q": | ||
quit = true | ||
// TODO: more keys | ||
} | ||
} | ||
|
||
v.f.Free() | ||
stfl.Reset() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
"fmt" | ||
) | ||
|
||
type ServerInfo struct { | ||
Server string | ||
Port int | ||
Nick string | ||
} | ||
|
||
func main() { | ||
info := ServerInfo{ "", 6767, "" } | ||
|
||
flag.IntVar(&info.Port, "port", 6767, "IRC server port") | ||
flag.StringVar(&info.Server, "server", "", "IRC server hostname") | ||
flag.StringVar(&info.Nick, "nick", os.Getenv("USER"), "Your nick") | ||
|
||
flag.Parse() | ||
|
||
if info.Server == "" { | ||
usage() | ||
} | ||
|
||
v := CreateView() | ||
|
||
v.Run() | ||
|
||
} | ||
|
||
func usage() { | ||
fmt.Println("usage: zzz -server <server> [-port <port>] [-nick <nick>]") | ||
os.Exit(1) | ||
} |