Bizarre compile error in GtkD

Chris via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 30 04:32:32 PDT 2014


On Sunday, 29 June 2014 at 20:28:23 UTC, Evan Davis wrote:
> Hello, I have a compile error when trying to use GtkD 2.3.3. 
> When I try to create a FileChooseDialog, I call
>
> new FileChooserDialog("Save File",
>                       
> editor.drawingArea.getParent().getParentWindow(),
>                       FileChooserAction.SAVE,
>                       ["OK", "Cancel"],
>                       [GtkResponseType.OK, 
> GtkResponseType.CANCEL]);
>
> When I do this, I get the error
>
> Error: constructor gtk.FileChooserDialog.FileChooserDialog.this 
> (GtkFileChooserDialog* gtkFileChooserDialog) is not callable 
> using argument types (string, Window, GtkFileChooserAction, 
> string[], GtkResponseType[])
>
> To test why I was getting this error, because there should be 
> another constructor with that signature. After commenting out 
> the one value constructor, I get the error
>
> Error: constructor gtk.FileChooserDialog.FileChooserDialog.this 
> (string title, Window parent, GtkFileChooserAction action, 
> string[] buttonsText, GtkResponseType[] responses) is not 
> callable using argument types (string, Window, 
> GtkFileChooserAction, string[], GtkResponseType[])
>
> I have no idea how this error exists. Can anyone help me fix it?
>
> -Evan Davis

That looks weird. The documentation says:

this(GtkFileChooserDialog* gtkFileChooserDialog);
     Sets our main struct and passes it to the parent class

this(string title, Window parent, FileChooserAction action, 
string[] buttonsText = null, ResponseType[] responses = null);
     Creates a new GtkFileChooserDialog. This function is 
analogous to gtk_dialog_new_with_buttons(). Since 2.4

     Params:
     string title 	Title of the dialog, or NULL
     Window parent 	Transient parent of the dialog, or NULL
     FileChooserAction action 	Open or save mode for the dialog
     string[] buttonsText 	text to go in the buttons
     ResponseType[] responses 	response ID's for the buttons

     Throws:
     ConstructionException GTK+ fails to create the object.

Dunno if it's the ResponseType vs GtkResponseType

(http://api.gtkd.org/src/gtk/FileChooserDialog.html)


More information about the Digitalmars-d-learn mailing list