[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Gtk connection methods
From: |
Gwenael Casaccio |
Subject: |
[Help-smalltalk] Gtk connection methods |
Date: |
Sat, 09 Jan 2010 11:42:30 +0100 |
Hi Paolo,
again a small patch to improve Gtk binding :).
Just raises an exception if the connection doesn't work.
Gwen
diff --git a/packages/gtk/MoreFuncs.st b/packages/gtk/MoreFuncs.st
index a07ae29..9f17a8a 100644
--- a/packages/gtk/MoreFuncs.st
+++ b/packages/gtk/MoreFuncs.st
@@ -57,6 +57,24 @@ GLib class extend [
^L
GObject extend [
+ connect: name to: handler selector: sel userData: userData [
+ <category: 'C call-outs'>
+
+ | result |
+ (result := self connectSignal: name to: handler selector: sel
userData: userData).
+ result == -1 ifTrue: [ self error: 'Invalid widget passed' ].
+ result == -2 ifTrue: [ self error: 'Invalid event name' ].
+ result == -3 ifTrue: [ self error: 'Invalid selector' ].
+ result == -4 ifTrue: [ self error: 'Too much arguments' ].
+ ^ result
+ ]
+
+ connect: name to: handler selector: sel [
+ <category: 'C call-outs'>
+
+ ^ self connect: name to: handler selector: self userData: nil
+ ]
+
connectSignal: name to: handler selector: sel userData: userData [
<category: 'C call-outs'>
<cCall: 'gstGtkConnectSignal' returning: #int
- [Help-smalltalk] Gtk connection methods,
Gwenael Casaccio <=