# Ruby FX problem

**URL:** <https://www.ruby-forum.com/t/ruby-fx-problem/113702>\
**Category:** Ruby\
**Created:** [September 4, 2007, 3:59am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702 "2007-09-04T03:59:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [September 4, 2007, 3:59am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702/1 "2007-09-04T03:59:43Z")

</div>

How can i build scroll bar in my GUI project??? How to use the  
FXScrollWindow???

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [September 4, 2007, 4:18am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702/2 "2007-09-04T04:18:42Z")

</div>

Cool W. wrote:

> How can i build scroll bar in my GUI project??? How to use the  
> FXScrollWindow???

There is an example that comes with FXRuby that might help you:  
examples/mdi.rb.

If that doesn’t answer your question, come on back and ask it here;  
there’s plenty of folks around who can help.

There’s also the fxruby users list. See [http://www.fxruby.org](http://www.fxruby.org) to find  
out how to subscribe.

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [September 4, 2007, 4:46am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702/3 "2007-09-04T04:46:28Z")

</div>

Joel VanderWerf wrote:

> Cool W. wrote:
> 
> > How can i build scroll bar in my GUI project??? How to use the  
> > FXScrollWindow???
> 
> There is an example that comes with FXRuby that might help you:  
> examples/mdi.rb.
> 
> If that doesn’t answer your question, come on back and ask it here;  
> there’s plenty of folks around who can help.
> 
> There’s also the fxruby users list. See [http://www.fxruby.org](http://www.fxruby.org) to find  
> out how to subscribe.

Ya, i can find the example, thanks for example. But there more  
complex… Any simple example for me???

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [September 4, 2007, 5:12am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702/4 "2007-09-04T05:12:46Z")

</div>

Cool W. wrote:

> > There’s also the fxruby users list. See [http://www.fxruby.org](http://www.fxruby.org) to find  
> > out how to subscribe.
> 
> Ya, i can find the example, thanks for example. But there more  
> complex… Any simple example for me???

Sure, this one is about as simple as I can make it:

require ‘fox16’

include Fox

class ScrollWindow \< FXMainWindow  
def initialize(\*args)  
super

```
 scroll_window = FXScrollWindow.new(self, 

```

LAYOUT\_FILL\_X|LAYOUT\_FILL\_Y)  
matrix = FXMatrix.new(scroll\_window, 2, MATRIX\_BY\_COLUMNS)  
100.times do |i|  
FXLabel.new(matrix, “foo”)  
FXLabel.new(matrix, “bar”)  
end  
end

def create  
super  
show  
end  
end

class ScrollApp \< FXApp  
def initialize  
super(“Scroll”, “TEST”)  
ScrollWindow.new(self, “Scroll”)  
end  
end

app = ScrollApp.new  
app.create  
app.run

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [September 4, 2007, 6:15am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702/5 "2007-09-04T06:15:50Z")

</div>

Joel VanderWerf wrote:

> Cool W. wrote:
> 
> > > There’s also the fxruby users list. See [http://www.fxruby.org](http://www.fxruby.org) to find  
> > > out how to subscribe.
> > 
> > Ya, i can find the example, thanks for example. But there more  
> > complex… Any simple example for me???
> 
> Sure, this one is about as simple as I can make it:

Ya. I can run and work ur coding. This more easier for me, hehe… Thank  
you very much…
