Sha256: 68c306fddcc1344130fd02677e97302e211d48dce97b0663aa2b8adb3e476c4c

Contents?: true

Size: 1.65 KB

Versions: 6

Compression:

Stored size: 1.65 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(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

6 entries across 6 versions & 1 rubygems

Version Path
gtk2-1.0.0-x86-mingw32 ext/gtk2/rbgtkfilechooserdialog.c
gtk2-1.0.0 ext/gtk2/rbgtkfilechooserdialog.c
gtk2-0.90.9 ext/gtk2/rbgtkfilechooserdialog.c
gtk2-0.90.9-x86-mingw32 ext/gtk2/rbgtkfilechooserdialog.c
gtk2-0.90.8-x86-mingw32 ext/gtk2/rbgtkfilechooserdialog.c
gtk2-0.90.8 ext/gtk2/rbgtkfilechooserdialog.c