version 0.8.8

This commit is contained in:
Andreas Rumpf
2010-03-14 01:25:25 +01:00
parent 3dafd6856b
commit 7bf98411b6
52 changed files with 15732 additions and 6193 deletions

View File

@@ -0,0 +1,5 @@
import colors
echo int32(colWhite), 'A'

View File

@@ -2,7 +2,7 @@
import dialogs, gtk2
gtk_nimrod_init()
gtk2.nimrod_init()
var x = ChooseFilesToOpen(nil)
for a in items(x):

View File

@@ -3,10 +3,10 @@ import
gtk2, glib2, atk, gdk2, gdk2pixbuf, libglade2, pango,
pangoutils
proc hello(widget: PGtkWidget, data: pointer) {.cdecl.} =
proc hello(widget: PWidget, data: pointer) {.cdecl.} =
write(stdout, "Hello World\n")
proc delete_event(widget: PGtkWidget, event: PGdkEvent,
proc delete_event(widget: PWidget, event: PEvent,
data: pointer): bool {.cdecl.} =
# If you return FALSE in the "delete_event" signal handler,
# GTK will emit the "destroy" signal. Returning TRUE means
@@ -19,43 +19,33 @@ proc delete_event(widget: PGtkWidget, event: PGdkEvent,
return false
# Another callback
proc destroy(widget: PGtkWidget, data: pointer) {.cdecl.} =
gtk_main_quit()
proc mydestroy(widget: PWidget, data: pointer) {.cdecl.} =
gtk2.main_quit()
proc main() =
proc mymain() =
# GtkWidget is the storage type for widgets
var
window: PGtkWindow
button: PGtkButton
gtk_nimrod_init()
window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL))
gtk2.nimrod_init()
var window = window_new(gtk2.WINDOW_TOPLEVEL)
discard g_signal_connect(window, "delete_event",
Gcallback(delete_event), nil)
discard g_signal_connect(window, "destroy", Gcallback(destroy), nil)
discard g_signal_connect(window, "destroy", Gcallback(mydestroy), nil)
# Sets the border width of the window.
gtk_container_set_border_width(window, 10)
set_border_width(window, 10)
# Creates a new button with the label "Hello World".
button = GTK_BUTTON(gtk_button_new_with_label("Hello World"))
var button = button_new("Hello World")
discard g_signal_connect(button, "clicked", Gcallback(hello), nil)
# This will cause the window to be destroyed by calling
# gtk_widget_destroy(window) when "clicked". Again, the destroy
# signal could come from here, or the window manager.
discard g_signal_connect_swapped(button, "clicked",
Gcallback(gtk_widget_destroy), window)
# This packs the button into the window (a gtk container).
gtk_container_add(window, button)
add(window, button)
# The final step is to display this newly created widget.
gtk_widget_show(button)
show(button)
# and the window
gtk_widget_show(window)
show(window)
gtk_main()
gtk2.main()
main()
mymain()

View File

@@ -18,7 +18,7 @@ proc splitText(txt: string): seq[string] # splits a text into several lines
# the comment continues here
# this is not easy to parse!
proc anotherSplit(txt: string): list[string] =
proc anotherSplit(txt: string): seq[string] =
# the comment should belong to `anotherSplit`!
# another problem: comments are statements!

View File

@@ -12,7 +12,10 @@ import
cairowin32, cairoxlib,
odbcsql,
gl, glut, glu, glx, glext, wingl,
lua, lualib, lauxlib, mysql, sqlite3, python, tcl
lua, lualib, lauxlib, mysql, sqlite3, python, tcl,
db_postgres, db_mysql, db_sqlite, ropes, sockets, browsers, httpserver,
httpclient, parseutils, unidecode, xmldom, xmldomparser, xmltree, xmlparser,
htmlparser, re, graphics, colors
when defined(linux):
import

View File

@@ -0,0 +1,7 @@
import db_sqlite
var db: TDbConn
Exec(db, sql"create table blabla()")

View File

@@ -11,6 +11,7 @@ tbintree.nim;halloworld99110223
tbug499771.nim;TSubRange: 5 from 1 to 10
tbug511622.nim;3
tcasestm.nim;ayyy
tcgbug.nim;
tclosure.nim;2 4 6 8 10
tcnstseq.nim;AngelikaAnneAnnaAnkaAnja
tconstr2.nim;69
1 tack.nim 125
11 tbug499771.nim TSubRange: 5 from 1 to 10
12 tbug511622.nim 3
13 tcasestm.nim ayyy
14 tcgbug.nim
15 tclosure.nim 2 4 6 8 10
16 tcnstseq.nim AngelikaAnneAnnaAnkaAnja
17 tconstr2.nim 69

View File

@@ -0,0 +1,17 @@
type
TObj = object
x, y: int
PObj = ref TObj
proc p(a: PObj) =
a.x = 0
proc q(a: var PObj) =
a.p()
var
a: PObj
new(a)
q(a)

6
tests/accept/run/txmlgen.nim Executable file
View File

@@ -0,0 +1,6 @@
import xmlgen
var nim = "Nimrod"
echo h1(a(href="http://force7.de/nimrod", nim))

View File

@@ -1,7 +1,7 @@
import xmltree
import xmltree, strtabs
var x = <>a(href="nimrod.de", "www.nimrod-test.de")
var x = <>a(href="nimrod.de", newText("www.nimrod-test.de"))
echo x == "<a href=\"nimrod.de\">www.nimrod-test.de"
echo($x == "<a href=\"nimrod.de\">www.nimrod-test.de</a>")