From: Christian Boos Date: 2002-06-11T23:17:23+09:00 Subject: RE: ruby-qt3 proposal (c++ based extensions) Stepping into the discussion... > -----Original Message----- > From: Martin Man [mailto:Martin.Man@seznam.cz] > Sent: Tuesday, June 11, 2002 3:45 PM > To: ruby-talk ML > Subject: Re: ruby-qt3 proposal (c++ based extensions) > ... > > Additionally, I would like to see a more intuitive handling of > properties, > > i.e., > > all the methods setXXX could be renamed to XXX=, > You can do something like the following on top of the extension: module Qt2 class QObject def setProperties hash for k,v in hash prop = k.to_s send "set#{prop[0..0].upcase}#{prop[1..-1]}", v end end alias config setProperties end end Example code: action = QAction.new win, name action.config :menuText => "Window", :statusTip => "Creates a new workspace window", :toolTip => "Create new main window", :accel => (CTRL+Key_N) This is what I do for Qt2. BTW, I like this thread very much :) -- Christian