On 31 Jan 2009, at 7:30, Olivier Gautherot wrote:

> I've been searching on this forum and on the Internet but did not  
> find the answer.
>
> I'm currently writing an app with FLTK2 under Windows (FreeBSD will  
> be my second target) and tried to load a bitmap with the icon()  
> method but nothing happened. Is there an example I could follow to  
> replace the little white square in the app bar at the top?

There is no fltk-specific way of achieving this, so you need a little  
bit of platform specific code wrapped up with a few ifdefs.

The simplest example of doing tis (for a fltk program) is probably in  
the sudoku example in the test directory.
It is distributed in the fltk-1.1 / fltk-1.3 series, it may not be in  
the flkt-2 tree, but that doesn't matter, as the technique used is  
identical anyway.

Look at the code for sudoku.cxx, around line 702 or so, and see how  
the ifdefs are used to execute a little platform specific code. It is  
that simple.
The only other thing you need to do (for a Windows host) is compile  
the icon resource into the executable, using your resource compiler -  
again, referring to the Makefile in the test directory, around line  
407, shows the Windows specific steps that are added at build time to  
achieve this.
And that is all there is to it.





_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to