Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-05 Thread testalucida
I think I've finally got it. Thanks again - that was *very* helpful for my actual project and with regard to former problems I was facing when drawing things in FLTK. And thanks to Albrecht for his example code! On 04.02.2012 00:08, testalucida wrote: On 02/03/12 11:21, testalucida wrote:

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-04 Thread Greg Ercolano
On 02/04/12 00:31, testalucida wrote: I tried that before and I could swear width always being 0. But as I wrote this I tried again (on Linux) and it worked. Perhaps it was on Windows? I'll try on Monday. I'm guessing in the tests where you got 0, fl_font() hadn't been set

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-04 Thread Albrecht Schlosser
On 04.02.2012 00:08, testalucida wrote: On 02/03/12 11:21, testalucida wrote: Hi all, thank you for your efforts! It works as you say, but I still can't understand why this doesn't work: textfont( FL_HELVETICA_BOLD ); textsize( 12 ); (instead of fl_font(textfont(), textsize()); )

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-03 Thread testalucida
Hi all, thank you for your efforts! It works as you say, but I still can't understand why this doesn't work: textfont( FL_HELVETICA_BOLD ); textsize( 12 ); (instead of fl_font(textfont(), textsize()); ) And why does it work when adding a dummy Fl_Output first? bye testalucida On 02/02/12

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-03 Thread Greg Ercolano
On 02/03/12 11:21, testalucida wrote: Hi all, thank you for your efforts! It works as you say, but I still can't understand why this doesn't work: textfont( FL_HELVETICA_BOLD ); textsize( 12 ); (instead of fl_font(textfont(), textsize()); ) fl_font() sets the current font used for

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-03 Thread Albrecht Schlosser
On 03.02.2012 20:21, testalucida wrote: It works as you say, but I still can't understand why this doesn't work: textfont( FL_HELVETICA_BOLD ); textsize( 12 ); (instead of fl_font(textfont(), textsize()); ) ... as Greg said ... And why does it work when adding a dummy Fl_Output first?

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-03 Thread testalucida
On 02/03/12 11:21, testalucida wrote: Hi all, thank you for your efforts! It works as you say, but I still can't understand why this doesn't work: textfont( FL_HELVETICA_BOLD ); textsize( 12 ); (instead of fl_font(textfont(), textsize()); ) fl_font() sets the current font

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-02 Thread MacArthur, Ian (SELEX GALILEO, UK)
I made the recommended improvements but without any effect. On debugging I found out that the measurement of the topmost Fl_Output widget (calling fl_measure()) sets 0 to my width variable (wi). The measurement of the next widgets is ok. That's why I think - but am not sure - that the reason

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-02 Thread MacArthur, Ian (SELEX GALILEO, UK)
setting the font before calling fl_measure() didn't have the desired result. But I found a workaround: before adding the topmost Fl_Output I add a dummy Fl_Output with width = 0 and height = 0. And now the topmost widget is measured correctly. So my application works properly - but it would

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-02 Thread Greg Ercolano
On 02/02/12 02:07, MacArthur, Ian (SELEX GALILEO, UK) wrote: Once I fixed it so that it will actually compile, and incorporated the changes we advised, I had this (see below) and it works perfectly, so I do not know what the problem you have in your real code can be: I had to change the

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-02 Thread MacArthur, Ian (SELEX GALILEO, UK)
Once I fixed it so that it will actually compile, and incorporated the changes we advised, I had this (see below) and it works perfectly, so I do not know what the problem you have in your real code can be: I had to change the name of 'class Display' to 'MyDisplay' to get it to

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-02 Thread Greg Ercolano
On 02/02/12 06:28, MacArthur, Ian (SELEX GALILEO, UK) wrote: Other than that, built and ran OK for me. My code, or Martin's (testalucida's) original example? I started with your code. OP's wouldn't build; missing includes, std:: notation, etc. Also, I could see

[fltk.general] Fl_Output doesn't draw properly

2012-02-01 Thread testalucida
Hi all, I'm trying to create several Fl_Output derived controls on demand and put them by columns into a Fl_Double_Window. The width of each Fl_Output shall go with its value, e.g. for a value A width should be 10 and for a value MyTestValue it should be 110. The measurement of values is done

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-01 Thread Albrecht Schlosser
On 01.02.2012 12:54, testalucida wrote: I'm trying to create several Fl_Output derived controls on demand and put them by columns into a Fl_Double_Window. The width of each Fl_Output shall go with its value, e.g. for a value A width should be 10 and for a value MyTestValue it should be

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-01 Thread MacArthur, Ian (SELEX GALILEO, UK)
protected: void draw() { int wi, he; Oops! Check the docs... Three issues: 1)You must explicitly set wi and he to zero before you call fl_measure(), or they will be interpreted as being width/height limits to wrap to. Since they appear to be stack variables here, we

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-01 Thread testalucida
Hi Ian, hi Albrecht, thanks for your proposals. I made the recommended improvements but without any effect. On debugging I found out that the measurement of the topmost Fl_Output widget (calling fl_measure()) sets 0 to my width variable (wi). The measurement of the next widgets is ok. That's

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-01 Thread Greg Ercolano
On 02/01/12 09:44, testalucida wrote: Hi Ian, hi Albrecht, thanks for your proposals. I made the recommended improvements but without any effect. On debugging I found out that the measurement of the topmost Fl_Output widget (calling fl_measure()) sets 0 to my width variable (wi).

Re: [fltk.general] Fl_Output doesn't draw properly

2012-02-01 Thread testalucida
Hi Greg, setting the font before calling fl_measure() didn't have the desired result. But I found a workaround: before adding the topmost Fl_Output I add a dummy Fl_Output with width = 0 and height = 0. And now the topmost widget is measured correctly. So my application works properly - but it