Sha256: 02b742d89eb962749c96af4d4b9d5a16bd1142a7290103188763cc9b9b6659ed

Contents?: true

Size: 1.49 KB

Versions: 6

Compression:

Stored size: 1.49 KB

Contents

/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/************************************************

  rbgtkoptionmenu.c -

  $Author: mutoh $
  $Date: 2004/05/30 16:41:13 $

  Copyright (C) 2002,2003 Ruby-GNOME2 Project Team
  Copyright (C) 1998-2000 Yukihiro Matsumoto,
                          Daisuke Kanda,
                          Hiroshi Igarashi
************************************************/

#include "global.h"

#ifndef GTK_DISABLE_DEPRECATED  /* Since 2.4 */

static VALUE
omenu_initialize(VALUE self)
{
    RBGTK_INITIALIZE(self, gtk_option_menu_new());
    return Qnil;
}

static VALUE
omenu_remove_menu(VALUE self)
{
    gtk_option_menu_remove_menu(GTK_OPTION_MENU(RVAL2GOBJ(self)));
    return self;
}

static VALUE
omenu_set_history(VALUE self, VALUE index)
{
    gtk_option_menu_set_history(GTK_OPTION_MENU(RVAL2GOBJ(self)), NUM2INT(index));
    return self;
}

static VALUE
omenu_get_history(VALUE self)
{
    return INT2NUM(gtk_option_menu_get_history(GTK_OPTION_MENU(RVAL2GOBJ(self))));
}

#endif

void 
Init_gtk_option_menu()
{
#ifndef GTK_DISABLE_DEPRECATED  /* Since 2.4 */
    VALUE gOptionMenu = G_DEF_CLASS(GTK_TYPE_OPTION_MENU, "OptionMenu", mGtk);

    rb_define_method(gOptionMenu, "initialize", omenu_initialize, 0);
    rb_define_method(gOptionMenu, "remove_menu", omenu_remove_menu, 0);
    rb_define_method(gOptionMenu, "set_history", omenu_set_history, 1);
    G_DEF_SETTER(gOptionMenu, "history");
    rb_define_method(gOptionMenu, "history", omenu_get_history, 0);
#endif
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gtk2-1.0.3-x86-mingw32 ext/gtk2/rbgtkoptionmenu.c
gtk2-1.0.3 ext/gtk2/rbgtkoptionmenu.c
gtk2-1.0.2-x86-mingw32 ext/gtk2/rbgtkoptionmenu.c
gtk2-1.0.2 ext/gtk2/rbgtkoptionmenu.c
gtk2-1.0.1 ext/gtk2/rbgtkoptionmenu.c
gtk2-1.0.1-x86-mingw32 ext/gtk2/rbgtkoptionmenu.c