|
||||||||
l_object.rb - contains the Lobject class which is the base class for all Locana objects.
Author: Michael Davis, mdavis@locana.org
Copyright: (C) 2000, 2001, 2002 Seva Inc. and Seva Software - www.sevasoftware.com
Home page: www.locana.org
License: Same as Ruby
This module contains the Lobject class. Most other locana classes are based on this class. See locana.rb for more information.
Most Locana objects have many instance methods. Here are some interesting notes about instance methods for all objects in Locana. There are several major categories of methods:
object.on_key_press = {|event| puts event} will be executed for every key_press on object
object.on_key_press {|event| puts event} providing blocks to event also works
object.on_key_press({:keycode=>32}) will fire the on_key_press event for object
p = object.:on_key_press() triggers the binding for the :on_key_press event of object
p = object[:on_key_press] will retrieve the binding for the :on_key_press event of object
win = Lwindow.new('TestEditBox', :pos=>[60, 60, 0, 0], :text=>'Test EditBox') {
label('l_label', :sticky=>:nw, :label=>'Type some text')
textbox('t_text', :sticky=>:nw, :after=>:prev)
button('b_ok', :sticky=>:se, :text => 'Ok')
b_ok.on_click = proc {|levent| close} # this button will close the form
b_ok.text = 'Okay' # changes the text in the button
}
win.b_ok.on_click = proc {|levent| close} # this also works
win.b_ok.text = 'Okay'
When adding methods to new objects that you create, you will need to make sure you don’t use method names that could conflict with other locana methods or attributes including any future attributes. If you run your applet with -w or -d you should see any method redefinitions. It would be wise to review these carefully because it can tell you if you accidently replaced an locana method with one of your own.
Status
Todo
| Classes and Modules |
| Seva Software |
Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.