newt-freebasic header
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
newt-freebasic header
i created a github repo for newt.bi header file of newt.
The newt windowing system is a terminal-based window and widget library designed for writing applications with a simple, but user-friendly, interface.
https://userswww.pd.infn.it/~saccarol/tutorial.html
https://github.com/demosthenesk/newt-freebasic
this work is made with the SARG's help, thanks pal!
The newt windowing system is a terminal-based window and widget library designed for writing applications with a simple, but user-friendly, interface.
https://userswww.pd.infn.it/~saccarol/tutorial.html
https://github.com/demosthenesk/newt-freebasic
this work is made with the SARG's help, thanks pal!
Re: newt-freebasic header
hello, I recompiled the source code of Newt :
https://en.wikipedia.org/wiki/Newt_(pro ... g_library)
modified configure to compile with -Os optimization, disable python and tcl support (--without-python --without-tcl). i get :
libnewt.a size 617,0 Kio
libnewt.so size 343,3 Kio
with the command :
strip -s libnewt.a
strip -s libnewt.so
(man strip for more information), i get :
libnewt.a size 60,8 Kio
libnewt.so size 79,8 Kio
all examples work. great job. thanks.
https://en.wikipedia.org/wiki/Newt_(pro ... g_library)
modified configure to compile with -Os optimization, disable python and tcl support (--without-python --without-tcl). i get :
libnewt.a size 617,0 Kio
libnewt.so size 343,3 Kio
with the command :
strip -s libnewt.a
strip -s libnewt.so
(man strip for more information), i get :
libnewt.a size 60,8 Kio
libnewt.so size 79,8 Kio
all examples work. great job. thanks.
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
nice... you are welcomed !!!Coolman wrote: ↑Oct 03, 2022 11:17 hello, I recompiled the source code of Newt :
https://en.wikipedia.org/wiki/Newt_(pro ... g_library)
modified configure to compile with -Os optimization, disable python and tcl support (--without-python --without-tcl). i get :
libnewt.a size 617,0 Kio
libnewt.so size 343,3 Kio
with the command :
strip -s libnewt.a
strip -s libnewt.so
(man strip for more information), i get :
libnewt.a size 60,8 Kio
libnewt.so size 79,8 Kio
all examples work. great job. thanks.
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
Together with SARG, we try to bring libnewt.a port to windows.
So far i compiled the libnewt.a with cygwin for win64 with success
We try the examples and we got errors from ld.exe for undefined reference
the functions wcwidth and nanosleep are functions of crt libc which is not implemented in FreeBasic crt
i tried to use libc.a from windows cygwin64 with no success.
Is there any way to overcome these errors ?
Here are the files with libs and examples to try to compile for your self...notice these files are for win64 only so far.
https://drive.google.com/file/d/1z23MNq ... p=drivesdk
So far i compiled the libnewt.a with cygwin for win64 with success
We try the examples and we got errors from ld.exe for undefined reference
Code: Select all
Compile File: W:/WORKSPACES/FreeBasic/newt/newt-freebasic-main/win64/test1.bas......
"c:/users/user/bin/freebasic-1.09.0-win64/fbc.exe" -b "W:/WORKSPACES/FreeBasic/newt/newt-freebasic-main/win64/test1.bas"
c:\users\user\bin\freebasic-1.09.0-win64\bin\win64\ld.exe: ./libnewt.a(newt.o):newt.c:(.text+0x8ae): undefined reference to `wcwidth'
c:\users\user\bin\freebasic-1.09.0-win64\bin\win64\ld.exe: ./libnewt.a(newt.o):newt.c:(.text+0x95e): undefined reference to `wcwidth'
c:\users\user\bin\freebasic-1.09.0-win64\bin\win64\ld.exe: ./libnewt.a(newt.o):newt.c:(.text+0x1b63): undefined reference to `nanosleep'
Compile Error!
i tried to use libc.a from windows cygwin64 with no success.
Is there any way to overcome these errors ?
Here are the files with libs and examples to try to compile for your self...notice these files are for win64 only so far.
https://drive.google.com/file/d/1z23MNq ... p=drivesdk
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
news:
we eliminate the errors of ld by #inclib "cygwin1" (cygwin1.dll)
the fbc1.09 and fbc1.10 for win64 compiles the code with success.
Unfortunately when we try to run the example it gives no screen just go back to cmd line.
we eliminate the errors of ld by #inclib "cygwin1" (cygwin1.dll)
the fbc1.09 and fbc1.10 for win64 compiles the code with success.
Unfortunately when we try to run the example it gives no screen just go back to cmd line.
Re: newt-freebasic header
Bear in mind that newt requires some kind of terminal to interpret its commands. Anything built under cygwin assumes a Unix-style terminal, VT100 is the default. If you run it from a windows console window (with cmd.exe) you may not get much. The Windows console is very limited. Try running it under a proper vt100 terminal emulator, or the new Windows Terminal app.
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
the terminal is not the problem.caseih wrote: ↑Oct 03, 2022 23:51 Bear in mind that newt requires some kind of terminal to interpret its commands. Anything built under cygwin assumes a Unix-style terminal, VT100 is the default. If you run it from a windows console window (with cmd.exe) you may not get much. The Windows console is very limited. Try running it under a proper vt100 terminal emulator, or the new Windows Terminal app.
cygwin compiled also c examples of newt which they run in cmd and in cygwin terminal successfuly.
here is a screenshot of a c example of newt
Re: newt-freebasic header
I tried on Linux x86-64. The first tests look very good. Thank you!
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
news:
angros47 ported the c examples of newt to freebasic
test, testgrid, testtree
check these out !!!
https://github.com/demosthenesk/newt-freebasic
angros47 ported the c examples of newt to freebasic
test, testgrid, testtree
check these out !!!
https://github.com/demosthenesk/newt-freebasic
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
newt is based on s-lang.
In cygwin there is a package for s-lang-dev and newt is compiled successfully.
Unfortunately cygwin dlls are not cooperative with freebasic and examples are crashed with segmentation fault!
So i want to try another solution. I will try to compile newt with mingw in Msys2 enviroment.
For this reason i nee to compile also s-lang for Msys2. I tried to do that and i get make errors.
So i open a ticket to Msys2 packages at Github to package s-lang as Msys2 mingw package.
https://github.com/msys2/MINGW-packages ... ions/13394
In cygwin there is a package for s-lang-dev and newt is compiled successfully.
Unfortunately cygwin dlls are not cooperative with freebasic and examples are crashed with segmentation fault!
So i want to try another solution. I will try to compile newt with mingw in Msys2 enviroment.
For this reason i nee to compile also s-lang for Msys2. I tried to do that and i get make errors.
So i open a ticket to Msys2 packages at Github to package s-lang as Msys2 mingw package.
https://github.com/msys2/MINGW-packages ... ions/13394
Re: newt-freebasic header
Been a long time since I worked with cygwin. Kind of tickles something in the back of my head, though. Could this be a conflict between the MSVCRT dll that mingw links against and the C runtime library that cygwin uses? Since cygwin adds a whole posix emulation layer to the C runtime library, I suspect there will be conflicts when linking against code compiled and linked with mingw. Although I thought the posix stuff was in cygwin1.dll.
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
i compiled newt in cygwin with gcc not mingw.caseih wrote: ↑Oct 05, 2022 21:14 Been a long time since I worked with cygwin. Kind of tickles something in the back of my head, though. Could this be a conflict between the MSVCRT dll that mingw links against and the C runtime library that cygwin uses? Since cygwin adds a whole posix emulation layer to the C runtime library, I suspect there will be conflicts when linking against code compiled and linked with mingw. Although I thought the posix stuff was in cygwin1.dll.
i tried to compile s-lang with mingw in Msys2 enviroment and it gives error of make file.
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
Now https://github.com/demosthenesk/newt-freebasic has a README.md file!
-
- Posts: 237
- Joined: Jul 15, 2021 7:23
- Location: Greece
- Contact:
Re: newt-freebasic header
i try to write an example with a callback but it does not work.
i want to click the ok button and clear the screen and a text be written on screen.
Any help?
i want to click the ok button and clear the screen and a text be written on screen.
Any help?
Code: Select all
#Ifndef NULL
#Define NULL 0
#Endif
#inclib "newt"
#include "newt.bi"
dim form as newtComponent
dim b1 as newtComponent
dim b2 as newtComponent
dim p as any Ptr
sub fCallback(co as newtComponent, data_ as any ptr)
newtCls()
newtDrawRootText(0, 0, strptr("I am in callback!"))
newtRefresh()
end sub
newtInit()
newtCls()
newtOpenWindow(10, 5, 40, 6, "Button Sample")
b1 = newtButton(10, 1, "Ok")
newtComponentAddCallback(b1, @fCallback, @p)
b2 = newtCompactButton(22, 2, "Cancel")
form = newtForm(NULL, NULL, 0)
newtFormAddComponents(form, b1, b2, NULL)
newtRunForm(form)
sleep
newtFormDestroy(form)
newtFinished()