[Gtk-sharp-list] PATCH: GtkDemo
Mohammad DAMT
md@mt.web.id
Fri, 05 Mar 2004 10:57:43 +0700
--=-jbPKFyZEiDy8R2latO8M
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
this patch is for completing DemoImages section (progressif image
loading stuff) on GtkDemo plus some fixes on DemoColorSelection and
DemoDrawingArea due to recent API changes.
--
Mohammad DAMT <mdamt@bisnisweb.com>
http://www.bisnisweb.net ASP.Net Linux web hosting
--=-jbPKFyZEiDy8R2latO8M
Content-Disposition: attachment; filename=GtkDemo.patch
Content-Transfer-Encoding: base64
Content-Type: text/x-patch; name=GtkDemo.patch; charset=
ZGlmZiAtdSBHdGtEZW1vL0RlbW9Db2xvclNlbGVjdGlvbi5jcyBHdGtEZW1vLi9EZW1vQ29sb3JT
ZWxlY3Rpb24uY3MNCi0tLSBHdGtEZW1vL0RlbW9Db2xvclNlbGVjdGlvbi5jcwkyMDA0LTAyLTEx
IDAzOjM1OjQwLjAwMDAwMDAwMCArMDcwMA0KKysrIEd0a0RlbW8uL0RlbW9Db2xvclNlbGVjdGlv
bi5jcwkyMDA0LTAzLTA0IDIyOjQzOjIxLjAwMDAwMDAwMCArMDcwMA0KQEAgLTY5LDcgKzY5LDcg
QEANCiAJCXByaXZhdGUgdm9pZCBFeHBvc2VFdmVudENhbGxiYWNrIChvYmplY3QgbywgRXhwb3Nl
RXZlbnRBcmdzIGFyZ3MpDQogCQl7DQogCQkJRXZlbnRFeHBvc2UgZXZlbnRFeHBvc2UgPSBhcmdz
LkV2ZW50Ow0KLQkJCUdkay5XaW5kb3cgd2luZG93ID0gZXZlbnRFeHBvc2Uud2luZG93Ow0KKwkJ
CUdkay5XaW5kb3cgd2luZG93ID0gZXZlbnRFeHBvc2UuV2luZG93Ow0KICAJCQlSZWN0YW5nbGUg
YXJlYSA9IGV2ZW50RXhwb3NlLkFyZWE7DQogDQogCQkJd2luZG93LkRyYXdSZWN0YW5nbGUgKGRy
YXdpbmdBcmVhLlN0eWxlLkJ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