# Foxruby codes clarification please!

**URL:** <https://www.ruby-forum.com/t/foxruby-codes-clarification-please/52542>\
**Category:** Ruby\
**Created:** [January 16, 2006, 6:51am UTC](https://www.ruby-forum.com/t/foxruby-codes-clarification-please/52542 "2006-01-16T06:51:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohsena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@mohsena](https://www.ruby-forum.com/u/mohsena)\
**Post date:** [January 16, 2006, 6:51am UTC](https://www.ruby-forum.com/t/foxruby-codes-clarification-please/52542/1 "2006-01-16T06:51:36Z")

</div>

Hello this is a ruby example that present a

list of customers form external source

(customer.rb) in a fox ruby tutorials:  
require ‘rubygems’  
require\_gem ‘fxruby’  
require ‘customer’

include Fox

class ClipMainWindow \< FXMainWindow  
def initialize(anApp)  
# Initialize base class first  
super(anApp, “Clipboard Example”, nil,

nil, DECOR\_ALL, 0, 0, 400, 300)

```
# Place the list in a sunken frame
sunkenFrame = FXVerticalFrame.new(self,

```

LAYOUT\_FILL\_X|LAYOUT\_FILL\_Y|FRAME\_SUNKEN|FRAME

\_THICK,  
0, 0, 0, 0, 0, 0, 0, 0)

```
# Customer list
customerList = FXList.new(sunkenFrame,

```

nil, 0,

LIST\_BROWSESELECT|LAYOUT\_FILL\_X|LAYOUT\_FILL\_Y)  
$customers.each do |customer|  
customerList.appendItem(customer.name,

nil, customer)  
end  
end

def create  
super  
show(PLACEMENT\_SCREEN)  
end  
end

if **FILE** == $0  
FXApp.new(“ClipboardExample”, “FXRuby”) do

|theApp|  
ClipMainWindow.new(theApp)  
theApp.create  
theApp.run  
end  
end

and this is customer.rb:

# customer.rb

Customer = Struct.new(“Customer”, :name,

:address, :zip)

$customers = []  
$customers \<\< Customer.new(“Reed Richards”,

“123 Maple, Central City, NY”, 010111)  
$customers \<\< Customer.new(“Sue Storm”, "123

Maple, Anytown, NC", 12345)  
$customers \<\< Customer.new("Benjamin J.

Grimm", “123 Maple, Anytown, NC”, 12345)  
$customers \<\< Customer.new(“Johnny Storm”,

“123 Maple, Anytown, NC”, 12345)

I have two question what does this part of the

codes actualy do?  
def create  
super  
show(PLACEMENT\_SCREEN)  
end  
end

and second what does this part of the codes

do?  
if **FILE** == $0  
FXApp.new(“ClipboardExample”, “FXRuby”) do

|theApp|  
ClipMainWindow.new(theApp)  
theApp.create  
theApp.run  
end  
end  
sincerely yours Mohsena
