GtkD: Best way to get TreeStore out of TreeView.Model
Alex Horvat
alexh at gmail.com
Thu Jun 20 17:27:39 PDT 2013
On Thursday, 20 June 2013 at 17:44:18 UTC, Mike Wey wrote:
> On 06/20/2013 07:53 AM, Alex Horvat wrote:
>>>
>>> I seem to have missed a few cases in the last commit, would
>>> you mind
>>> trying again?
>>>
>>> https://github.com/gtkd-developers/GtkD/commit/7e95380bbb4f569c95fc9435711e1f2ec73122fe
>>>
>>
>> Sorry, no changes - still getting the same errors as before.
>
> Does this code run successfully for you?
>
> ----
> import gtk.Main;
> import gtk.TreeStore;
> import gtk.TreeView;
>
> void main(string[] args)
> {
> Main.init(args);
>
> TreeStore ts = new TreeStore([GType.STRING, GType.STRING]);
> TreeView tv = new TreeView();
>
> tv.setModel(ts);
>
> TreeStore store = cast(TreeStore)tv.getModel();
>
> assert(store !is null);
> store.getNColumns();
> }
> ----
Yes, and I did writeln(store) and the result was a treestore so
this code works fine.
Yet still my code doesn't work even though it's effectively doing
the same thing, kind of weird.
More information about the Digitalmars-d-learn
mailing list