Duncan Gibson 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 .
>
> You will need to use fl_measure() in your callback to work out the
> width of the text in pixels and take action appropriately.
..and you can use Fl_Text_Buffer::add_modify_callback()
to set your callback to be invoked whenever the buffer
is modified, so you can do your per-character checks.
There are other ways to check for each character,
such as overriding the handle() method, but probably
add_modify_callback() is best..
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk