Passing a string pointer to tree view model?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing a string pointer to tree view model?

ZuLuuuuuu
Hello,

I was trying to get the value of the selected tree view cell via #get:varargs: method:

http://library.gnome.org/devel/gtk/stable/GtkTreeModel.html#gtk-tree-model-get

I have a tree model built with {GValue gTypeString}. In C I need to pass a pointer like &my_string considering that my_string is of type gchar*.

How can I get the string value in GST by using #get:varargs: (or any other method)?
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: Passing a string pointer to tree view model?

Paolo Bonzini-2
On 08/27/2010 09:30 AM, ZuLuuuuuu wrote:

>
> Hello,
>
> I was trying to get the value of the selected tree view cell via
> #get:varargs: method:
>
> http://library.gnome.org/devel/gtk/stable/GtkTreeModel.html#gtk-tree-model-get
>
> I have a tree model built with {GValue gTypeString}. In C I need to pass a
> pointer like&my_string considering that my_string is of type gchar*.
>
> How can I get the string value in GST by using #get:varargs: (or any other
> method)?

Smalltalk Strings are automatically converted to char *.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Passing a string pointer to tree view model?

ZuLuuuuuu
Paolo Bonzini-2 wrote
Smalltalk Strings are automatically converted to char *.

Paolo
myString := String new.
myListStore get: iter varargs: {0. myString. -1.}.

gives an empty string back (I checked the iterator via #iterIsValid message). My mistake might be somewhere else, just wanted to make sure the code part in which I am getting the value, is right.
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: Passing a string pointer to tree view model?

MrGwen
We should port, the model refactoring that I've done inside a package
for gst, Canol if you want you can look a bit a GtkMethodWidget.st
in gst-visualgst.

Gwen

On Fri, Aug 27, 2010 at 10:57 AM, ZuLuuuuuu <[hidden email]> wrote:

>
>
> Paolo Bonzini-2 wrote:
>>
>> Smalltalk Strings are automatically converted to char *.
>>
>> Paolo
>>
>
> myString := String new.
> myListStore get: iter varargs: {0. myString. -1.}.
>
> gives an empty string back (I checked the iterator via #iterIsValid
> message). My mistake might be somewhere else, just wanted to make sure the
> code part in which I am getting the value, is right.
>
> -----
> Canol Gökel
> --
> View this message in context: http://forum.world.st/Passing-a-string-pointer-to-tree-view-model-tp2340709p2340796.html
> Sent from the Gnu mailing list archive at Nabble.com.
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
>

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk