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
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FBGUI library for windows 2

Post by MrSwiss »

BasicCoder2 wrote:What is a dll.a file?
I've already answered that, in one of Gabea's threads:
it's a dll's import library ... where the SQL stuff, was explained, also!
(maybe you remember the thread name, to search for it)
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBGUI library for windows 2

Post by BasicCoder2 »

The forum search facility isn't very good however with a google search I found it.
http://freebasic.net/forum/viewtopic.ph ... 9&start=15
*.dll.a (export library, of a dynamic lib) -- you need (to download) the *.dll also!
*.a (library itself, for static linking)

One reason I didn't remember it is because I can't relate it to anything else I know.

Saying it's a dll's import library leaves me wondering what an import library is. Is that a file included with your own file as in #include or the word import used to include a file in Java or Python? I imagined them as being like a FreeBasic .bi file

Really it seems you need to know all the goings on behind the scenes and the jargon used to describe it.

Unfortunately I will again eventually forget what it means as I have no use for the information but perhaps in future I should just refer to my other memory, a google search, when I need something explained.
.
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Post by VANYA »

Hi All!
Function GetSystemDir return:
32bit app on 32bit system: ..\System32
32bit app on 64bit system: ..\System32 (Wouldn't it be better if returned ..\SysWOW64?)
window9 - 32-bit library and does not know anything about 64-bit system, as any 32-bit application. Any function window9 in 64-bit system (using 32-bit compilier ) will behave the way she would behave in 32-bit system.
What is a dll.a file?
I will not overload you with technical data, but simply ask for a practical task:

1) Create a file 1.bas and compile it as 1.dll (For compilation: fbc -s gui -dll -export 1.bas):

Code: Select all

Function AA Alias "AA" () As Integer Export
    Return 25
End Function
There should be files in the folder:
1.dll
lib1.dll.a
2) Create another file 2.bas in the same folder and compile it as a console application:

Code: Select all

Declare Function AA Lib "1.dll" Alias "AA"() As Integer


? AA()

sleep
Compiled?

3) Now rename the file lib1.dll.a And try to compile 2.bas again

Not Compiled?

4) Return the name to lib1.dll.a In the initial state. Also rename the file 1.dll And try to compile again 2.bas

Compiled? Try running 2.exe. Does not start? Return the name to its original state for 1.dll And run 2.exe. Running? Now remove lib1.dll.a and run 2.exe. Running?

I hope this little test will help understand what the file is for lib1.dll.a

It was a static linking. There is also a dynamic linking (using DylibLoad, DylibSymbol). With dynamic linking, the file lib1.dll.a is not needed.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBGUI library for windows 2

Post by BasicCoder2 »

Such a long time since I last used the command prompt!!
I used to use it to enter and run assembler programs with DEBUG on the old DOS machines.
I have been using FBIDE.
Anyway I changed the directory to where the file was with cd and typed,
C:\FreeBasic\dllDemo>fbc -s gui -dll -export 1.bas
'fbc' is not recognized as an internal or external command,
operable program or batch file.

I assume here I have to set the path in Windows10 somehow.
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Post by VANYA »

BasicCoder2 wrote:Such a long time since I last used the command prompt!!
I used to use it to enter and run assembler programs with DEBUG on the old DOS machines.
I have been using FBIDE.
Anyway I changed the directory to where the file was with cd and typed,
C:\FreeBasic\dllDemo>fbc -s gui -dll -export 1.bas
'fbc' is not recognized as an internal or external command,
operable program or batch file.

I assume here I have to set the path in Windows10 somehow.
Specify the full path to fbc. If the compiler is located in a folder "C:\Compilier" , then type for creating DLL:

C:\Compilier\fbc -s gui -dll -export 1.bas

For the console application:

C:\Compilier\fbc -s console 2.bas

P.S. I do not have the right to advise the select editor choice, but nevertheless, to create more complex programs, go to the editor FBEDIT. Very quickly you will understand how easy it is with the help of FBEDIT compile any program, library, etc.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FBGUI library for windows 2

Post by MrSwiss »

BasicCoder2, if you are trying to *get into Libraries*, I'd suggest to start with:
STATIC LIB's (because, they're less complex than their *dynamic* counterparts).

I've written a Step by Step Tutorial, which is supposed to help *getting a start*.
You might later want to look at my: Color by Percent (static Lib), as well as:
D.J.Peters: FBImage (static lib) ... to further see, how its done (and used).

Only after understanding all the STATIC stuff, move on to DYNAMIC (.dll WIN/.so LIN).
Reason: you'll need to get yourself a BASE, of information on libraries, first ...
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBGUI library for windows 2

Post by BasicCoder2 »

@VANYA,
In Environmental Variables I get two boxes,
User variables for Jack and system variables.
Choosing Path in either box pops up an edit box with two text boxes.
Variable name:
Variable value:
No idea what variable they are talking about or which is the path name.
In the past I just remember selecting path and scrolling to the end and adding the directory path between two semi colons.
I notice Python has entered its own path automatically when installed.
.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBGUI library for windows 2

Post by BasicCoder2 »

MrSwiss wrote:BasicCoder2, if you are trying to *get into Libraries*,
Not really but thanks for pointing out where to go should I have the need.
It was really a matter of getting other people's code to work or how to use other people's code. I would have been happier if FB allowed easy use of other people's code with a simple import statement but it is what it is.
The reason I use FreeBASIC is because I used BASIC on the old machines but FB is limited when it comes to easy use of other people's code when you don't understand all these settings and for people like myself Python seems a better choice when it comes to using other people's code so I am learning that also.
Most of the users on this forum seem to be advanced in this stuff but for me BASIC used to be simple to use.
.
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Post by VANYA »

BasicCoder2 wrote:@VANYA,
In Environmental Variables I get two boxes,
User variables for Jack and system variables.
Choosing Path in either box pops up an edit box with two text boxes.
Variable name:
Variable value:
No idea what variable they are talking about or which is the path name.
In the past I just remember selecting path and scrolling to the end and adding the directory path between two semi colons.
I notice Python has entered its own path automatically when installed.
.
If you want to add the path to the compiler in "System Environmental Variables", then just add it to a variable "PATH" at the end of via ";"
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBGUI library for windows 2

Post by BasicCoder2 »

VANYA wrote:If you want to add the path to the compiler in "System Environmental Variables", then just add it to a variable "PATH" at the end of via ";"
It will not let me do that. It just pops up the box with the two text boxes demanding a variable name and value.
Never does a text box appear with paths separated by semi colons to insert another path.
Thanks for your efforts but I think I will just forget about it.
.
VANYA
Posts: 1837
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Post by VANYA »

BasicCoder2 wrote:
VANYA wrote:If you want to add the path to the compiler in "System Environmental Variables", then just add it to a variable "PATH" at the end of via ";"
It will not let me do that. It just pops up the box with the two text boxes demanding a variable name and value.
Never does a text box appear with paths separated by semi colons to insert another path.
Thanks for your efforts but I think I will just forget about it.
.
You seem to be trying to create a new variable... Just select the line with the mouse with the variable "PATH" And click edit. After you add through ";" your path to the compiler. If you do not have this variable, then create it. Either run "Environmental Variables" under the administrator and edit "PATH"
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FBGUI library for windows 2

Post by St_W »

BasicCoder2 wrote:It will not let me do that. It just pops up the box with the two text boxes demanding a variable name and value.
Never does a text box appear with paths separated by semi colons to insert another path.
Thanks for your efforts but I think I will just forget about it.
If you're using Win10 you can simply add the new path, otherwise you have to edit the textbox. See also https://www.ghacks.net/2015/09/22/micro ... -10-build/
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBGUI library for windows 2

Post by BasicCoder2 »

@VANYA and St_W
Your persistence in helping motivated me to play with it some more this morning (I think best in the mornings) resulting in success!!
Thanks you all for your time.
.
chris319
Posts: 119
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Post by chris319 »

I see 46 pages of discussion on this library. Is it ready to go or is it a work in progress? How about the documentation?
enform
Posts: 185
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for windows 2

Post by enform »

It is ready to go since 2011 ... the chm doc is great with all the examples
go to sourceforge and search for window9 , for the pleasure of coding Windows in simple Basic language. ;-)

Example of code ( using Type is not an obligation ) :

Code: Select all

    ' Test1
 
#Include Once "window9.bi"
 
Type hd0
	hwnd_0 As HWND
	Declare Function OpenWindow_0() As HWND
	Declare Sub Sub_Butt1( )  '  Button  :  Button1
	Declare Sub Sub_Combo3( )  '  ComboBox  :  
End Type
 
' Dim
	Dim hdl0 As hd0
' End Dim
 
' code hd0
 
Function hd0.OpenWindow_0() As HWND
	hwnd_0 = OpenWindow("Win0",10,10,500,300)
	WindowColor(hwnd_0,BGR(240,240,240))
	SetGadgetFont(,CInt(LoadFont("Tahoma",10)))
	UseGadgetList(hwnd_0)
	ButtonGadget(1,10,10,70,20,"Button1")
	SetGadgetFont(1,CInt(LoadFont("Tahoma",9)))
 
	CheckBoxGadget(2,10,40,70,20,"Chk2")
	SetGadgetFont(2,CInt(LoadFont("Tahoma",9)))
	SetGadgetColor(2,BGR(220,220,220),BGR(0,0,0),3)
	
	ComboBoxGadget(3,10,70,70,20)
	SetGadgetColor(3,BGR(220,220,220),BGR(0,0,0),3)
	SetGadgetFont(3,CInt(LoadFont("Tahoma",9)))
	SendMessage(GadgetID(3),CB_SETHORIZONTALEXTENT,1200,0)
	
	OptionGadget(4,10,102,70,20,"Opt4")
	SetGadgetColor(4,BGR(220,220,220),BGR(0,0,0),3)
	
 
	Return hwnd_0
End Function
 
hdl0.hwnd_0 = hdl0.OpenWindow_0()
 
 
Sub hd0.Sub_Butt1( )  '  Button  :  Button1
	' Static As Long
	' Static As	
 
End Sub 
 
Sub hd0.Sub_Combo3( )  '  ComboBox  :  
	' Static As Long
	' Static As	
 
End Sub 
 
' endcode hd0
 
 
' code MAIN
' endcode MAIN
 
Do
	Var event = WaitEvent
	Select Case event
		Case WM_SIZE
		Case EventClose
			Exit Do     ' End
		Case EventMenu
			Select Case EventNumber
				Case 1000
			End Select
		Case EventGadget
			Select Case EventNumber
				Case 1      '  Button : Button1
					hdl0.Sub_Butt1( ) 
				Case 3      '  ComboBox : 
					hdl0.Sub_Combo3( ) 
			End Select
			Select Case EventNumberToolBar
				Case 9999
			End Select
	End Select
Loop
'


Post Reply