<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ift.wiki.uib.no/index.php?action=history&amp;feed=atom&amp;title=FLTK_GUI</id>
	<title>FLTK GUI - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ift.wiki.uib.no/index.php?action=history&amp;feed=atom&amp;title=FLTK_GUI"/>
	<link rel="alternate" type="text/html" href="http://ift.wiki.uib.no/index.php?title=FLTK_GUI&amp;action=history"/>
	<updated>2026-07-18T01:05:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>http://ift.wiki.uib.no/index.php?title=FLTK_GUI&amp;diff=216&amp;oldid=prev</id>
		<title>Nfyku: New page: == Simple FLTK tutorial using Bloodshed Dev-C++ with MinGw ==  === Download Software === Get the latest version of Bloodshed Dev-C++ with Mingw/GCC from (~9 MB):&lt;br/&gt; http://www.bloodshed....</title>
		<link rel="alternate" type="text/html" href="http://ift.wiki.uib.no/index.php?title=FLTK_GUI&amp;diff=216&amp;oldid=prev"/>
		<updated>2009-03-02T08:24:36Z</updated>

		<summary type="html">&lt;p&gt;New page: == Simple FLTK tutorial using Bloodshed Dev-C++ with MinGw ==  === Download Software === Get the latest version of Bloodshed Dev-C++ with Mingw/GCC from (~9 MB):&amp;lt;br/&amp;gt; http://www.bloodshed....&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Simple FLTK tutorial using Bloodshed Dev-C++ with MinGw ==&lt;br /&gt;
&lt;br /&gt;
=== Download Software ===&lt;br /&gt;
Get the latest version of Bloodshed Dev-C++ with Mingw/GCC from (~9 MB):&amp;lt;br/&amp;gt;&lt;br /&gt;
http://www.bloodshed.net/dev/devcpp.html&amp;lt;br/&amp;gt;&lt;br /&gt;
or v-4.9.9.2 directly from:&amp;lt;br/&amp;gt;&lt;br /&gt;
http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install in an appropriate place.&lt;br /&gt;
&lt;br /&gt;
After starting the program the first thing you need to do is to download the FLTK library. Go to “Tools-&amp;gt;Check for updates / packages”.&lt;br /&gt;
&lt;br /&gt;
[[Image:webupdata.bmp]]&lt;br /&gt;
&lt;br /&gt;
Select devpak server “devpaks.org Community Devpaks” click “Check for updates” and check the fltk version 1.1.7 and click “Download selected” and continue with the installation of the library. 1.1.7 is a stable version of the FLTK library. FLTK2 is still a beta release. &lt;br /&gt;
&lt;br /&gt;
=== Start a new FLTK project ===&lt;br /&gt;
&lt;br /&gt;
Start Bloodshed Dev-C++ and start a new project “File-&amp;gt;new-&amp;gt; project”. Choose “Empty Project” and give the project a name. &lt;br /&gt;
&lt;br /&gt;
[[Image:newproject.bmp]]&lt;br /&gt;
&lt;br /&gt;
Add a new source file to the project “File-&amp;gt;new-&amp;gt;Source File”. Save file as main.cpp.&lt;br /&gt;
&lt;br /&gt;
In order to setup the FLTK library for the project go to “Project-&amp;gt;Project options” and add the following under the Parameters tab:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Compiler: -DWIN32 -mms-bitfields &lt;br /&gt;
Linker: -lfltk -lole32 -luuid -lcomctl32 -lwsock32 –lm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:project_options.bmp]]&lt;br /&gt;
&lt;br /&gt;
Under the General tab choose Win32 GUI.&lt;br /&gt;
&lt;br /&gt;
[[Image:project_options2.bmp]]&lt;br /&gt;
&lt;br /&gt;
=== The quick way of creating a FLTK project ===&lt;br /&gt;
&lt;br /&gt;
“File-&amp;gt;new-&amp;gt; project” and choose GUI and FLTK. This will automatically set up the linking and compiler setttings.&lt;br /&gt;
[[Image:newproject2.bmp]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Develop code ===&lt;br /&gt;
&lt;br /&gt;
Create a new source file and write the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include !&amp;lt;FL/Fl.H&amp;gt;&lt;br /&gt;
#include \&amp;lt;FL/Fl_Window.H&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main (int argc , int **argv)&lt;br /&gt;
{&lt;br /&gt;
    Fl_Window win(400,200,&amp;quot;Test&amp;quot;);  //win(width, height,name)&lt;br /&gt;
    win.show();                     // show window&lt;br /&gt;
    return(Fl::run());              //fltk application loop&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and press F9 (Compile &amp;amp; Run) and a simple window will be created.&lt;br /&gt;
&lt;br /&gt;
[[Image:simplewindow.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create a simple window with a button===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;FL/Fl.H&amp;gt;&lt;br /&gt;
#include &amp;lt;FL/Fl_Window.H&amp;gt;&lt;br /&gt;
#include &amp;lt;FL/Fl_Button.H&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void but_cb(Fl_Widget* w, void*){&lt;br /&gt;
      Fl_Button *b= (Fl_Button*)w;&lt;br /&gt;
      if (b-&amp;gt;label() == &amp;quot;Off&amp;quot;) {&lt;br /&gt;
         b-&amp;gt;label(&amp;quot;On&amp;quot;);&lt;br /&gt;
      }else{&lt;br /&gt;
         b-&amp;gt;label(&amp;quot;Off&amp;quot;);        &lt;br /&gt;
      }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main (int argc , int **argv)&lt;br /&gt;
{&lt;br /&gt;
    Fl_Window win(400,200,&amp;quot;Test&amp;quot;);  //win(width, height,name)&lt;br /&gt;
    Fl_Button but(100,50,70,30,&amp;quot;On&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    win.show();&lt;br /&gt;
                         // show window&lt;br /&gt;
    but.callback(but_cb);    &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    return(Fl::run());              //fltk application loop   &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:windowwithbutton.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Mikroelektronikk]]&lt;/div&gt;</summary>
		<author><name>Nfyku</name></author>
	</entry>
</feed>