GUI library for Windows \ Linux (window9)

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
VANYA
Posts: 1850
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by VANYA »

Update:

A very small but useful fix. Previously, there was no navigation to gadgets (use the TAB key) that are disabled. Everything should be fine now.
demosthenesk
Posts: 293
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by demosthenesk »

Hello i think i came across a bug:

Code: Select all

#Include "window9.bi"


#Ifdef __FB_WIN32__
  Var h = 80
#Else
  Var h = 30
#EndIf


OpenWindow("",10,10,300,100)


ComboBoxGadget(1,10,10,100,h)
AddComboBoxItem(1,"Hello0",-1)
AddComboBoxItem(1,"Hello1",-1)
AddComboBoxItem(1,"Hello2",-1)
ButtonGadget(2,150,10,100,25,"Replace")


Do
   var event=WaitEvent()
   If event=eventclose Then End
   If event=eventgadget Then
      If eventnumber()=2 Then
         SetComboBoxItemText(1,"New Text",1)
      EndIf
   EndIf
Loop
i get errors:
Building Project: SetComboBoxItemText......

c:/users/demos/bin/freebasic-1.10.1-winlibs-gcc-9.3.0/fbc64.exe -x "SetComboBoxItemText.exe" -m "SetComboBoxItemText" -b "SetComboBoxItemText.bas" -i "C:/Users/demos/Bin/FreeBASIC-1.10.0-winlibs-gcc-9.3.0/inc" -p "C:/Users/demos/Bin/FreeBASIC-1.10.0-winlibs-gcc-9.3.0/lib/win64" -s gui

C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(23) error 4: Duplicated definition, __STRINGIFY in '#define __STRINGIFY(x) #x'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(24) error 4: Duplicated definition, __MINGW64_STRINGIFY in '#define __MINGW64_STRINGIFY(x) __STRINGIFY(x)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(38) error 4: Duplicated definition, __MINGW_IMP_SYMBOL in '#define __MINGW_IMP_SYMBOL(sym) _imp__##sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(39) error 4: Duplicated definition, __MINGW_IMP_LSYMBOL in '#define __MINGW_IMP_LSYMBOL(sym) __imp__##sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(40) error 4: Duplicated definition, __MINGW_USYMBOL in '#define __MINGW_USYMBOL(sym) _##sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(41) error 4: Duplicated definition, __MINGW_LSYMBOL in '#define __MINGW_LSYMBOL(sym) sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(46) error 4: Duplicated definition, __MSABI_LONG in '#define __MSABI_LONG(x) x##l'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(78) error 4: Duplicated definition, _CRT_INSECURE_DEPRECATE_MEMORY in '#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(79) error 4: Duplicated definition, _CRT_INSECURE_DEPRECATE_GLOBALS in '#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(81) error 4: Duplicated definition, _CRT_OBSOLETE in '#define _CRT_OBSOLETE(_NewItem)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(81) error 133: Too many errors, exiting


Compile Error...
demosthenesk
Posts: 293
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by demosthenesk »

demosthenesk wrote: Aug 13, 2024 7:00 Hello i think i came across a bug:

Code: Select all

#Include "window9.bi"


#Ifdef __FB_WIN32__
  Var h = 80
#Else
  Var h = 30
#EndIf


OpenWindow("",10,10,300,100)


ComboBoxGadget(1,10,10,100,h)
AddComboBoxItem(1,"Hello0",-1)
AddComboBoxItem(1,"Hello1",-1)
AddComboBoxItem(1,"Hello2",-1)
ButtonGadget(2,150,10,100,25,"Replace")


Do
   var event=WaitEvent()
   If event=eventclose Then End
   If event=eventgadget Then
      If eventnumber()=2 Then
         SetComboBoxItemText(1,"New Text",1)
      EndIf
   EndIf
Loop
i get errors:
Building Project: SetComboBoxItemText......

c:/users/demos/bin/freebasic-1.10.1-winlibs-gcc-9.3.0/fbc64.exe -x "SetComboBoxItemText.exe" -m "SetComboBoxItemText" -b "SetComboBoxItemText.bas" -i "C:/Users/demos/Bin/FreeBASIC-1.10.0-winlibs-gcc-9.3.0/inc" -p "C:/Users/demos/Bin/FreeBASIC-1.10.0-winlibs-gcc-9.3.0/lib/win64" -s gui

C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(23) error 4: Duplicated definition, __STRINGIFY in '#define __STRINGIFY(x) #x'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(24) error 4: Duplicated definition, __MINGW64_STRINGIFY in '#define __MINGW64_STRINGIFY(x) __STRINGIFY(x)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(38) error 4: Duplicated definition, __MINGW_IMP_SYMBOL in '#define __MINGW_IMP_SYMBOL(sym) _imp__##sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(39) error 4: Duplicated definition, __MINGW_IMP_LSYMBOL in '#define __MINGW_IMP_LSYMBOL(sym) __imp__##sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(40) error 4: Duplicated definition, __MINGW_USYMBOL in '#define __MINGW_USYMBOL(sym) _##sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(41) error 4: Duplicated definition, __MINGW_LSYMBOL in '#define __MINGW_LSYMBOL(sym) sym'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(46) error 4: Duplicated definition, __MSABI_LONG in '#define __MSABI_LONG(x) x##l'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(78) error 4: Duplicated definition, _CRT_INSECURE_DEPRECATE_MEMORY in '#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(79) error 4: Duplicated definition, _CRT_INSECURE_DEPRECATE_GLOBALS in '#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(81) error 4: Duplicated definition, _CRT_OBSOLETE in '#define _CRT_OBSOLETE(_NewItem)'
C:\Users\demos\Bin\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\inc\win\_mingw.bi(81) error 133: Too many errors, exiting


Compile Error...
well i recreate the project in poseidon and it compiles correctly...
i dont know what it was
softfoot
Posts: 54
Joined: Aug 31, 2020 3:45

Re: GUI library for Windows \ Linux (window9)

Post by softfoot »

Hi, I use "window9" to create fairly simple control programs as GUIs.

I need to create a rather simple terminal emulator within an existing window9 project.

I need a scrollable text pane which I can do nicely using "editText" with "readonly" set.

I also need a single line box for user input that supports simple editing (cursor,insert,home/end) and returns when "enter" is pressed but I am struggling to figure out how to do this in window9.

What is the best way to do this?? perhaps with an example?
Regards,
Dave
Quin
Posts: 6
Joined: Feb 14, 2025 22:11
Location: Colorado, United States
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by Quin »

Hi,
I'm trying to learn how to use this library, coming from a PureBasic background, and struggling to find the latest version of the English help file as a chm file. I got a version from https://www.dropbox.com/s/316dkvxasa0sh ... 9.chm?dl=1, but it says 2022 and is seemingly not the latest. The link in the first post only brings me to a Russian page, with no option visible to my screen reader allowing me to switch the language. Any tips here?
Thanks!
Quin
Posts: 6
Joined: Feb 14, 2025 22:11
Location: Colorado, United States
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by Quin »

Hi again,
I'm also hitting another problem. As I mentioned the only page I could find was Russian, and it seems that the libraries I downloaded didn't work with English texts. I ran build.bat and it worked, but the .a file is under a megabyte and I think it built as ascii. How can I insure it builds as unicode?
Thanks!
SARG
Posts: 1873
Joined: May 27, 2005 7:15
Location: FRANCE

Re: GUI library for Windows \ Linux (window9)

Post by SARG »

Use this link https://sourceforge.net/projects/guiwindow9/files/ to get current version.
The help file exists also in english.

For using UNICODE get the UNICODE version of libwindow9.a in folder window9/Bin/Win64/UNICODE/ from zip file (or Win32 according the bitness).
Then in window9.bi uncomment this line '#Define UNICODE.

I'm a hard user of W9 so feel free to ask more if needed.
Quin
Posts: 6
Joined: Feb 14, 2025 22:11
Location: Colorado, United States
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by Quin »

Hi SARG,
Thanks so much, this worked amazingly!
Also it turns out, I didn't have to rebuilt Window9 at all, I just forgot to #define Unicode at the top of my script :D
Thanks for all your help and support!
Quin
Posts: 6
Joined: Feb 14, 2025 22:11
Location: Colorado, United States
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by Quin »

Thanks to OP for this absolutely amazing library! FreeBASIC with Windows 9 is rapidly becoming my favorite way to make software :)
Slight bug report though, the English documentation's EnumSettingsDisplay function has an extra hyperlink at the top, between the two headings.
Is it possible for users to contribute to the documentation? I imagine I could've very easily fixed this and pushed a pull request or something simlar.
Thanks again for all your great work!
SARG
Posts: 1873
Joined: May 27, 2005 7:15
Location: FRANCE

Re: GUI library for Windows \ Linux (window9)

Post by SARG »

Slight bug report though, the English documentation's EnumSettingsDisplay function has an extra hyperlink at the top, between the two headings.
I don't see it. Can you show exactly where it's.
deltarho[1859]
Posts: 4670
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by deltarho[1859] »

I thought it about time I had a look at window9.

Unfortunately, the installation instructions on this thread's opening page don't make sense nowadays.

Can anyone help on this?
Imortis
Moderator
Posts: 1966
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by Imortis »

The instructions aren't wrong, but they are incomplete. There are now two versions of the .a file for each compiler: one for ascii and one for unicode. I tried to alter the include to pick the correct one when compiling but that didn't work and I'm not sure why. Instead I just took the unicode version of the .a file and dropped it in the appropriate lib folder. I also had to alter the _build.bat to point to my FB install since it assumes FBC is on the path and also that it is just named FBC, where as I have a 32 and 64bit one.

EDIT: Oh, I see. there are no examples in that download. That is just the source to build the library. Well, that worked as it should, then I guess. With the exception of having to alter the _build.bat for my compiler.

EDIT #2: I just realized that probably didn't help you much. My mistake. I took the contents of the inc and lib folders in the zip exactly as is and copy/pasted them into my FBC install. Then I copied the window9.a libs from UNICODE into the lib\win32 and lib\win64 respectively.
SARG
Posts: 1873
Joined: May 27, 2005 7:15
Location: FRANCE

Re: GUI library for Windows \ Linux (window9)

Post by SARG »

@deltarho
What is your problem ? exactly. And on Linux/Windows ?
deltarho[1859]
Posts: 4670
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by deltarho[1859] »

@imortis

There isn't a 'lib folder'.

I managed to use the correct library for Win32 and Unicode, so writing code to cover all four libraries in "window9.bi" should be straight forward. However, the 'z' library could not be found. zlib.bi refers to a lib folder - but there isn't one!.
The instructions aren't wrong
They are in 2025.

I need installation instructions for 2025.

I could probably sort it out, but I shouldn't have to.

I will stay with José Roca's WinFBX Framework. :)

@SARG: Windows
Imortis
Moderator
Posts: 1966
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by Imortis »

deltarho[1859] wrote: Apr 03, 2025 16:48 @imortis
There isn't a 'lib folder'.
...
However, the 'z' library could not be found. zlib.bi refers to a lib folder - but there isn't one!.
My mistake. You are right. The zip forwindow9 doesn't have a "lib" folder. But a quick look around in the zip uncovered the Bin folder with the win32 and win64 folders in it. If you open either of those folders you will find a window9.a file. So I should have said "Bin" and "inc" instead.
Also, the first post contains a link to a forum post with a download for zlib.

Don't get me wrong: I understand dealing with libraries in FB can be a giant pain. I would like to see something done to make it easier. Also, this package could be altered to make it less confusing to use.

Aside from having to place the window9.a file, the directions worked.
Post Reply