Re: [fltk.general] Clickable URLs in text

2012-02-19 Thread Johan R
I was making sure last line was visible when appending a new line if the last 
line was already visible. When i got a few hundred lines i noticed my app took 
increasingly more cpu appending new lines. From a user perspective it was fine 
but i was not happy with cpu usage (i went with fltk for fast and light).
I have to admit that i did not examine if there was a better way than 
show_insert_position to do this.

___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-02-15 Thread MacArthur, Ian (SELEX GALILEO, UK)

 I replaced Fl_Text_Display with a specialized Fl_Browser for now.
 For now i just check for http:// links when i double-click a row and use
 xdg-open to open that link in browser.

For actually opening the link, fl_open_uri() might help - it works on non-xdg 
platforms too, but essentially does xdg-open on linux-like hosts...




SELEX Galileo Ltd
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
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-02-15 Thread Greg Ercolano
On 02/14/12 23:34, Johan R wrote:
 I am very happy with performance now, the performance was horrible when my 
 previous Fl_Text_Display contained lots of text.

I'm curious:

What specifically was slow in Fl_Text_Display (scrolling, adding 
text, parsing..)
How much text (approx) was involved?
Which FLTK version are you using? (1.3.0, 1.3.x svn current, 1.3.x 
r..)

I've had really good performance with Fl_Text_Display on large files.
Just now my Fl_Text_Display widget loaded a 4MB text file with 65000 
lines
in under a second over a network connection, and I can scroll back and 
forth
from one end of the file insanely fast.. it could not be faster.
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-02-14 Thread Johan R
Fyi,
I replaced Fl_Text_Display with a specialized Fl_Browser for now.
For now i just check for http:// links when i double-click a row and use 
xdg-open to open that link in browser.

I am very happy with performance now, the performance was horrible when my 
previous Fl_Text_Display contained lots of text.


___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-01-20 Thread Johan R
Thanks all for replying.
I saw your replies now since i did expect a mail telling me i got replys ... 
seems this is a very primitive forum :).

I am using a Fl_Text_Display to display a game lobby chat log, often http URLs 
are written by the host in this chat log and i want to make it easy for the 
user to go to these web pages.

Sounds like i will have to specialize Fl_Text_display or perhaps make my own 
widget.
I have considered making my own widget since i feel Fl_Text_Display is a bit of 
a cpu hog.
Any ideas are very welcome.


___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-01-20 Thread Edzard Egberts
Johan R schrieb:
 seems this is a very primitive forum
 :).

This is not a forum, but a newsgroup. A forum is the very primitive 
successor of a newsgroup, designed to be usable by every ordinary 
person, who can click around with a browser.

 I have considered making my own widget since i feel
 Fl_Text_Display is a bit of a cpu hog. Any ideas are very welcome.

Maybe you should start realising it?
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-01-20 Thread MacArthur, Ian (SELEX GALILEO, UK)

 Thanks all for replying.
 I saw your replies now since i did expect a mail telling me i 
 got replys ... seems this is a very primitive forum :).

It's not a forum at all - it's a web view of a mailing list.
If you want email notifications of messages, subscribe to the mailing
list.


 I am using a Fl_Text_Display to display a game lobby chat 
 log, often http URLs are written by the host in this chat 
 log and i want to make it easy for the user to go to these web pages.
 
 Sounds like i will have to specialize Fl_Text_display or 
 perhaps make my own widget.
 I have considered making my own widget since i feel 
 Fl_Text_Display is a bit of a cpu hog.
 Any ideas are very welcome.

I don't think I'd use a text display for that at all, I think I'd use a
Fl_Browser, and derive from that to get the desired behaviour.
Though if you need anything more than very basic text handling, maybe
Fl_Text_* is the way to go.

That said, IIRC Greg had an example of a simple chat widget on his
cheat-sheet, maybe that might be useful to you?

I'm surprised you think it's a CPU hog - it's derived form the old nedit
codebase, and is generally OK.
Do you have metrics showing the loading and utilisation. That might
indentify where the CPU is going?


SELEX Galileo Ltd
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
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-01-20 Thread Greg Ercolano
On 01/20/12 05:04, MacArthur, Ian (SELEX GALILEO, UK) wrote:
 I have considered making my own widget since i feel 
 Fl_Text_Display is a bit of a cpu hog.
 Any ideas are very welcome.
 
 I don't think I'd use a text display for that at all, I think I'd use a
 Fl_Browser, and derive from that to get the desired behaviour.
 Though if you need anything more than very basic text handling, maybe
 Fl_Text_* is the way to go.


 That said, IIRC Greg had an example of a simple chat widget on his
 cheat-sheet, maybe that might be useful to you?

Hmm, don't think I made a chatter in FLTK.

I did make a telnet based chat: 
http://seriss.com/people/erco/unixtools/talkerco
and a browser based web chat: 
http://seriss.com/people/erco/unixtools/chatter

Perhaps you're thinking of a dumb terminal emulator
that lets one type commands that run in a shell and
see the stdout/err of the commands in an FLTK window:
http://seriss.com/people/erco/fltk/#SimpleTerminal

In that case I did use Fl_Text_Editor.
I haven't really seen cpu issues with it, but I suppose
it depends how you make use of it.

I see the subject of this thread being URLs in text,
which might mean the FLTK html widget is involved.
That may have speed issues, as I think it has to re-parse
everything when changes are made.

If I needed a chat program that allowed URLs to be
automatically clickable, hmm, yeah, might have to customize
Fl_Text_* to do that.

___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Clickable URLs in text

2012-01-06 Thread Richard Sanders
On Fri, 06 Jan 2012 13:52:25 -0800, Ian MacArthur
imacart...@gmail.com wrote:

On 6 Jan 2012, at 13:55, Albrecht Schlosser ajs856s...@go4more.de wrote:

 On 06.01.2012 01:01, Johan R wrote:
 
 I am using fltk 1.3 and have searched for how to make clickable links in 
 e.g. Fl_Text_Display but havent found anything.
 Is there a way to make clickable links in text ?
 
 No, there's no way, at least not in Fl_Text_Display.
 
 The only widget supporting clickable links I know about is
 Fl_Help_View, a somewhat limited HTML display widget. Maybe
 this is what you need.
 
 Otherwise, you'd have to derive your own widget(s) to allow
 clickable links. I'm thinking of deriving from Fl_Box to make
 the label inside the box clickable. You may need to make your
 own draw() method (or maybe not), and you can do highlighting
 when the cursor is over the link. However, this needs some
 programming in the handle() method of the derived widget.
 
 If you need more help on this, please describe better what you
 want to do, maybe we can then find a better way to achieve it.

There were some add-on widget sets (I'm thinking of FLU  maybe Matt's FL_MM 
stuff) that provided buttons that appeared as clickable links but, as 
Albrecht said, I think the only widget we have for doing this in body-text is 
the help_view.

As an aside, once you have your link working, the fl_open_uri() functions 
might be useful - or not, depending on what you really want to do!

I just did a quick and dirty test on Fl_Button, just set
button-box(FL_NO_BOX); and also the callback to .
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk