Qgtk2.pas - quick programming in Pascal with gtk2 libraries



Freepascal allows you to use gtk2 libraries for X-windows or even for M$ windows. The usage of gtk2 libraries is rather complicated and it usually takes many weeks to learn it. The unit qgtk2.pas makes the usage of gtk2 simpler and quicker. Although it doesn't give you the possibility of using all the features of gtk2 it will be sufficient enough for many easier programs.


freepascal 2.x ( http://www.freepascal.org/ ) Linux, X11, gtk2 or M$ win32 and gtk2 dll


Download qgtk2.pas - 243 Kb - unit qgtk2.pas with manual, tutorial and a some examples.

(Old Gtk1 version for freepascal 1.1: gktk.pas- 243 Kb. and for M$ win gtk1.3 dll library)

Program hello word:

qhello.pas With qgtk2.pas it is really very simple:
uses qgtk2;                                                                      
qstart('Hello Word!', nil, nil);                                                
qLabel('  Hello word with ');                                                   
qButton(' QUIT button ', @qDestroy);                                            


Easy putting components into a window:

If you call the procedures of the components (qlabel, qbutton, ...) the components are placed side by side in one row from left to right in the order they have been called. After the call of the procedure qNextRow the following components are placed in the next row. The procedure qFrame enables to place the components in the collumns.
qLabel('Hello'); qButton('qButton', nil); qLabel('and qLabel');                 
qLabel('1 qNextRow  qLabel'); qButton('and qButton', nil);                      
qButton('2 qFrame',nil);                                                        
qlabel('3 qNextRow in frame -'); qLabel('and qLabel');                          
qlabel('4 qseparator in frame'); qButton('and qButton', nil);                   
qLabel('5 qFrame'); qButton('and qButton', nil);                                
qLabel('6 qLabel       ');                                                      
qLabel('7 qEndFrame'); qButton('and qButton', nil);                             
   qButton('...', nil); qButton('and QUIT', @qDestroy);                         

Many components and windows:

qdialog.pas Easy creating of menus, dialogs and another componets.

The graphics:

camels.pas It allows you to draw the essential graphics and to show xpm pictures. It supports the movement of the pictures without blinking and with the transparent color and it enables to react on the position and click of the mouse.

GNU Linux - M$ win32

win gnu Freepascal with gtk2 support is avaible for GNU Linux and for M$windows. Your programs using qgtk2.pas can be compiled in Linux and also in Windows. (For M$windows you need gtk2 dll library )

Programs using qgtk.pas


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

(c) 2003-2005 Jirka Bubenicek