Author: kkaempf Date: Mon Apr 14 06:44:42 2008 New Revision: 46495 URL: http://svn.opensuse.org/viewcvs/yast?rev=46495&view=rev Log: fix widget compare: make selection_box1 work Modified: trunk/libyui-bindings/swig/ruby/examples/selection_box1.rb trunk/libyui-bindings/swig/yui.i Modified: trunk/libyui-bindings/swig/ruby/examples/selection_box1.rb URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/ruby/examples/selection_box1.rb?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- trunk/libyui-bindings/swig/ruby/examples/selection_box1.rb (original) +++ trunk/libyui-bindings/swig/ruby/examples/selection_box1.rb Mon Apr 14 06:44:42 2008 @@ -9,6 +9,7 @@ class LoadTest < Test::Unit::TestCase def test_selection_box1 require 'yui' + Yui::YUILog::set_log_file_name "/tmp/libyui-examples.log" Yui::YUILog::enable_debug_logging @@ -30,7 +31,7 @@ valueField.set_stretchable Yui::YD_HORIZ, true # // allow stretching over entire dialog width valueButton = Yui::YUI::widget_factory.create_push_button hbox, "&Value" - + Yui::YUI::widget_factory.create_vspacing vbox, 0.3 rightAlignment = Yui::YUI::widget_factory.create_right vbox @@ -43,6 +44,7 @@ loop do event = dialog.wait_for_event next unless event + break if event.event_type == Yui::YEvent::CancelEvent # window manager "close window" button valueField.set_value "???" break if event.widget == closeButton @@ -56,9 +58,10 @@ valueField.set_value "<none>" end end + event = nil end - dialog.destroy +# dialog.destroy end end Modified: trunk/libyui-bindings/swig/yui.i URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/yui.i?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- trunk/libyui-bindings/swig/yui.i (original) +++ trunk/libyui-bindings/swig/yui.i Mon Apr 14 06:44:42 2008 @@ -87,4 +87,17 @@ %include YLabel.h %include YPushButton.h %include YAlignment.h -%include YItem.h \ No newline at end of file +%include YItem.h + +%extend YEvent { + VALUE mywidget() { return INT2FIX( $self->widget() ); } +} + +%extend YWidget { +#ifdef SWIGRUBY + %rename( "==" ) equals( YWidget *w ); + %typemap(out) int equals + "$result = ($1 != 0) ? Qtrue : Qfalse;"; +#endif + int equals( YWidget *w ) { return ($self == w ); } +} \ No newline at end of file -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org