okay i have a program that has a widget called textfield1 (the default name for the textfield).
My main program worked fine then I added in a login screen it too had a textfield1 textfield widget I had an unintended side effect so elected to change the name of testfield1 in my login screen to text password (recomplied the foxGUI and saved it & the layout), this solved the unintended side effect but tonight I got an error (that is shown below).
Note: I also changed associated names within the event handling code I had written.
here is the error code
>ruby mymainwin.rb mymainwin.rb:18:in `init': undefined method `connect' for nil:NilClass (NoMethodError) from ./Login_screen.rb:6:in `initialize' from mymainwin.rb:9:in
`initialize' from mymainwin.rb:51:in `new' from mymainwin.rb:51 >Exit code: 1
and when i commented out the require line & line which calls the login screen to appear the program worked, I then removed the comments and it fails again.
some of the scource code is below.
this is the main program require 'sqlite3_calls.rb' require 'monitordxlog_evnts' require 'monitorscreen' require 'Login_events' <<<< comment this out
class Fxwindow_code < MainWindow
def initialize(parent) super @mydb = Dbase.new @dialog = Mondialog.new @topwin Login_events.new Login_events <<< comment this out end
#dialog =
FOX::FXDialogBox.new( mainwindow) # or FX::DialogBox.new(mainwindow) def init @textfield1.connect(Fox::SEL_KEYRELEASE){ the two lines with <<<< to the right if commented out will not generate the error.
This is the class code for the login screen I added last night (it worked after the changes where saved but fails tonight).
require 'Login_screen'
class Login_events < MainWindow
def initialize (parent) super end def checkoutpassword(theword) if theword != 'Iamtheone' 'Invalid Entry!' end end def init @textpassword.setFocus
@textpassword.connect(Fox::SEL_COMMAND){ @topwin.title = checkoutpassword @textpassword.text if @topwin.title == 'Invalid Entry!' @passwordlabel.text = "System Login Screen" @textpassword = '' end } @button1.connect(Fox::SEL_COMMAND){ @topwin.title = checkoutpassword @textpassword.text } end end
what is or has happened to cause this to occur? what can i do to permainately solve this conflict?
Dave.
|
Email slow, clunky, unreliable?
Switch to Yahoo!Xtra Mail, New Zealand's new email address.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users