I would have posted this in the Gtkd forum, but it has been down for a while.

I'm porting a GTK2/C program to Gtkd. I'm trying to read the data from a GtkSourceView, but when I try to get the bounds, it's always zero.

Here's the c version that works:
        GtkSourceBuffer *bf;
        GtkTextIter start, end;
        int len;

        bf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w.mainTxt));
        gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER(bf), &start, &end);
data = gtk_text_buffer_get_text (GTK_TEXT_BUFFER(bf), &start, &end, FALSE);

Here's what I tried in D:
        SourceBuffer bf;
        auto start = new TextIter();
        auto end = new TextIter();

        bf = this.mainTxt.getBuffer ();
        bf.getBounds (start, end);
        string str = bf.getText (start, end, false);

getBounds is defined as: getBounds(out TextIter start, out TextIter end)

Is there something I'm doing wrong?
Any suggestions on what else to try?


Reply via email to