For educational purposes, I will compare a simple GTK+ about dialog in Python versus one in C.
Python
about_dialog = gtk.AboutDialog()
about_dialog.set_icon(about_dialog.render_icon(gtk.STOCK_ABOUT, gtk.ICON_SIZE_MENU))
about_dialog.run()
about_dialog.destroy()
Simple, readable. All I did was create a dialog, set its icon and name, run it then destroy it. In C it's a different story.
C
GtkWidget* about_dialog = gtk_about_dialog_new();
gtk_window_set_icon(GTK_WINDOW(about_dialog), gtk_widget_render_icon(about_dialog, GTK_STOCK_ABOUT, GTK_ICON_SIZE_MENU, NULL));
gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about_dialog), "Parcellite");
gtk_dialog_run(GTK_DIALOG(about_dialog));
gtk_widget_destroy(about_dialog);
Sacrificing readability for speed? I think it's worth it.
No comments:
Post a Comment