After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 141004 - GtkFileChooserDialog use varargs which is difficult for language bindings
GtkFileChooserDialog use varargs which is difficult for language bindings
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.90.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
: 630588 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-04-24 12:05 UTC by Duncan
Modified: 2012-10-09 15:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Duncan 2004-04-24 12:05:14 UTC
The API for creating a new GtkFileChooserDialog or GtkFileChooserWidget use C's
varargs feature and do not provide an alternative.

This feature of C is particularly hard for some language's foreign functions
interfaces. For example Haskell's (otherwise excelent) FFI does not support
varargs at all. In most places in the GTK API where varargs are used (which I
understand is easier for C programmers to use), there is also an alternative API
that is easier for language bindings. GtkFileChooserDialog and
GtkFileChooserWidget provide no alternative.

For the Haskel bindings I have been forced to go look at the code inside the
gtk_file_chooser_(dialog|widget)_new constructor and replicate it as Haskell
code. This is obviously not good from a maintainance point of view.

So a request for an accessable alternative like the rest of GTK provides, for
example see g_object_new () vs g_object_newv ().

BTW, the rest of the GtkFileChooser API is nice and simple to wrap. Well thought
out.
Comment 1 Duncan 2004-04-24 12:40:07 UTC
Oops, GtkFileChooserWidget doen't use varargs. My mistake.
Only GtkFileChooserDialog uses varargs:
gtk_file_chooser_dialog_new
gtk_file_chooser_dialog_new_with_backend
Comment 2 Owen Taylor 2004-04-28 02:30:31 UTC
gtk_dialog_add_button() is all that is needed for a language
binding to provide whatever button-adding-interface it wants.
Comment 3 Johan (not receiving bugmail) Dahlin 2010-09-26 18:25:25 UTC
Re-opening, there should be a language friendly constructor for GtkFileChooserDialog which does not use varargs.
Comment 4 Serkan Kaba 2010-09-26 18:53:04 UTC
*** Bug 630588 has been marked as a duplicate of this bug. ***
Comment 5 Federico Mena Quintero 2010-11-15 19:01:40 UTC
How do you deal with e.g. GtkMessageDialog?
Comment 6 Federico Mena Quintero 2012-10-09 15:52:30 UTC
Closing as we now have GObject Introspection.