wxWidgets for FreeBASIC?

New to FreeBASIC? Post your questions here.
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

wxWidgets for FreeBASIC?

Post by TheDcoder »

Hello,

Getting back to FreeBASIC after a while (2 years?), still a newbie and haven't coded a single thing yet, aside from some hello world kind of things. The main turn off for me is GUI programming.

Cross-platform GUIs mostly look like crap on one platform if they look nice in the other. I found that wxWidgets would be somewhat better at this because "wxWidgets gives applications a truly native look and feel because it uses the platform's native API rather than emulating the GUI".

So my question, is there a binding/library/header that someone made in FreeBASIC which wraps wxWidgets? Or is it impossible to do that in FB?

Thanks in Advance!
Imortis
Moderator
Posts: 1926
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: wxWidgets for FreeBASIC?

Post by Imortis »

The 32bit version of FBC comes with headers for wx-c, the C wrapper of wxWidgets. The 64bit version does not have headers yet.
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

Oh nice, I will check the 32-bit version of FB.

Is it a coincidence that I found this while searching for wxC?
a visual wx-c developer tool written in freeBasic with the wx-c wrapper to wxWidgets. the software will allow a visual approach to generating gui applications in freeBasic code.
Imortis
Moderator
Posts: 1926
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: wxWidgets for FreeBASIC?

Post by Imortis »

I don't know if it is a coincidence or not, but there is also this IDE:
wxFBE
It also has a form designer that emits wx-c code.
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

Just found some examples in

Code: Select all

examples\GUI\wx-c
:)
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

I already saw wxFBE but didn't notice the visual designer, will check it out, cool stuff!
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets for FreeBASIC?

Post by St_W »

The wx-c bindings are fine and just have a look at wxFBE (which uses wx-c) to see what's possible to do with it. Nevertheless, some warning: the wx-c library hasn't been updated for quite some time, so don't expect any bugfixes when you encounter any problems with it. And note that it uses wxWidgets 2.8 - an old version.
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

Way to burst my bubble :-/

Also, where in the world can I find

Code: Select all

wx-c-0-9-0-2.dll
? I searched around and all I found were dead links
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets for FreeBASIC?

Post by St_W »

TheDcoder wrote:Also, where in the world can I find

Code: Select all

wx-c-0-9-0-2.dll
?
The wx-c library is part of wx.NET. You can find the latest official version here: https://sourceforge.net/projects/wxnet/ ... net/0.9.2/

The wx-c build used by wxFBE can be found here:
https://svn.freebasic-portal.de/svn/wx/lib/
I've built that back then for MOD, the author of wxFBE, and integrated some little changes in the code that were needed for wxFBE.

And of course you can also compile it yourself. The sources are included in the wx.NET package.
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

Thanks for the link! I thought wxC was an independent project made by C programmers for C programmers...

I don't know if I should say this in the FreeBASIC forum but I am also looking at another language which is called Euphoria and has a good wrapper for wxWidgets called wxEuphoria. The language also has a healthy amount of GUI wrappers for other frameworks and features... namely it can run on Mac/BSD too.
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets for FreeBASIC?

Post by St_W »

TheDcoder wrote:[...] I am also looking at another language which is called Euphoria and has a good wrapper for wxWidgets called wxEuphoria. The language also has a healthy amount of GUI wrappers for other frameworks and features... namely it can run on Mac/BSD too.
The wxeuphoria wrapper is also based on wxWidgets 2.8 and there seem to be now updates for quite a while. For FreeBasic there are also wrappers for other GUI frameworks, for example IUP, FLTK or GTK, among others. Although there's no official build FB can be compiled for *BSD without any code fixes (there's even a package in the repos of OpenBSD; and a FreeBSD build can be downloaded here: http://users.freebasic-portal.de/stw/builds/). Unfortunately there is no official support for Mac yet (as no FB developer owns a Mac), but you can compile FB even for Mac with some little changes: see https://freebasic.net/forum/viewtopic.php?f=17&t=24027
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

Sorry if I get this topic derailed, but the main point why I am trying out Euphoria is that the examples are readily available and the language is very understandable for me... I have yet to see some code examples from FreeBASIC which make sense to me :-/

Edit: Thanks for the info about the status of Mac and BSD support, albeit I was certain that some FreeBASIC coders would have built working prototypes for those platforms :)
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets for FreeBASIC?

Post by St_W »

TheDcoder wrote:Sorry if I get this topic derailed, but the main point why I am trying out Euphoria is that the examples are readily available and the language is very understandable for me... I have yet to see some code examples from FreeBASIC which make sense to me :-/
Some simple samples can be found in FreeBasic's examples folder (inside FreeBasic's installation directory on your PC): https://github.com/freebasic/fbc/tree/m ... s/GUI/wx-c
I haven't a lot of experience with GUI frameworks for FB and I don't want to stop you from using wxWidgets, but I'd like to at least suggest having a look at other GUI frameworks for FB like IUP (headers & examples shipped with FB) or FLTK (https://freebasic.net/forum/viewtopic.php?f=14&t=24547).
TheDcoder
Posts: 44
Joined: Jul 09, 2016 11:43
Location: India
Contact:

Re: wxWidgets for FreeBASIC?

Post by TheDcoder »

St_W wrote: Some simple samples can be found in FreeBasic's examples folder (inside FreeBasic's installation directory on your PC): https://github.com/freebasic/fbc/tree/m ... s/GUI/wx-c
I have found them (mentioned in a previous post) but too complicated for me :(
St_W wrote: I haven't a lot of experience with GUI frameworks for FB and I don't want to stop you from using wxWidgets, but I'd like to at least suggest having a look at other GUI frameworks for FB like IUP (headers & examples shipped with FB) or FLTK (https://freebasic.net/forum/viewtopic.php?f=14&t=24547).
The reason why I chose wxWidgets is because it uses native GUI API in the respective OSes and it does not have that "non-native" look, if I make a program, it should look like it was created with Win32 API and if I used the same program in Linux, it should match it's native look.

If any of the other GUI frameworks provide the same functionality, I would be happy to use them.
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: wxWidgets for FreeBASIC?

Post by St_W »

TheDcoder wrote:If any of the other GUI frameworks provide the same functionality, I would be happy to use them.
Then I'd recommend to try IUP.

from https://en.wikipedia.org/wiki/IUP_%28software%29 :
It handles user interface elements by using native controls provided by native APIs, such as Windows API in Windows, GTK+ in Linux, and Motif-LessTif in older Unices.
The big advantage from FB perspective is that its API can be used directly (as it's a plain C interface rather than some C++ interface) rather than needing additional wrapper libraries. And IUP is still actively developed and you can directly use the official library (as mentioned, without a wrapper).
Post Reply