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
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by demosthenesk »

i try to compile libwindow9.a for Debian but no success

1) fbc _createbuildMakefile.bas
2) _createbuildMakefile is created
3) ./_createbuildMakefile
4) nothing happens no libwindow9.a
5) tmp/ is empty

--------
ok...it creates a makefile but when i run makefile i get
...
./makefile: line 1006: tmp/window9.o:: No such file or directory

for all files
----------
an investigation i did i found that name of files are not correct in linux,
the names are like this 'Write_Word.o'$'\r'
how to remove ' '$\r' from files?
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: GUI library for Windows \ Linux (window9)

Post by RNBW »

Hi Vanya
I hope you are keeping well.
I've just bought a Windows tablet and installed Window9 on it. Tried running some code which runs quite succesfully on my laptop, but I get the error message on the tablet:
"C:\....\bin\win64\ld.exe: cannot find -lz"
I'm pretty sure I've been here before. Can you help?
*********
TOPIC EDIT:
Managed to resolve the problem from an earlier topic. I thought I'd had the problem previously.
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by VANYA »

Hi RNBW!
I hope you are keeping well.
Thanks, seems fine so far.
Managed to resolve the problem from an earlier topic
Ok.
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by VANYA »

Update library.

Fixed functions:
--FastCRC32 (ARM support)
--FastCopy (ARM support)
--LoadImageFromResource (loading errors with color and unnecessary memory release)
--LoadImageFromResourceA (loading errors with color and unnecessary memory release)
--Size_File (large size support)
--Config function mechanism (the group was lost when saving)
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: GUI library for Windows \ Linux (window9)

Post by RNBW »

Hi Vanya

Thank you for the update. I've not checked it out yet, but I note there is no change to either the Russian or English .CHM Help Files.

Are any necessary? If there are could you advise and I will update the English version.
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by VANYA »

Hi RNBW!

Help updates are not required with this update. Thank you!
Tonigau
Posts: 36
Joined: Feb 25, 2021 20:19

Re: GUI library for Windows \ Linux (window9)

Post by Tonigau »

I have a program where I need to restore checkbox gadgets state from a settings.ini file & also after window resize event. I was puzzled for a while why my code was failing to update the check box states thinking my settings array was empty at that point.
After some tests it was noticed the second parameter of SetGadgetState will only accept absolute value & not a boolean var.
I have only tested with CheckBoxGadget.
I can workaround this as can see in example below.

OS=Win7x64p

Code: Select all

'Testing  SetGadgetstate with bit var.   2023-12-17         ToniG
' It seems the state parameter does not accept a boolean variable

#Include "window9.bi"
Dim As Boolean TempBit
Dim Shared As HWND hwnd
Dim As Integer event

hwnd=OpenWindow("SetGadgetState",10,10,500,150) : CenterWindow(hwnd)

      CheckBoxGadget(1,30,25,46,10,"ch1")
      CheckBoxGadget(2,30,55,46,10,"ch2")
      CheckBoxGadget(3,30,75,46,10,"ch3")
      
      TempBit = 1	
      SetGadgetState(1, TempBit)      '< Not Works
      SetGadgetState(2, 1)            '< Works
      
      ' TempBit = 0
      'WorkAround...  
      If TempBit = TRUE Then SetGadgetState(3, 1) : Else  SetGadgetstate(3, 0) : EndIf     '< Works 
	

       Do
            event=WindowEvent()
         Select Case event

            Case EventClose
                If Event=EventClose Then End   
            
            Case EventGadget
            Select Case EventNumber() 
               Case 1
             '    SetCh_State(1)
               Case 2
             '    SetCh_State(2)
      
            End Select
         End Select 
      
      Loop
SARG
Posts: 1787
Joined: May 27, 2005 7:15
Location: FRANCE

Re: GUI library for Windows \ Linux (window9)

Post by SARG »

Just because for a boolean true (<>0 or <>false) the provided value is -1 so the value of tempbit is in fact -1 not 1.

Not a good idea to use boolean like this :-)


excerpt of doc :
- Therefore when assigning a boolean with an integer value (by implicit conversion and not with the False or True value), '0' induces the False state and '1' or '-1' induces the True state (any other value also induces the True state, but with a warning message).
- Otherwise when assigning a numeric type with a boolean (by implicit conversion), False induces the '0' value and True induces the '-1' value.

Edit: you can use

Code: Select all

SetGadgetState(1, iif (TempBit=true,1,0))
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: GUI library for Windows \ Linux (window9)

Post by oyster »

why the window title is not corrected?

for the simple code, the window title is not "Hello", but "效汬o" on my Simplified Chinese Windows 10 64 bits even I am using "window9\Bin\Win64\UNICODE\libwindow9.a"

Code: Select all

#Include "window9.bi"

Dim As Integer event

Dim as HWND hwnd

hwnd=OpenWindow("Hello",10,10,320,250) : CenterWindow(hwnd)


Do
   event=WindowEvent()
   If Event=EventClose Then End
Loop 

SARG
Posts: 1787
Joined: May 27, 2005 7:15
Location: FRANCE

Re: GUI library for Windows \ Linux (window9)

Post by SARG »

Not sure it fixes the issue but try to uncomment the line below in window9.bi

Code: Select all

'#Define UNICODE
As there are these codes after

Code: Select all

	#ifdef UNICODE		
		#Include Once "extwstring.bi"		
		type USTRING as extWstring		
	#else		
		type USTRING as string		
	#EndIf

Code: Select all

Declare Function OpenWindow(ByRef sName As USTRING, _
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: GUI library for Windows \ Linux (window9)

Post by oyster »

SARG wrote: Dec 26, 2023 10:55 Not sure it fixes the issue but try to uncomment the line below in window9.bi

Code: Select all

'#Define UNICODE
No, nothing changes even I uncomment it

FreeBASIC-1.10.1-win64/fbc.exe -s gui test1.bas
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by VANYA »

SARG wrote everything correctly.

If doesn't work for you, then you may be doing something wrong.

Try removing all window9 library files from the compiler folder.
Then copy all the necessary files to the compiler folder, but in the window9.bi file uncomment the line

Code: Select all

 '#Define UNICODE
You can also try to rebuild the library on your system, but do not forget to uncomment the line in the window9.bi file before building

Code: Select all

 '#Define UNICODE
P.S. SARG thank you for your user support!
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: GUI library for Windows \ Linux (window9)

Post by oyster »

No, it does not work for pre-complied library. This is my steps

1. download FreeBASIC-1.10.1-winlibs-gcc-9.3.0.7z from https://github.com/freebasic/fbc/releases/tag/1.10.1, and decompress

2. download window9.zip from https://sourceforge.net/projects/guiwin ... 023-03-06/

3. copy window9.zip\window9\Bin\Win64\UNICODE\libwindow9.a into C:\tmp\FreeBASIC-1.10.1-winlibs-gcc-9.3.0\lib\win64\

4. copy the following include files into C:\tmp\FreeBASIC-1.10.1-winlibs-gcc-9.3.0\inc\ and I allow to overwrite original zlib.bi
window9.zip\window9\include\window9.bi
window9.zip\window9\include\extwstring.bi
window9.zip\window9\include\zlib.bi

5. modify c:\tmp\FreeBASIC-1.10.1-winlibs-gcc-9.3.0\inc\window9.bi . i.e. uncomment

Code: Select all

'#Define UNICODE
and get

Code: Select all

#Define UNICODE
6. download libz.a as viewtopic.php?p=291193#p291193 says and put it in c:\tmp\FreeBASIC-1.10.1-winlibs-gcc-9.3.0\lib\win64\libz.a
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: GUI library for Windows \ Linux (window9)

Post by oyster »

I uncomment the line in the window9.bi, then I re-build libwindow9.a. Now the title is right.
So I suspect that window9.zip\window9\Bin\Win64\UNICODE\libwindow9.a from https://sourceforge.net/projects/guiwin ... 023-03-06/ is built without the UNICODE definition

Code: Select all

'#Define UNICODE
VANYA
Posts: 1839
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: GUI library for Windows \ Linux (window9)

Post by VANYA »

No, it does not work for pre-complied library. This is my steps
It's all strange... I just checked, everything is working correctly on my side. Why are you using an old version of the library? But even the old version (the one you indicated) is built with Unicode support. Compare the sizes of the compiled versions of libwindow9.a for ASCII and UNICODE. The UNICODE version is always larger than ASCII. Anyway, I followed the same steps you provided on a Win10 64-it system and UNICODE is displayed.
Post Reply