[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] handling Foo ** C callouts
From: |
Robert Collins |
Subject: |
[Help-smalltalk] handling Foo ** C callouts |
Date: |
Sun, 12 Sep 2004 20:52:21 +1000 |
Some of the GTK API's have signatures like:
gboolean gtk_tree_selection_get_selected (GtkTreeSelection
*selection,
GtkTreeModel **model,
GtkTreeIter *iter);
This is how I have implemented using it:
modelptr:=GTK.GtkTreeModelPointer new.
iter:=GTK.GtkTreeIter new.
(selection getSelected: modelptr iter: iter) ifTrue:
[
|model|
model:=modelptr model value.
... use model.
GtkTreeModelPointer is:
CStruct subclass: #GtkTreeModelPointer
"FIXME: this should be automatically created, or
passing #cObjectPtr should be smarter or something"
declaration: #(
(#model (#ptr #GtkTreeModel))
)
classVariableNames: ''
poolDictionaries: ''
category: 'GTK'
!
It would be nice if the structs.awk file could synthesis types like this
when Foo ** signatures are found.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Help-smalltalk] handling Foo ** C callouts,
Robert Collins <=