> 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.

I think you really would be better off deriving your own input widget
that would give you full control of the layout and format of the text,
and (as Duncan suggested) making use of fl_measure() and
fl_text_extents() to ensure the text fits correctly in your box.

I was going to suggest that you look at my terminal widget
(http://www.9edgedown.talktalk.net/flterm.html) but looking at the code
it is really badly written and quite confusing so that might not be a
good example!

I thought Greg had an example of a "chat" widget
(http://www.seriss.com/people/erco/fltk/) but it seems not - still, his
examples and tutorial videos are very good and worth a look anyway of
you are getting started with fltk.

Hope that helps,
-- 
Ian


SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to