On 6/13/08, Jane <[EMAIL PROTECTED]> wrote: > hey there, > > I am about to write a remote and preset editor for a synthesizer family. I > did one before but for a different type of devices (http://ppcontrol.sf.net). > I want to use FLTK for this one as GTK can be *really* slow when you have a > window with 127 spinbuttons for example.
Yes FLTK is great for this kind of project. I assume you have seen this http://gmorgan.sourceforge.net/ > I am new to FLTK and C++ (I "know" C though). I did the CubeView tutorial > that comes with FLUID. So far so good. Check out my tutorial. It may help with the C++ end of things. http://www3.telus.net/public/robark/ > Now I have to make some software design decisions. Id like to hear some > ideas from you about how to do it right. That is, how to get the most out of > this fltk and C++ combination for my type of application. > Here are a couple of examples of placing widgets. The first one uses the method of a pack which contains a pack. Although it's in pyFLTK the concept is the same. #!/usr/bin/python from fltk import * def changemylabel(widget): widget.label("Hello") w = Fl_Window(600, 50, 340, 440, "my gui") w.begin() mainpack=Fl_Pack(20,20,300,400) mainpack.begin() butarray=[] for i in range(0,3): p=Fl_Pack(0,0,0,100) #x,y,w,h p.begin() for x in range(0,3): butarray.append(Fl_Button(0,0,80,0)) butarray[-1].callback(changemylabel) p.end() p.type(FL_HORIZONTAL) p.spacing(20) mainpack.end() mainpack.type(FL_VERTICAL) mainpack.spacing(20) w.end() Fl.scheme("plastic") w.show() Fl.run() Here is another example where the placement is based on a nested loop formula. #!/usr/bin/python from fltk import * def button_callback(widget): widget.label("Hello") win = Fl_Window(Fl.w()/2-250,Fl.h()/2-250,500,500,) win.begin() grid = [] width = 50 height = 50 for col in range(6): but_array = [] for row in range(6): but_array.append(Fl_Button((width*row) + 100, (height*col) + 100, width, height)) but_array[-1].callback(button_callback) grid.append(but_array) win.end() win.show() Fl.run() -- Robert Arkiletian Eric Hamber Secondary, Vancouver, Canada Fl_TeacherTool http://www3.telus.net/public/robark/Fl_TeacherTool/ C++ GUI tutorial http://www3.telus.net/public/robark/ _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

