I try to create a tkEntry with a tkVariable attached in the class
startupinterface and create a callback to startupinterfacecontroller but
it doesn’t work : it says that themember variable supposed to hold a
link to the tkVariable object is nil:nilClass when i try to call the
value member function
From: Cristian A. [email protected]
Subject: ruby tkentry tkvariable with class wrappers problem
Date: Tue, 24 Mar 2009 04:43:01 +0900
Message-ID: [email protected]
it doesn’t work : it says that themember variable supposed to hold a
link to the tkVariable object is nil:nilClass when i try to call the
value member function
Hmmm…
You may be misunderstanding about a block given to .new.
And, your code has a problem about accessing a TkVariable object.
Such block is evaluated with “instance_eval”.
That is, at internal of the block, “self” is the widget created by
“new” method. So, @files_location_text in the block is a instance
variable of the entry widget.
There are two ways to avoid this problem.
The one is to use a local variable.
And another is to use a Hash argument.
when I try to change the value of the tkvariable member variable with
the value member function of tkvariable it doesn’t work : it says
nil:NilClass when pressing the button change_entry_text
I try to change the value of the initial entry/tkvariable by using the
value of a new one or possibly the value supplied by any external class
that has a reference
From: Cristian A. [email protected]
Subject: Re: ruby tkentry tkvariable with class wrappers problem
Date: Tue, 24 Mar 2009 07:00:24 +0900
Message-ID: [email protected]
when I try to change the value of the tkvariable member variable with
the value member function of tkvariable it doesn’t work : it says
nil:NilClass when pressing the button change_entry_text