napperley
08/25/2019, 2:06 AMtype Nothing? is not supported here: doesn't correspond to any C type
Double checked the mapping (in the knm file) and found that the return type is CPointer<gtk3.GtkWidget>?
for the function (gtk_file_chooser_dialog_new
) that is called in the program. However the function definition looks very odd:
@kotlinx.cinterop.internal.CCall public external fun gtk_file_chooser_dialog_new(@kotlinx.cinterop.internal.CCall.CString title: kotlin.String?, parent: kotlinx.cinterop.CValuesRef<gtk3.GtkWindow /* = gtk3._GtkWindow */>?, action: gtk3.GtkFileChooserAction, @kotlinx.cinterop.internal.CCall.CString first_button_text: kotlin.String?, vararg variadicArguments: kotlin.Any?): kotlinx.cinterop.CPointer<gtk3.GtkWidget /* = gtk3._GtkWidget */>? { /* compiled code */ }
napperley
08/25/2019, 2:12 AMprivate fun createOpenDialog(parent: CPointer<GtkWindow>?) = gtk_file_chooser_dialog_new(
parent = parent,
title = "Open File",
first_button_text = "gtk-cancel",
action = GtkFileChooserAction.GTK_FILE_CHOOSER_ACTION_OPEN,
variadicArguments = *arrayOf(GTK_RESPONSE_CANCEL, "gtk-open", GTK_RESPONSE_ACCEPT, null)
)
msink
08/25/2019, 3:48 AMcinterop
napperley
08/25/2019, 4:09 AMolonho
08/25/2019, 7:59 AMGTK_RESPONSE_CANCEL, "gtk-open", GTK_RESPONSE_ACCEPT, null
as argumentsnapperley
08/25/2019, 9:59 PMgtk_file_chooser_dialog_new
function):
private fun createOpenDialog(parent: CPointer<GtkWindow>?) = gtk_file_chooser_dialog_new(
"Open File",
parent,
GtkFileChooserAction.GTK_FILE_CHOOSER_ACTION_OPEN,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
"gtk-open",
GTK_RESPONSE_ACCEPT,
null
)
Is this the correct way to do it? Ran the project as a program again and the same error message appears:
e: /home/napperley/idea_projects/kpad/src/linuxMain/kotlin/org/example/kpad/Controller.kt: (103, 9): type Nothing? is not supported here: doesn't correspond to any C type
napperley
08/25/2019, 10:02 PMnull
being passed through as a parameter to the C function (gtk_file_chooser_dialog_new
), very strange.svyatoslav.scherbina
08/26/2019, 7:15 AMnull
, e.g. null as COpaquePointer?
.