Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listSG/listG toArray() method bug #123

passenger94 opened this issue Aug 23, 2015 · 0 comments

listSG/listG toArray() method bug #123

passenger94 opened this issue Aug 23, 2015 · 0 comments


Copy link

Hi ladies and gentlemen, thanks for your work !
i think i might have found a bug :

when transforming a listSG of PixbufFormat to an Array, iterating over gives only the first element in the list (tried with each, map, foreach and for)
demo app

import  std.algorithm, std.string;
import  gtk.Main, gtk.Window, gtk.Label, gdkpixbuf.Pixbuf;

class ViewWindow : Window
  this() {
    super("listSG bug Demo");
    setSizeRequest(400, 300);
    auto label = new Label("");

    auto pixbuf = new Pixbuf(Colorspace.RGB, false, 8, 100, 100);
    string[] validexts;

    import gdkpixbuf.PixbufFormat;

    /* I got only the first element of the Array, repeatedly ...
     * in glib.listSG, line 93 : must be "list =;" not "list = next();"
     * most probably the same in glib.ListG, line 106
     * related to "" around 26" ??
    pixbuf.getFormats.toArray!PixbufFormat[1..$].each!( el => validexts ~= el.getExtensions );

    label.setText(format("%s", validexts));

resolved by changing list = next(); to list =; in toArray method of glib.listSG

sorry i don't have the time now to do the install everything/pullrequest dance

dmd 2.068, gtkd 3.1.4, ubuntu 14.04, gtk3 3.10
build with dub :

    "name": "listsgbug",
    "dependencies": {
        "gtk-d": "~>3.1.4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant