gtk marries marries ada ada gtk the gui technology the
play

Gtk Marries Marries Ada Ada: : Gtk The GUI Technology The GUI - PowerPoint PPT Presentation

Gtk Marries Marries Ada Ada: : Gtk The GUI Technology The GUI Technology Revolution Revolution charlet@gnat.com Overview Overview History of GtkAda History of GtkAda GtkAda Features Features GtkAda Why Gtk Gtk Rather Than Other


  1. Gtk Marries Marries Ada Ada: : Gtk The GUI Technology The GUI Technology Revolution Revolution charlet@gnat.com

  2. Overview Overview History of GtkAda History of GtkAda GtkAda Features Features GtkAda Why Gtk Gtk Rather Than Other Toolkits? Rather Than Other Toolkits? Why Why GtkAda GtkAda rather than rather than Gtk Gtk+? +? Why

  3. GtkAda - - History History GtkAda � The GIMP The GIMP � – GNU Photoshop clone GNU Photoshop clone – � The Gtk+ library The Gtk+ library � – Becomes independent Becomes independent – � GtkGlade: a Gtk+ GUI builder GtkGlade: a Gtk+ GUI builder � � Gnome: a desktop manager Gnome: a desktop manager � � GVD: the GNU Visual Debugger GVD: the GNU Visual Debugger �

  4. GtkAda Features Features GtkAda High- -level binding to the level binding to the Gtk Gtk+ library + library � High � – object object- -oriented oriented – – type safety type safety – – small and efficient small and efficient – Highly portable � Highly portable � – Unixes Unixes: : Linux Linux, Solaris, … , Solaris, … – – Windows Windows NT NT – Native � Native �

  5. GtkAda Features (2) GtkAda Features (2) Event handling � Event handling � Drawing services � Drawing services � – Lines, rectangles, … Lines, rectangles, … – – OpenGL (3D graphics) OpenGL (3D graphics) – Style support � Style support � Large set of widgets � Large set of widgets �

  6. GtkAda - - Widget set Widget set GtkAda � Two types of widgets Two types of widgets � – containers and visual containers and visual objects objects – � About About 100 100 widgets are widgets are provided provided � � High High- -level widgets level widgets � – notebook, text widget, tree, spin button, table, toolbar, ... notebook, text widget, tree, spin button, table, toolbar, ... –

  7. GtkAda - - Screenshots Screenshots GtkAda � Ctree Ctree �

  8. GtkAda - - Screenshots (2) Screenshots (2) GtkAda � OpenGL OpenGL �

  9. Why Gtk+? Why Gtk+? � Portable Portable � � Native Native � � Extensible Extensible � � Open Source Open Source � � Actively developped Actively developped � � Thread Thread- -safe safe �

  10. Why Gtk+? (2) Why Gtk+? (2) � High level widgets High level widgets � � Easy to use scrolling capabilities Easy to use scrolling capabilities � � Wide range of users Wide range of users � � Very powerful layout capabilities Very powerful layout capabilities � – Complete set of containers Complete set of containers – � Powerful and easy to use GUI builder Powerful and easy to use GUI builder � � Easy to bind Easy to bind �

  11. The GUI Builder The GUI Builder Multi- -language GUI builder language GUI builder � Multi � – Language Language- -independent save file independent save file – (XML). (XML). – Code Code- -generation specific to each generation specific to each – language. language. – Dynamic loading of XML files Dynamic loading of XML files –

  12. Why GtkAda? Why GtkAda? � Compile time checks Compile time checks � � Real Object Oriented hierarchy Real Object Oriented hierarchy � � Code readability Code readability � � Group most popular Gtk widgets Group most popular Gtk widgets � � Can create new types and extend Can create new types and extend widgets widgets � � More extensive documentation More extensive documentation �

  13. GtkAda vs Gtk+: Example GtkAda vs Gtk+: Example with Gtk.Main; use Gtk.Main; #include <gtk/gtk.h> with Gtk.Main; use Gtk.Main; #include <gtk/gtk.h> with Gtk.Button; use Gtk.Button; with Gtk.Button; use Gtk.Button; with Gtk.Window; use Gtk.Window; with Gtk.Window; use Gtk.Window; �������������� �������������� void main ( int with Gtk.Enums; use Gtk.Enums; argc, ������������ ������������ void main ( int with Gtk.Enums; use Gtk.Enums; argc, char *argv[]) char *argv[]) procedure Hello is { procedure Hello is { GtkWidget *window; Window : Gtk_Window; GtkWidget *window; Window : Gtk_Window; GtkWidget *button; Button : Gtk_Button; ���������������� ���������������� ����������� ����������� GtkWidget *button; Button : Gtk_Button; begin begin gtk_init (&argc, &argv); Init; gtk_init (&argc, &argv); Init; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); Gtk_New (Window, Window_Toplevel); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); Gtk_New (Window, Window_Toplevel); gtk_container_set_border_width Set_Border_Width (Window, 10); gtk_container_set_border_width Set_Border_Width (Window, 10); (GTK_CONTAINER (window), 10); (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Hello World"); Gtk_New (Button, "Hello World"); button = gtk_button_new_with_label ("Hello World"); Gtk_New (Button, "Hello World"); gtk_container_add (GTK_CONTAINER (window), button); Add (Window, Button); gtk_container_add (GTK_CONTAINER (window), button); Add (Window, Button); gtk_widget_show_all (window); Show_All (Window); gtk_widget_show_all (window); Show_All (Window); ������ ������ ����� ����� gtk_main (); Main; �������������� �������������� gtk_main (); Main; } end Hello; } end Hello;

  14. GUI Builder Builder Support with GtkAda Support with GtkAda GUI Support built- -in in � Support built � Takes advantage of object advantage of object- -oriented oriented � Takes � features. features. – Each widget generates its own Each widget generates its own code code – Generated sources � Generated sources � – easy to read sources (generates new easy to read sources (generates new – composite widgets) composite widgets) – sources can be modified and sources can be modified and regenerated regenerated –

  15. GtkAda: a complete GUI Solution : a complete GUI Solution GtkAda Portable � Portable � Native � Native � Easy to use � Easy to use � Safe � Safe � Object Oriented � Object Oriented � Comes with a GUI builder � Comes with a GUI builder � Same look- -and and- -feel feel � Same look �

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend