Well, you can laugh all you want but this won't change the fact that people do program GUI in C.
I don't see how this is relevant to anything. I'm not saying C++ is not used for GUI programming, I'm saying C is a general purpose language that is fit for UI programming.Everyone knows c++ and java are used more for GUI programming because they are OBJECT ORIENTED.
You'd be surprisedOf course its not impossible but who does GUIs in C????
Your case proves you wrong. You know C (at least you say so and I have no reason to not believe you) but apparently currently you are not able to program in C++.Once you know C you can program in all of the C family.
I'm not arguing anything however the level of C and C++ is usually considered the same (I wouldn't call it "low level" though -- assembly is low level, C/C++ is definitely higher level than assembly). Both are strongly typed, compiled, native symbol based languages. The fact that one is more object oriented than the other doesn't influence the level of the language.And are you really aruguing the fact that C is a low-level langauge???
Well, that's your problem, not mine. I'm not saying I could do the same in 400 lines of code but then I'm not saying I couldn't either.I've written nearly a thousand lines of C++ code for this singular program
I never said I know everything about C++. But I do know similarities and differences between programming languages I use.just because you feel you know everything about C++
I never said that too. The point is that you will gain much more if you focus on learning the language first before you start using it with a framework as complex as Qt. I noticed that I'm not the only one to tell you that. If one person tells you there is something wrong with you, you can ignore him. If two people tell you that you are sick -- think about seeing a doctor.doesn't mean everyone you come in contact with has to aswell.
Nnnno.... GTK+ is written in C, Qt is pure C++ -- how come possibly would they be "nearly identical" in implementation?GTK+/Qt are nearly identical in implementation
No, they are not.They are both OBJECT-ORIENTED
This is the official GTK+ "hello world" tutorial (with comments stripped out) :
C Code:
#include <gtk/gtk.h> static void hello( GtkWidget *widget, gpointer data ) { g_print ("Hello World\n"); } static gboolean delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ) { g_print ("delete event occurred\n"); return TRUE; } /* Another callback */ static void destroy( GtkWidget *widget, gpointer data ) { gtk_main_quit (); } int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "delete-event", G_CALLBACK (delete_event), NULL); g_signal_connect (window, "destroy", G_CALLBACK (destroy), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); g_signal_connect (button, "clicked", G_CALLBACK (hello), NULL); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show (button); gtk_widget_show (window); gtk_main (); return 0; }To copy to clipboard, switch view to plain text mode
Where do you see anything object oriented here?
Fundamental concepts of object-oriented programming are abstraction, encapsulation, polymorphism and inheritance. The code I quoted is just a set of plain function calls -- no polymorphism, no encapsulation, no inheritance and practically no abstraction, no objects.
GTK doesn't care about your Linux version. The fact that your distro may be missing precompiled packages for GTK doesn't mean you can't build GTK for it.And also, GTK isn't available for all versions of Linux
This discussion is going nowhere. The primary fact (ignoring all the other things) is that you are trying to use a language you don't know and which makes you confused and I (we?) am telling you to focus on the language itself (without Qt, just plain C++) before trying to employ it to solve complex problems. Without knowledge about classes, inheritance, using and overriding virtual methods you will not be able to use Qt efficiently. You can learn all that in a couple of days and then you will have a chance to understand how to use Qt. We can see that even scopes of visibility are giving you problems and they are the same in both C and C++. You either accept that fact or not.
Bookmarks