FLTK - GUI Builder in Code::Blocks

441 views
Skip to first unread message

domonic Thomson

unread,
Jun 14, 2013, 5:16:26 AM6/14/13
to fltkg...@googlegroups.com
This could be a CodeBlocks question. If so, please let me know.
I have set up an successfully compiled a FLTK program in CodeBlocks (one of the examples), but I want to know 
how I incorporate a FLTK gui builder into Code::Blocks?  Does anyone know?

I want to bring up the FLTK forms so I can rearrange widgets etc.  


Thanks

Ian MacArthur

unread,
Jun 14, 2013, 5:30:18 AM6/14/13
to fltkg...@googlegroups.com
I have no idea, I don't have any useful experience using Codeblocks...

The fltk GUI designer is "fluid", and I just use it as a standalone tool. I guess it *might* be possible to ask CodeBlocks to launch fluid for you?
Certainly a lot of IDE (and indeed advanced editors these days) have mechanisms for adding the launching of external tools to the menus or whatever, so that might be all that is needed?

Of course, fluid does not directly generate C++ sources, it generate .fl files; these then need to be parsed into C++ by calling "fluid -c myfile.fl" to generate myfile.{cxx|h}

But I guess the IDE can do that too?

I usually just do all that in a Makefile, so I guess at a pinch CodeBlocks could run your Makefile too...




Greg Ercolano

unread,
Jun 14, 2013, 1:43:02 PM6/14/13
to fltkg...@googlegroups.com
Just use fluid to manage the .cxx and .H files for your form(s),
and just add them to codeblocks as if they were manually maintained files
so that it links them.

I don't know if you can configure codeblocks to open those files with
fluid automatically when you click on them (instead of codeblocks own editor),
but if you can't, then just invoke fluid to manage them manually whenever you
want to make changes. Then rebuilding in codeblocks should automatically
recompile them.

This is actually a common use of fluid; to manage individual widget screens
that are part of a larger app.


mingodad

unread,
Jun 17, 2013, 2:27:47 PM6/17/13
to fltkg...@googlegroups.com
I have this settings on codeblocks on linux:

Settings -> Compiler and debugging settings -> Other settings -> Advanced options :

-- Add an extension (in my case "fl")

-- On command line macro :
            cd $file_dir;  fluid -c $file

-- Generated files  (to be further compiled) :
            $file_dir/$file_name.cxx
            $file_dir/$file_name.h

Settings -> Environment -> Files extension handling :
            Wildcard : *.fl
            To open file: Launch an external program
            External program: fluid

With that I can double click on any fluid file I include on a project and it opens it with fluid, when I press "run" or "build" codeblocks calls fluid to generate the c++ files and compile then if needed.

I hope this can help you !

Greg Ercolano

unread,
Jun 17, 2013, 2:42:35 PM6/17/13
to fltkg...@googlegroups.com
Great; I've added these comments to the "CREATING A NEW PROJECT IN CODE::BLOCKS"
section of the README.Unix.txt that comes with FLTK. (r9934):
http://www.fltk.org/newsgroups.php?s10418+gfltk.commit+v10468
Reply all
Reply to author
Forward
0 new messages