Uso del fltk de c++

Solo disponible en BuenasTareas
  • Páginas : 21 (5016 palabras )
  • Descarga(s) : 0
  • Publicado : 5 de diciembre de 2010
Leer documento completo
Vista previa del texto
Beginner[pic]Tutorial
version 1.1

Index
News
Who is this website for?
Prerequisite
Why use FLTK?
Getting the Software
Goto FLTK Basics
Flash video ! 
Simple Window Function
Widget Label Pitfall  (NEW)
Simple Window with widgets that talk to each other
Two widgets talking  (NEW)
Simple Inherited Window
Events (NEW)
More sections to come in the future
About me

[pic]
NewsDate: Jan 4/05
This tutorial has been updated. Cleaned up code and explanations in all sections. More examples and screenshots. Updated to match FLTK roadmap. New Sections: Widget Label Pitfall, Two widgets Talking.
Under construction: Events, Layouts, Browser, Makefiles

Date: Jan 1/05
Released Fl_RPNCalc version 1.1

Date: Sept 7/04
Check out my latest contribution. Fl_RPNCalc 1.0 is asimple RPN Calculator with keyboard numpad functionality.

[pic]

Who is this website for?

This website is for C++ programmers who wish to start coding GUI (Graphical User Interface) applications using FLTK.  The documentation of FLTK is very good. However, I found the tutorial examples went from very easy (Hello World) to a little too diffucult (editor.cxx). So this site is intended as afollow up to  FLTK Basics. However, there is new documentation for FLTK 2.0 (Beta)  which is also an excellent resource. It is my hope that when you finish this tutorial you will be able to code your own FLTK applications with pleasure. O
Enjoy!

[pic]

Prerequisite:

I assume you already have somewhat of a foundation in C++ programming. Most importantly you need to understand classes,inheritance, pointers and dynamic memory allocation before you can attempt to learn GUI programming.

Here are some C++ tutorial sites:

Thinking In C++ 2nd Edition by Bruce Eckel (Free Online Book)
http://cplus.about.com/library/blcplustut.htm
http://www.cplusplus.com/doc/tutorial/

top
[pic]

Why use FLTK as opposed to other GUI toolkits?

- it's Free Open Source Software under the GNU LGPL.  See the FLTK license agreement for more details
- it's efficient and straightforward
- it uses C++
- it makes small statically linked stand alone executables that are fast
- it's cross platform with Linux/Unix, Windows and MacOSX (write once compile anywhere)
- it supports OpenGL
- it has a graphical user interface builder called FLUID
- it's fun and easy to learn
top
[pic]

Gettingthe Software:

Linux Install:

- Download FLTK software from www.fltk.org  (get latest stable version 1.1.x)
- Install it with the following commands in a console
        tar -xvzf fltk-1.1.6-source.tar.gz
        cd fltk-1.1.6
       ./configure
       make
       #make install

Note: if you download the .tar.bz2  file use   -xvjf   instead of  -xvzf
Linux has lots and lots ofwonderful text editors and IDE's. I personally like Anjuta and gedit.
"#make install" will put files in /usr/local/ and its subdirectories.
Also, you need the X development libraries on your system. If you don't, ./configure will fail. Most linux distros come with X development libraries installed by default.

                   =============================================

Windows Install:Option 1

- Get the latest version of (Dev-C++ with MinGW) from http://www.bloodshed.net
- Then  use the update feature to get the FLTK Devpak (get the latest 1.1.x)
- Or Download DevPak FLTK1 from FLTK.net
- If this DevPak from fltk.net does not work properly try the older one below.
- The older one is 1.1.4 from this sourceforge server
- FLTK2 Devpak is for version 2.0. Although it'salready pretty stable this tutorial is about 1.1.x.

-Then create a new FLTK gui project. You should automatically have the "Hello World" code.

Option 2

- Download FLTK software from www.fltk.org 
- Get the latest MinGW, MSYS and msysDTK executable install files from here at sourceforge

1)  MinGW-3.x.x-x.exe  (32 bit Windows)
2)  MSYS-1.x.x.exe         (32 bit Windows)
      - Follow...
tracking img