In Ruby/Tk, is there an easy way to check whether a widget supports
setting variable or textvariable? respond_to? does not work.
···
--
Posted via http://www.ruby-forum.com/.
In Ruby/Tk, is there an easy way to check whether a widget supports
setting variable or textvariable? respond_to? does not work.
--
Posted via http://www.ruby-forum.com/.
Message-ID: <36c3d1aafd4a8f769d4030cc99a4515c@ruby-forum.com>
In Ruby/Tk, is there an easy way to check whether a widget supports
setting variable or textvariable? respond_to? does not work.
1. catch RuntimeError on TkWindow#cget or TkWindow#[] or TkWindow#configinfo.
If raised, the widget doesn't support the option.
2. check keys of a Hash returned by TkWindow.current_configinfo.
e.g. TkButton.new.current_configinfo.keys.find{|opt| opt =~ /variable/}
From: "Martin C." <mydoghasworms@gmail.com>
Subject: tk widget: variable or textvariable
Date: Wed, 8 Dec 2010 04:27:22 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
Department of Artificial Intelligence, Kyushu Institute of Technology