On 12 Jul 2008, at 0:37, huda wrote:

> I have a problem with writing with "Fl_Multiline_Output"
> when i use a "message" function it does not work, i do not know  
> why ???

I assume this code is cut down from something else as an example?

The reason I ask, is that you are never calling your "message"  
function anywhere in this example, which I guess is why it does not  
work here... It is not clear where it is meant to be getting called.

> also anybody have an idea about how i can use FL_aler FL_message
> how can i use these if i have a specific conditions ???

Sorry, I don't understand this question.

Anyway - some comments on your code follow (but nothing helpful to  
your problem, I think.) I assume all the oddities I picked up on are  
because you have cut this down from some more complex code.


> void clear_text()
> {
> extern Fl_Multiline_Output *text_output;

This line seems redundant, and possibly confusing - text_output is  
already in scope at this point.


> void message()
> {
>    extern Fl_Multiline_Output *text_output;
>     extern Fl_Button *button;
>    extern void clear_text();

All these extern lines seem redundant - the widgets referenced are  
already in scope at this point.


>    int window_width  = GetSystemMetrics(SM_CXFULLSCREEN); // this  
> is the area available for the window on the screen
>    int window_height = GetSystemMetrics(SM_CYFULLSCREEN);
>    int border_width  = GetSystemMetrics(SM_CXSIZEFRAME);
>    int border_height = GetSystemMetrics(SM_CYSIZEFRAME);

These lines are all win32 specific and initially meant I could not  
build your example. There are portable fltk equivalents, so you  
should really use those instead.


>    printf("%d %d",window_width,border_width);

And there's a '\n' missing from that print statement, I'd suggest!


>   Fl_Box b(10,45,380,380); ::b = &b;

Ooh, yuck - I don't like that style of declaring variables with the  
"same name" that ostensibly refer to the same object... What's wrong  
with just

        b = new Fl_Box(...

and losing the "local" reference entirely?


>   extern Fl_Button *button;

Again, this extern seems inappropriate.

>   extern Fl_Input *input;

   ...

>


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

Reply via email to