summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/gtk/ex6.nim2
-rwxr-xr-xexamples/httpserver2.nim4
-rwxr-xr-xexamples/lazarus/nimlaz.lpi2
-rw-r--r--examples/lazarus/nimlaz.rc6
-rwxr-xr-xexamples/pythonex.nim1
-rwxr-xr-xexamples/x11ex.nim12
6 files changed, 17 insertions, 10 deletions
diff --git a/examples/gtk/ex6.nim b/examples/gtk/ex6.nim
index 4e4c3e864..7374b19cd 100755
--- a/examples/gtk/ex6.nim
+++ b/examples/gtk/ex6.nim
@@ -38,7 +38,7 @@ add(window, windowbox)
 discard signal_connect(window, "destroy", SIGNAL_FUNC(ex6.destroy), nil)
 QuitState.Obj = QuitButton
 quitState.SignalID = signal_connect_object(QuitState.Obj, "clicked", 
-                       SIGNAL_FUNC(widgetDestroy), window)
+                       SIGNAL_FUNC(widgetDestroy), window).int32
 QuitState.Disable = True
 discard signal_connect(disablebutton, "clicked", 
                    SIGNAL_FUNC(disablesignal), addr(QuitState))
diff --git a/examples/httpserver2.nim b/examples/httpserver2.nim
index 45c57a755..45350ac89 100755
--- a/examples/httpserver2.nim
+++ b/examples/httpserver2.nim
@@ -232,7 +232,9 @@ when isMainModule:
     # check for new new connection & handle it
     var list: seq[TSocket] = @[server.socket]
     if select(list, 10) > 0:
-      var client = accept(server.socket)
+      var client: TSocket
+      new(client)
+      accept(server.socket, client)
       try:
         acceptRequest(server, client)
       except:
diff --git a/examples/lazarus/nimlaz.lpi b/examples/lazarus/nimlaz.lpi
index 13417a09a..3b9abd129 100755
--- a/examples/lazarus/nimlaz.lpi
+++ b/examples/lazarus/nimlaz.lpi
@@ -51,7 +51,7 @@
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="Unit1"/>
         <CursorPos X="26" Y="27"/>
-        <TopLine Value="1"/>
+        <TopLine Value="2"/>
         <EditorIndex Value="0"/>
         <UsageCount Value="21"/>
         <Loaded Value="True"/>
diff --git a/examples/lazarus/nimlaz.rc b/examples/lazarus/nimlaz.rc
new file mode 100644
index 000000000..d66bb817c
--- /dev/null
+++ b/examples/lazarus/nimlaz.rc
@@ -0,0 +1,6 @@
+#define RT_MANIFEST  24

+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1

+#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2

+#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3

+

+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "nimlaz.manifest"
diff --git a/examples/pythonex.nim b/examples/pythonex.nim
index e2664f350..310d80151 100755
--- a/examples/pythonex.nim
+++ b/examples/pythonex.nim
@@ -9,4 +9,3 @@ Py_Initialize()
 discard PyRun_SimpleString("from time import time,ctime\L" &
                            "print 'Today is',ctime(time())\L")
 Py_Finalize()
-
diff --git a/examples/x11ex.nim b/examples/x11ex.nim
index db51df2e0..6c63d0a01 100755
--- a/examples/x11ex.nim
+++ b/examples/x11ex.nim
@@ -5,7 +5,7 @@ const
   WINDOW_HEIGHT = 300
   
 var
-  width, height: int
+  width, height: cuint
   display: PDisplay
   screen: cint
   depth: int
@@ -29,10 +29,10 @@ proc create_window =
                             XBlackPixel(display, screen),
                             XWhitePixel(display, screen))
   size_hints.flags = PSize or PMinSize or PMaxSize
-  size_hints.min_width =  width
-  size_hints.max_width =  width
-  size_hints.min_height = height
-  size_hints.max_height = height
+  size_hints.min_width =  width.cint
+  size_hints.max_width =  width.cint
+  size_hints.min_height = height.cint
+  size_hints.max_height = height.cint
   discard XSetStandardProperties(display, win, "Simple Window", "window",
                          0, nil, 0, addr(size_hints))
   discard XSelectInput(display, win, ButtonPressMask or KeyPressMask or 
@@ -51,7 +51,7 @@ proc process_event =
   case int(xev.theType)
   of KeyPress:
     key = XLookupKeysym(cast[ptr TXKeyEvent](addr(xev)), 0)
-    if key != 0:
+    if key.int != 0:
       echo("keyboard event")
   of ButtonPressMask, PointerMotionMask:
     Echo("Mouse event")