wxWidgets for FreeBASIC?
Re: wxWidgets for FreeBASIC?
That is cool! I will check IUP out, thanks for the suggestion :)
Re: wxWidgets for FreeBASIC?
I also looked at the wxwidgets bindings. It's indead an older version, unfortunately.
Re: wxWidgets for FreeBASIC?
I cannot compile any of the examples for IUP :-/
Code: Select all
E:\Projects\FreeBASIC\IUP>fbc textbox.bas
C:\PROGRA~2\FREEBA~1\bin\win32\ld.exe: cannot find -liup
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: wxWidgets for FreeBASIC?
I`m sure you can compile all FreeBASIC FLTK-c examples :-)TheDcoder wrote:I cannot compile any of the examples for IUP :-/
Joshy
Re: wxWidgets for FreeBASIC?
Regarding GUI libs available for FB (on Linux):
1. I cannot get IUP to work shipped with FBC 1.05. Probably the bindings contain errors. When trying to compile the example file buttons.bas I get the following output:
3. wxwidgets has old bindings and may also be too complex.
4. GTK seems the best choice: it integrates natively on GTK-based desktops, but also looks good on KDE (Qt). It may not be the easiest choice for GUI programming in FB, although I believe that's open for debate. Example code written in C can be translated to FB without much effort.
1. I cannot get IUP to work shipped with FBC 1.05. Probably the bindings contain errors. When trying to compile the example file buttons.bas I get the following output:
2. FLTK doesn't seem to honor the system's theme and renders controls in a very basic gtk1-like manner. Not very attractive.fbc -w all "buttons.bas"
buttons.bas(30) warning 3(1): Passing different pointer types, at parameter 2 of IUPSETFUNCTION()
buttons.bas(31) warning 3(1): Passing different pointer types, at parameter 2 of IUPSETFUNCTION()
ld: cannot find -liup
ld: cannot find -lpangox-1.0
3. wxwidgets has old bindings and may also be too complex.
4. GTK seems the best choice: it integrates natively on GTK-based desktops, but also looks good on KDE (Qt). It may not be the easiest choice for GUI programming in FB, although I believe that's open for debate. Example code written in C can be translated to FB without much effort.
Last edited by Munair on Nov 09, 2017 12:34, edited 1 time in total.
Re: wxWidgets for FreeBASIC?
You need to download IUP, without the libraries it simply can't work.TheDcoder wrote:I cannot compile any of the examples for IUP :-/Code: Select all
E:\Projects\FreeBASIC\IUP>fbc textbox.bas C:\PROGRA~2\FREEBA~1\bin\win32\ld.exe: cannot find -liup
Here are the files: https://sourceforge.net/projects/iup/files/
And here is the documentation of IUP: http://webserver2.tecgraf.puc-rio.br/iup/ (which would have explained that you need to link the iup library on its "Getting Started" page ...)
And please read some documentation about libraries as you don't seem to have much of a clue yet how they work:
https://freebasic.net/wiki/ProPgPrebuiltLibraries
https://freebasic.net/wiki/ProPgSharedLibraries
https://freebasic.net/wiki/ProPgStaticLibraries
1. Do you know the PEBKAC principle? I don't understand why especially beginners tend to blame the compiler or its infrastructure first instead of searching the error in their code. In pratice compiler errors etc. are very unlikely (although they definitely exist) and most of the time it's the user's fault. So don't stay a noob and start learning (see above for some documentation links where you could start). You're facing the same issue as explained above. As you're using Linux: note that libraries are usually installed system-wide, so I'd recommend to do that (alternative: adjust loader path). (on Windows libraries are usually just put into the application folder)Munair wrote:1. I cannot get UIP to work shipped with FBC 1.05. Probably the bindings contain errors. When trying to compile the example file buttons.bas I get the following output:2. FLTK doesn't seem to honor the system's theme and renders controls in a very basic gtk1-like manner. Not very attractive.fbc -w all "buttons.bas"
buttons.bas(30) warning 3(1): Passing different pointer types, at parameter 2 of IUPSETFUNCTION()
buttons.bas(31) warning 3(1): Passing different pointer types, at parameter 2 of IUPSETFUNCTION()
ld: cannot find -liup
ld: cannot find -lpangox-1.0
3. wxwidgets has old bindings and may also be too complex.
4. GTK seems the best choice: it integrates natively on GTK-based desktops, but also looks good on KDE (Qt). It may not be the easiest choice for GUI programming in FB, although I believe that's open for debate. Example code written in C can be translated to FB without much effort.
2. Indeed, because FLTK renders everything itself and doesn't use the system's native APIs.
3. Old bindings: agree; Complex: You will need to learn how to use any GUI library you choose. It won't work well if you don't read documentation of the according library or look at examples/tutorials.
4. GTK is probably a good choice if you target Linux only, because it's either installed by default or easily installable via a package manager. On other platforms like Mac OSX and Windows it has the same problems as FLTK: it feels "alien".
Re: wxWidgets for FreeBASIC?
Despite my recent sign-up to this forum, I'm not a beginner. Regarding the above example, it is straight from a fresh fb-installation with provided include files. I did not write or adjust any code. I just opened the example file and tried to compile it. From the same installation I started coding with GTK, which works perfectly. ;)St_W wrote:1. Do you know the PEBKAC principle? I don't understand why especially beginners tend to blame the compiler or its infrastructure first instead of searching the error in their code.
I'm also not blaming the compiler. I would if I would find a compiler bug. This isn't one. These are third-party bindings and I cannot compile the example because IUPSETFUNCTION() apparently expects a different pointer type. Off course, I could start hacking around to solve the problem, but I prefer to spend my time writing a GUI for Linux using GTK.
Re: wxWidgets for FreeBASIC?
This is only, because you are on Linux (see: St_W, point 4 above).Munair wrote:From the same installation I started coding with GTK, which works perfectly. ;)
On Win you'll have the same issues, as with FLTK (headers, but no lib's.).
Re: wxWidgets for FreeBASIC?
No, I got FLTK to work as well, although I had some problems installing the library files correctly at first.MrSwiss wrote:This is only, because you are on Linux (see: St_W, point 4 above).Munair wrote:From the same installation I started coding with GTK, which works perfectly. ;)
On Win you'll have the same issues, as with FLTK (headers, but no lib's.).
The two errors regarding different pointer types apply to these two lines in the example file buttons.bas:
Code: Select all
IupSetFunction( "ok_act", @ok_onclick )
IupSetFunction( "close_act", @close_onclick )
Re: wxWidgets for FreeBASIC?
As already stated (at the beginning of thread), the whole wxWigets thingy is quite old ...Munair wrote:These errors are related to binding definitions.
Re: wxWidgets for FreeBASIC?
After a quick peak, the pointer type problem may be resolved when the iup library is installed, but I'm not sure about it. In the include files I found:
but I cannot get the definition for Ihandle_
Code: Select all
type Ihandle as Ihandle_
type Icallback as function(byval as Ihandle ptr) as long
IupSetFunction(byval name as const zstring ptr, byval func as Icallback) as Icallback
Re: wxWidgets for FreeBASIC?
I was referring to IUP, not wxwidgets...MrSwiss wrote:As already stated (at the beginning of thread), the whole wxWigets thingy is quite old ...Munair wrote:These errors are related to binding definitions.
Re: wxWidgets for FreeBASIC?
Btw: this thread is about wxWigets ...Munair wrote:I was referring to IUP, not wxwidgets... same differenceMrSwiss wrote:As already stated (at the beginning of thread), the whole wxWigets thingy is quite old ...
Re: wxWidgets for FreeBASIC?
Yes, because you seem to have installed the GTK libraries already. Of course you need to do the same thing with the IUP library/libraries. Just like you did with FLTK (the only difference is that you can use the official libraries directly and do not need wrapper libraries as for FLTK or wxWidgets). If you're not a beginner you actually should know that as it's the same as with C/C++ (= the programming languages Linux, Windows, etc. are built upon). In fact FB just uses GNU ld, the same linker that is used for linking C applications, and what you see is it's output:Munair wrote:Regarding the above example, it is straight from a fresh fb-installation with provided include files. I did not write or adjust any code. I just opened the example file and tried to compile it. From the same installation I started coding with GTK, which works perfectly.
ld: cannot find -liup
ld: cannot find -lpangox-1.0
It clearly tells you that it can't find libraries "iup" and "pangox-1.0" (libraries are specified with "-l" on the linker command line). So you either haven't installed them at all, or in some location that the linker cannot find (see https://freebasic.net/wiki/CompilerOptp) or the library file is invalid (e.g. if you are providing a 32-bit library when compiling a 64-bit application).
These are definitely not good, especially in an example, but they are only warnings, not errors. The application will compile just fine with warnings only. Nevertheless it's something that should be fixed (probably in the example code, but I haven't take a look yet).Munair wrote:The two errors regarding different pointer types apply to these two lines in the example file buttons.bas:These errors are related to binding definitions.Code: Select all
IupSetFunction( "ok_act", @ok_onclick ) IupSetFunction( "close_act", @close_onclick )
//edit: just had a quick look at the warnings: the callback functions "ok_onclick" and "close_onclick" should return a "long" instead of an "integer". That is a slight error in the example; it seems they haven't been fully adapted for 64-bit support. Nevertheless the application should work even without fixing that. To fix it just replace the return type "... as integer" by "... as long".
Btw. compiler warnings (or errors) are independent from a library file, as this is used during linking, not during compilation.
Re: wxWidgets for FreeBASIC?
Because I got the warnings (yes they are not errors), I did not try to install the libraries. I may do that at a later time. I feel comfortable with the fact that the FB gtk bindings work correctly with the libraries that come with my Debian distro.
I agree with MrSwiss that this thread is about wxwidgets, although viewpoints with other GUI solutions may be of benefit.
I agree with MrSwiss that this thread is about wxwidgets, although viewpoints with other GUI solutions may be of benefit.