Is FB powerful enough to clone the fox toolkit?

General discussion for topics related to the FreeBASIC project or its community.
dwzgocl0
Posts: 4
Joined: Apr 05, 2022 10:21

Is FB powerful enough to clone the fox toolkit?

Post by dwzgocl0 »

I always dreamed being able to clone the fox toolkit in FB language. Even though my ability is severely lacked, I did try. But I always got stuck at duplicating the FOX metaobject and message system. It's something in FB that seems not ready. I don't know exactly what is missing but it's simply not there.

FOX homepage: http://fox-toolkit.org/

FOX metaobject:

https://github.com/franko/fox/blob/mast ... etaClass.h

https://github.com/franko/fox/blob/mast ... FXObject.h

https://github.com/franko/fox/blob/mast ... jectList.h

FOX sending messages: http://fox-toolkit.org/messages.html

FOX is far more simpler than Qt. I have never think of something like Qt could be built on top of FB.

I have checked most if not all GUI tookits based on FB but so far I didn't see any of them implementing a metaobject system, has the ability to send and receive messages like FOX or connect slots and signals like Qt. The idea of a metaobject system is brilliant, I think the developers of these GUI toolkits were already consider it. But they could be like me, thinking it's still missing something. If the metaobject and messages send/receive could be built, cloning the rest of FOX is pretty much straight forward.
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Is FB powerful enough to clone the fox toolkit?

Post by paul doe »

dwzgocl0 wrote: Apr 07, 2022 17:11 I always dreamed being able to clone the fox toolkit in FB language.
...
Why?
...
Even though my ability is severely lacked, I did try. But I always got stuck at duplicating the FOX metaobject and message system. It's something in FB that seems not ready. I don't know exactly what is missing but it's simply not there.
If your ability is 'severely lacked', how can you tell that something is 'simply not there'?
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Is FB powerful enough to clone the fox toolkit?

Post by caseih »

Seems like we have a return of the poster(s) with the random letter usernames. Same person as before. Same writing style, same tone. Same desire to run before learning to walk, to do huge projects without being able to do little ones.

Yes, FB is definitely powerful enough." If you can do in another language you can do in FB.

Of course someone could make a GUI toolkit like Qt with FB. Why would you think otherwise?

GTK uses a "metaobject" system and implements events with signals and slots.
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: Is FB powerful enough to clone the fox toolkit?

Post by PaulSquires »

caseih wrote: Apr 07, 2022 18:59 Seems like we have a return of the poster(s) with the random letter usernames.
I agree 100% and was about to post the same message as you caseih
Seems like he as several new accounts in rotation right now.
ktuee753
Posts: 12
Joined: Mar 23, 2022 17:04

Re: Is FB powerful enough to clone the fox toolkit?

Post by ktuee753 »

Multiple Inheritance. FreeBASIC lacks Multiple Inheritance. The FOX toolkit made heavy use of Multiple Inheritance. So it's impossible to implement something like FOX in FreeBASIC without changing the design.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Is FB powerful enough to clone the fox toolkit?

Post by caseih »

How many aliases do you have on this forum?

As the saying goes, there's more than one way to skin a cat. I assure you that multiple inheritance is not needed to implement an event-driven, signals and slots framework. Or even a complex object hierarchy. GTK+ works from FB, for example, and has all of those things.

By the way, can you point to some examples of multiple inheritance in Fox? I looked at maybe a dozen classes and the inheritance tree is a straight line in every case. Which ones are multiple?
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Is FB powerful enough to clone the fox toolkit?

Post by fxm »

Also, do not confuse multilevel (or multiple-level) inheritance with multiple inheritance.
ktuee753
Posts: 12
Joined: Mar 23, 2022 17:04

Re: Is FB powerful enough to clone the fox toolkit?

Post by ktuee753 »

caseih wrote: Apr 11, 2022 2:42 How many aliases do you have on this forum?

As the saying goes, there's more than one way to skin a cat. I assure you that multiple inheritance is not needed to implement an event-driven, signals and slots framework. Or even a complex object hierarchy. GTK+ works from FB, for example, and has all of those things.

By the way, can you point to some examples of multiple inheritance in Fox? I looked at maybe a dozen classes and the inheritance tree is a straight line in every case. Which ones are multiple?
I'm not one of his aliases. I always confused between multiple and multi-level inheritance. FOX has the doxygen generated class reference here:

http://www.fox-toolkit.org/ref/classFX_ ... XIcon.html

I think it's multiple inheritance. The sources are difficult to watch unless you have a good IDE. Use the class reference instead.
ktuee753
Posts: 12
Joined: Mar 23, 2022 17:04

Re: Is FB powerful enough to clone the fox toolkit?

Post by ktuee753 »

fxm wrote: Apr 11, 2022 4:57 Also, do not confuse multilevel (or multiple-level) inheritance with multiple inheritance.
I always confused between multiple and multi-level inheritance. But this time, I think I was right. It's multiple inheritance.
ktuee753
Posts: 12
Joined: Mar 23, 2022 17:04

Re: Is FB powerful enough to clone the fox toolkit?

Post by ktuee753 »

Regardless of it's multiple inheritance or multi-level inheritance, something like what on the class reference is clearly impossible on FreeBASIC. FreeBASIC seems support multi-level inheritance (Type ... Extends ...) but the current implementation is unreliable. I have read the source of the most OOP heavy usage piece of software in FreeBASIC, the MyFbFramework and VisualFBEditor, the only thing I see is full of boilerplate code and toy level OOP. As I recall, OOP on FreeBASIC is a syntactic sugar and FreeBASIC itself is not an OOP language. People tends to mask this fact by telling FreeBASIC is multi-paradigm language like C++ only to hide their true feelings. This is the reason why all of my code in FreeBASIC is using mode #fblite. Too bad the OOP syntactic sugar was infected too deep into the language otherwise I will try doing my own OOP implementation, something not as complex as GObject but resembles Oberon language's OOP.
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Is FB powerful enough to clone the fox toolkit?

Post by fxm »

ktuee753 wrote: Apr 11, 2022 9:05 FreeBASIC seems support multi-level inheritance (Type ... Extends ...) but the current implementation is unreliable.
???
Example please?

ktuee753 wrote: Apr 11, 2022 9:05 ..... all of my code in FreeBASIC is using mode #fblite.
Member procedures are not supported in -lang fblite. Only data is supported as Type members.
So, OOP is only supported in -lang fb (the default language)
zmymhlej
Posts: 11
Joined: Mar 23, 2022 16:50

Re: Is FB powerful enough to clone the fox toolkit?

Post by zmymhlej »

Our miilvyxg is indeed only a poor man with not only heath problems but also mental problems. Don't be too harsh on him!

Due to Spinal disc herniation he may have to quit programming or sitting in front of a computer forever. You could safety say Good riddance.

Goodbye.
zmymhlej
Posts: 11
Joined: Mar 23, 2022 16:50

Re: Is FB powerful enough to clone the fox toolkit?

Post by zmymhlej »

PaulSquires wrote: Apr 07, 2022 19:04
caseih wrote: Apr 07, 2022 18:59 Seems like we have a return of the poster(s) with the random letter usernames.
I agree 100% and was about to post the same message as you caseih
Seems like he as several new accounts in rotation right now.
There will be no more. You can be assured.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Is FB powerful enough to clone the fox toolkit?

Post by caseih »

ktuee753 wrote: Apr 11, 2022 8:54I think it's multiple inheritance.
Nope it's certainly not! That link you posted as an example (FXPCXIcon) is clearly single inheritance. Each class has only one ancester, all the way back to FXObject. By the way this is also true for Qt and GTK+.

Sometimes multiple inheritance is attractive, but it introduces a lot of ambiguities in method and member resolution, so it's generally avoided by most languages and most programmers. Turns out there are other techniques for accomplishing the same functionality but in ways that are more consistent and easier to reason about. For example the Java idea of interfaces. Also it turns out that in many instances, inheritance in general sometimes causes problems when trying to shoehorn every problem into an object-oriented structure.

Not sure why I'm saying these things as you've admitted yourself that you don't use OOP in any form, only using fblite.
Last edited by caseih on Apr 11, 2022 13:46, edited 2 times in total.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Is FB powerful enough to clone the fox toolkit?

Post by caseih »

ktuee753 wrote: Apr 11, 2022 9:05 Regardless of it's multiple inheritance or multi-level inheritance, something like what on the class reference is clearly impossible on FreeBASIC. FreeBASIC seems support multi-level inheritance (Type ... Extends ...) but the current implementation is unreliable. I have read the source of the most OOP heavy usage piece of software in FreeBASIC, the MyFbFramework and VisualFBEditor, the only thing I see is full of boilerplate code and toy level OOP. As I recall, OOP on FreeBASIC is a syntactic sugar and FreeBASIC itself is not an OOP language. People tends to mask this fact by telling FreeBASIC is multi-paradigm language like C++ only to hide their true feelings. This is the reason why all of my code in FreeBASIC is using mode #fblite. Too bad the OOP syntactic sugar was infected too deep into the language otherwise I will try doing my own OOP implementation, something not as complex as GObject but resembles Oberon language's OOP.
Sorry but that's complete and utter nonsense. You have no idea what you're talking about.
Post Reply