| ▲ | throwaway2037 a day ago | |||||||
I worked on a pure C system early in my career. They implemented multiple inheritance (a bit like Perl/Python MRO style) in pure C. It was nuts, but they didn't abuse it, so it worked OK. Also, serious question: Are they any GUI toolkits that do not use multiple inheritance? Even Java Swing uses multiple inheritance through interfaces. (I guess DotNet does something similar.) Qt has it all over the place. | ||||||||
| ▲ | aninteger a day ago | parent | next [-] | |||||||
The best example I can think of is the Win32 controls UI (user32/Create window/RegisterClass) in C. You likely can't read the source code for this but you can see how Wine did it or Wine alternatives (like NetBSD's PEACE runtime, now abandoned). Actually the only toolkit that I know that sort of copied this style is Nakst's Luigi toolkit (also in C). Neither really used inheritance and use composition with "message passing" sent to different controls. | ||||||||
| ▲ | uecker 15 hours ago | parent | prev | next [-] | |||||||
I take this back ;-) People come up with crazy things. Still I would not call this "C thinking". Building object-oriented code in C is common though and works nicely. | ||||||||
| ▲ | nottorp a day ago | parent | prev | next [-] | |||||||
One could say toolkits done in C++ use multiple inheritance because C++ doesn't have interfaces though. | ||||||||
| ▲ | WD-42 a day ago | parent | prev [-] | |||||||
GTK does not support multiple inheritance afaik. | ||||||||
| ||||||||