MacArthur, Ian (SELEX GALILEO, UK) wrote:
>> my question is say i have text editor component with size
>> of
>> h = 30
>> w = 40
>> and im wrap mode with scrolls disabled, how can i detect when i typing
>> text its reaching to the end of the size defined that is h = 30
>> then it will stop me from typing .
> 
> Meir,
> 
> For a small input widget, I suspect that the Fl_Text_Editor widget is
> possibly too complex to use. It can be quite tricky to use, and the
> things you want to do (clamping the input size etc.) could be awkward to
> implement.

        If Fl_Text_Editor proves to be too complex, try Fl_Multiline_Input
        which gives you pretty much the same functionality with no scrollbars.

        I would think you can identify the line you're interested in, and
        just use strlen() on each keypress to determine if you've gotten
        close to the limit you want.. if using a fixed width font, the
        number of chars that can fit horizontally and vertically should be
        somewhat predictable.

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

Reply via email to