Sha256: 0859f962d3e37730f5d30b5c0d70515d901e298fa2dfa92d939b10c412c95385
Contents?: true
Size: 1.68 KB
Versions: 15
Compression:
Stored size: 1.68 KB
Contents
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /************************************************ rbgtkfilechooserdialog.c - $Author: mutoh $ $Date: 2006/12/26 16:11:13 $ Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh ************************************************/ #include "global.h" #if GTK_CHECK_VERSION(2,4,0) #define _SELF(self) GTK_FILE_CHOOSER_DIALOG(RVAL2GOBJ(self)) static VALUE fchodiag_initialize(argc, argv, self) int argc; VALUE* argv; VALUE self; { VALUE title, parent, action, back, button_ary; GtkWidget* dialog; gchar* gtitle; GtkWindow *gparent; GtkFileChooserAction gaction; gchar* gback; rb_scan_args(argc, argv, "04*", &title, &parent, &action, &back, &button_ary); gtitle = NIL_P(title) ? NULL : RVAL2CSTR(title); gparent = NIL_P(parent) ? NULL : GTK_WINDOW(RVAL2GOBJ(parent)); gaction = NIL_P(action) ? GTK_FILE_CHOOSER_ACTION_OPEN : RVAL2GENUM(action, GTK_TYPE_FILE_CHOOSER_ACTION); gback = NIL_P(back) ? NULL : RVAL2CSTR(back); dialog = gtk_file_chooser_dialog_new_with_backend((const gchar*)gtitle, gparent, gaction, (const gchar*)gback, (const gchar*)NULL, NULL); RBGTK_INITIALIZE(self, dialog); rbgtk_dialog_add_buttons_internal(self, button_ary); return Qnil; } #endif void Init_gtk_file_chooser_dialog() { #if GTK_CHECK_VERSION(2,4,0) VALUE gFileChoDiag = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_DIALOG, "FileChooserDialog", mGtk); rb_define_method(gFileChoDiag, "initialize", fchodiag_initialize, -1); #endif }
Version data entries
15 entries across 15 versions & 1 rubygems