Gtkada windows




















Apr 6, Add setton to the list of authors. Sep 28, Add run-time license. Dec 20, Update GPL to version 3. Jan 9, Use two build variables for the installation. Jan 12, Fix support of OpenGL on Linux. Nov 3, UA Update files. Dec 3, UA Replace deprecated autoconf macros. Add support for running doinstall unattended. Nov 24, Sep 30, Fix format and name of features and known-problems files. Mar 8, Add gtk. Jul 11, Nov 11, Feb 24, Add entry for P May 16, Merge PR Sep 4, View code.

Resources Readme. Code of conduct. Releases 2 v Nov 16, Packages 0 No packages published. Contributors Otherwise, you need to make the directory that contains these project files visible to the compiler.

To build your own application, you should then setup a project file see the GNAT documentation for more details on project files , which simply contains the statement:. This will automatically set the right compiler and linker options, so that your application is linked with GtkAda. If you would prefer to link with the static library, you can set the environment variable:.

It is made of two libraries: gtk and gdk. In addition, GtkAda provides binding to three supporting libraries: pango , cairo and glib. Glib is a non-graphical library that includes support for lists, h-tables, threads, and so on. It is a highly optimized, platform-independent library. For the parts of Glib that we do depend on, we provide Glib. Gdk provides basic graphical functionality to, for instance, draw lines, rectangles and pixmaps on the screen, as well as manipulate colors.

The Gdk. Pango is a modern font handling system. Cairo is the low-level 2D drawing library used by Gdk to render widgets.

Cairo provides a rich set of vector drawing features, supporting anti-aliasing, transparency, and 2D matrix transformations. The Cairo. Gtk is the top level library. It is platform independent, and does all its drawing through calls to Gdk and Cairo. This is where the high-level widgets are defined. It also includes support for callbacks. Its equivalent in the GtkAda libraries are the Gtk. It is made of a fully object-oriented hierarchy of widgets see Widgets Hierarchy.

Since your application only calls GtkAda, it is fully portable, and can be recompiled as-is on other platforms:. Although the packages have been evolving a lot since the first versions of GtkAda, the specs are stabilizing now.

We will try as much as possible to provide backward compatibility whenever possible. It is thus relatively easy to convert external examples from C to Ada.

Because of a clash between Ada keywords and widget names, there are two exceptions to the above general rule:. Most enum types have been grouped in the gtk-enums. Some features have been implemented as generic packages. These are the timeout functions see Gtk. Timeout , the idle functions see Gtk. Idle , and the data that can be attached to any object see Gtk.

Type safety is ensured through these generic packages. Callbacks were the most difficult thing to interface with. These are extremely powerful and versatile, since the callbacks can have any number of arguments and may or may not return values. These are once again implemented as generic packages, that require more explanation Signal handling. This memory is freed by gtk itself, by calling some Ada functions.

Therefore the generic packages have to be instantiated at library level, not inside a subprogram, so that the functions are still defined when gtk needs to free the memory. Init must be invoked first.

Most of the time, this procedure is invoked from the main procedure of the application, in which case no use of GtkAda can be done during the application elaboration. All widgets in GtkAda are implemented as tagged types. They all have a common ancestor, called Gtk.

All visual objects have a common ancestor called Gtk. The following table describes the list of objects and their inheritance tree. As usual with tagged types, all the primitive subprograms defined for a type are also known for all of its children.

This is a very powerful way to create new widgets, as will be explained in Creating new widgets in Ada. XXX , in the file gtk-xxx. This follows the GNAT convention for file names. Text , in the file gtk-text. It is important to be familiar with this hierarchy.

It is then easier to know how to build and organize your windows.



0コメント

  • 1000 / 1000