Elbers, H.P.
2008-Sep-23 14:30 UTC
[fxruby-users] TEXT_AUTOSCROLL option in FXText does not work?
I think the TEXT_AUTOSCROLL option in FXText does not work (last line is
not visible)...
Version: 1.6.16
Example code:
#!/usr/bin/env ruby
require ''fox16''
include Fox
class Scroller < FXMainWindow
def initialize(app)
super(app, "Test", :opts => DECOR_ALL, :width => 800,
:height =>
400)
FXButton.new(self, "Go!!!").connect(SEL_COMMAND, method(:onGo))
@out = FXText.new(self, :opts =>
TEXT_AUTOSCROLL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
end
def create
super
show(PLACEMENT_SCREEN)
end
def onGo(sender, sel, ptr)
100.times do |i|
@out.appendText "line #{i}\n"
end
return 1
end
end
application = FXApp.new(''Scroller'', ''Test'')
Scroller.new(application)
application.create
application.run
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20080923/67a82cd2/attachment.html>
Lyle Johnson
2008-Sep-23 15:03 UTC
[fxruby-users] TEXT_AUTOSCROLL option in FXText does not work?
On Tue, Sep 23, 2008 at 9:30 AM, Elbers, H.P. <H.P.Elbers at boskalis.nl> wrote:> I think the TEXT_AUTOSCROLL option in FXText does not work (last line is not > visible)...You are correct. Jeroen has recently indicated that TEXT_AUTOSCROLL is not actually implemented; see: http://www.nabble.com/TEXT_AUTOSCROLL-in-FXText-with-usage-of-FXDataTarget-td19433983.html I will probably remove that option from the documentation for FXText until it''s actually working. Hope this helps, Lyle
Melton, Ryan
2008-Sep-23 15:06 UTC
[fxruby-users] TEXT_AUTOSCROLL option in FXText does not work?
Here is the code I use to implement auto scroll:
text = text_widget.output.text
vis_position = text.length - 1
(text.length - 2).downto(0) do |index|
if text[index..index] == "\n"
vis_position = index + 1
break
end
end
text_widget.output.makePositionVisible(vis_position)
Ryan
-----Original Message-----
From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at
rubyforge.org] On Behalf Of Lyle Johnson
Sent: Tuesday, September 23, 2008 9:04 AM
To: fxruby-users at rubyforge.org
Subject: Re: [fxruby-users] TEXT_AUTOSCROLL option in FXText does not work?
On Tue, Sep 23, 2008 at 9:30 AM, Elbers, H.P. <H.P.Elbers at boskalis.nl>
wrote:
> I think the TEXT_AUTOSCROLL option in FXText does not work (last line is
not
> visible)...
You are correct. Jeroen has recently indicated that TEXT_AUTOSCROLL is
not actually implemented; see:
http://www.nabble.com/TEXT_AUTOSCROLL-in-FXText-with-usage-of-FXDataTarget-td19433983.html
I will probably remove that option from the documentation for FXText
until it''s actually working.
Hope this helps,
Lyle
_______________________________________________
fxruby-users mailing list
fxruby-users at rubyforge.org
http://rubyforge.org/mailman/listinfo/fxruby-users
This message and any enclosures are intended only for the addressee. Please
notify the sender by email if you are not the intended recipient. If you are
not the intended recipient, you may not use, copy, disclose, or distribute this
message or its contents or enclosures to any other person and any such actions
may be unlawful. Ball reserves the right to monitor and review all messages
and enclosures sent to or from this email address.