changeset 15:f7c6a07fa061

Added vadjustment stuff
author unexist
date Fri, 22 Jan 2010 02:28:00 +0100
parents ba26532e98c7
children da58e103db3b
files subtly/gtk.rb
diffstat 1 files changed, 423 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/subtly/gtk.rb	Fri Jan 22 02:27:39 2010 +0100
+++ b/subtly/gtk.rb	Fri Jan 22 02:28:00 2010 +0100
@@ -17,17 +17,27 @@
     class Runner # {{{
       extend FFI::Library
 
-      ffi_lib("libgtk-x11-2.0")    
+      ffi_lib("libgtk-x11-2.0")
+
+      ## initialize
+      # Create runner
+      ##
 
       def initialize
         Subtly::GThread.ffi_init(nil)
         Subtly::Gtk::Runner.ffi_init(nil, nil)
       end
 
+      ## run
+      # Start runner
+      ##
+
       def run
         Subtly::Gtk::Runner.ffi_run
       end
 
+      private
+
       ## init
       # Init Gtk system
       #
@@ -62,7 +72,7 @@
 
       ffi_lib("libgtk-x11-2.0")
 
-      # States
+      # Widget states
       enum(:state,
       [
         :normal, 0,
@@ -72,6 +82,12 @@
         :insensitive
       ])
 
+      ## foreground
+      # Set foreground color of widget
+      #
+      # @param  [String, #read]  color  Color value
+      ##
+
       def foreground=(color)
         col = Subtly::Gdk::Color.new
 
@@ -79,6 +95,12 @@
         Subtly::Gtk::Widget.ffi_set_fg(@widget, :normal, col.pointer)
       end
 
+      ## background
+      # Set background color of widget
+      #
+      # @param  [String, #read]  color  Color value
+      ##
+
       def background=(color)
         col = Subtly::Gdk::Color.new
 
@@ -86,6 +108,14 @@
         Subtly::Gtk::Widget.ffi_set_bg(@widget, :normal, col.pointer)      
       end
 
+      ## connect
+      # Connect callback to signal
+      #
+      # @param  [String,  #read]  signal    Signal name
+      # @param  [Proc,    #read]  callback  Callback proc
+      # @param  [Pointer, #read]  data      Userdata
+      ##
+
       def connect(signal, callback, data)
         case callback.arity
           when 2 then
@@ -97,28 +127,53 @@
         end
       end
 
-      def alignment(xalign, yalign)
-        Subtly::Gtk::Widget.ffi_set_alignment(@widget, xalign, yalign)
+      ## alignment
+      # Set alignment of widget
+      #
+      # @param  [Array, #read]  array  Alignment array for x/y
+      ##
+
+      def alignment=(array)
+        Subtly::Gtk::Widget.ffi_set_alignment(@widget, array[0], array[1])
       end
 
+      ## focusable
+      # Set if widget is focusable
+      #
+      # @param  [Bool, #read]  value  New value
+      ##
+
       def focusable=(value)
         Subtly::Gtk::Widget.ffi_set_can_focus(@widget, value)
       end
 
+      ## editable
+      # Set if widget is editable
+      #
+      # @param  [Bool, #read]  value  New value
+      ##
+
       def editable=(value)
         Subtly::Gtk::Widget.ffi_set_can_edit(@widget, value)
       end
 
+      ## to_wid
+      # Get real widget from object
+      # @return [Pointer] Real widget
+      ##
+
       def to_wid
         @widget
       end
+
+      private
       
       ## ffi_set_fg
       # Set foreground color of widget
       #
-      # @param  [Pointer, #read]  Widget to set color
-      # @param  [State,   #read]  Widget state
-      # @param  [Pointer, #read]  Color to set
+      # @param  [Pointer, #read]  widget  A #GtkWidget
+      # @param  [State,   #read]  state   Widget state
+      # @param  [Pointer, #read]  color   A #GdkColor
       ##
 
       attach_function(:ffi_set_fg,
@@ -128,9 +183,9 @@
       ## ffi_set_fg
       # Set background color of widget
       #
-      # @param  [Pointer, #read]  Widget to set color
-      # @param  [State,   #read]  Widget state
-      # @param  [Pointer, #read]  Color to set
+      # @param  [Pointer, #read]  widget  A #GtkWidget
+      # @param  [State,   #read]  state   Widget state
+      # @param  [Pointer, #read]  color   A #GdkColor
       ##
 
       attach_function(:ffi_set_bg,
@@ -140,9 +195,9 @@
       ## ffi_set_alignment
       # Set background color of widget
       #
-      # @param  [Pointer, #read]  Widget to set alignment
-      # @param  [Float,   #read]  X alignment
-      # @param  [Float,   #read]  Y alignment
+      # @param  [Pointer, #read]  misc    A #GtkMisc
+      # @param  [Float,   #read]  xalign  X alignment
+      # @param  [Float,   #read]  yalign  Y alignment
       ##
 
       attach_function(:ffi_set_alignment,
@@ -150,10 +205,10 @@
       )
 
       ## ffi_set_can_focus
-      # Get title or uri loaded
+      # Set if widget can focus
       #
-      # @param  [Pointer, #read]  Webkit view, #GtkWidget
-      # @param  [Book,    #read]  Set focusable
+      # @param  [Pointer, #read]  widget     A #GtkWidget
+      # @param  [Book,    #read]  can_focus  Set focusable
       ##
 
       attach_function(:ffi_set_can_focus,
@@ -161,10 +216,10 @@
        )
 
       ## ffi_set_can_edit
-      # Get title or uri loaded
+      # Set if widget is editable
       #
-      # @param  [Pointer, #read]  Webkit view, #GtkWidget
-      # @param  [Book,    #read]  Set editable
+      # @param  [Pointer, #read]  editable     A #GtkWidget
+      # @param  [Book,    #read]  is_editable  Set editable
       ##
 
       attach_function(:ffi_set_can_edit,
@@ -175,20 +230,30 @@
     class Container < Subtly::Gtk::Widget # {{{
       extend FFI::Library
 
-      ffi_lib("libgtk-x11-2.0")
+      ## show_all
+      # Show all widgets
+      ##
 
       def show_all
         Subtly::Gtk::Container.ffi_show_all(@widget)
       end
 
+      ## add
+      # Add widget to container
+      #
+      # @param  [Widget, #read]  widget  A #Widget
+      ##
+
       def add(widget)
         Subtly::Gtk::Container.ffi_add(@widget, widget.to_wid)
       end
 
+      private
+
       ## ffi_show_all
       # Show all child widgets
       #
-      # @param  [Pointer, #read]  Parent widget
+      # @param  [Pointer, #read]  widget  A #GtkWdget
       ##
 
       attach_function(:ffi_show_all,
@@ -198,8 +263,8 @@
       ## ffi_add
       # Add widget to container
       #
-      # @param  [Pointer, #read]  Container widget
-      # @param  [Pointer, #read]  Widget to add
+      # @param  [Pointer, #read]  container  A #GtkContainer
+      # @param  [Pointer, #read]  widget     A #GtkWidget
       ##
 
       attach_function(:ffi_add,
@@ -210,29 +275,53 @@
     class Window < Subtly::Gtk::Container # {{{
       extend FFI::Library
 
-      ffi_lib("libgtk-x11-2.0")
+      ## initialize
+      # Create a new widget
+      #
+      # @return [Widget]  New widget
 
       def initialize
         @widget = Subtly::Gtk::Window.ffi_new(0)
       end
 
+      ## title=
+      # Set window title
+      #
+      # @param  [String, #read]  title  Window title
+      ##
+
       def title=(str)
         Subtly::Gtk::Window.ffi_set_title(@widget, str)
       end
 
-      def klass=(klass)
-        Subtly::Gtk::Window.ffi_set_klass(@widget, klass[0], klass[1])
+      ## klass=
+      # Set window class
+      #
+      # @param  [Array, #read]  array  Klass array
+      ##
+
+      def klass=(array)
+        Subtly::Gtk::Window.ffi_set_klass(@widget, array[0], array[1])
       end
 
+      ## size=
+      # Set window size
+      #
+      # @param  [Array, #read]  array  Size array
+      ##
+
       def size=(array)
         Subtly::Gtk::Window.ffi_set_size(@widget, array[0], array[1])
       end
 
+      private
+
       ## ffi_new
-      # Create window
+      # Create new window
       #
-      # @param  [Fixnum, #read]  Window type, #GtkWindowType
-      # @return [Pointer] Return the new widget
+      # @param  [Fixnum, #read]  type  A #GtkWindowType
+      #
+      # @return [Pointer] A new widget
       ##
      
       attach_function(:ffi_new,
@@ -242,8 +331,8 @@
       ## ffi_set_title
       # Set window title
       #
-      # @param  [Pointer, #read]  Window to set title
-      # @param  [String,  #read]  Window title
+      # @param  [Pointer, #read]  window  A #GtkWindow
+      # @param  [String,  #read]  title   Window title
       ##
 
       attach_function(:ffi_set_title,
@@ -251,11 +340,11 @@
       )
       
       ## ffi_set_klass
-      # Set window title
+      # Set window instance and class
       #
-      # @param  [Pointer, #read]  Window to set class
-      # @param  [String,  #read]  Instance name
-      # @param  [String,  #read]  Class name
+      # @param  [Pointer, #read]  window         A #GtkWindow
+      # @param  [String,  #read]  wmclass_name   Instance name
+      # @param  [String,  #read]  wmclass_class  Class name
       ##
 
       attach_function(:ffi_set_klass,
@@ -265,9 +354,9 @@
       ## ffi_set_size
       # Set default size of widget
       #
-      # @param  [Pointer, #read]  Widget to set size
-      # @param  [Fixnum,  #read]  Width of the widget
-      # @param  [Fixnum,  #read]  Height of the widget
+      # @param  [Pointer, #read]  window  A #GtkWindow
+      # @param  [Fixnum,  #read]  width   Width of the widget
+      # @param  [Fixnum,  #read]  height  Height of the widget
       ##
 
       attach_function(:ffi_set_size,
@@ -278,24 +367,71 @@
     class Scrolled < Subtly::Gtk::Container # {{{
       extend FFI::Library
 
-      ffi_lib("libgtk-x11-2.0")
+      ## initialize
+      # Create a new scrolled window
+      #
+      # @return  [Widget] Scrolled window
+      ##
 
       def initialize
         @widget = Subtly::Gtk::Scrolled.ffi_new(nil, nil)
       end
 
-      def vadjustment
-        vadjustment = Subtly::Gtk::Scrolled.ffi_get_vadjustment(@widget)
-        
-        Subtly::Gtk::Adjustment.new(vadjustment)
+      ## vadjust=
+      # Set vadjustment position of scrolled window
+      #
+      # @param [Float, #read]  pos  Value for adjustment
+      ##
+
+      def vadjust=(pos)
+        vadjust = Subtly::Gtk::Scrolled.ffi_get_vadjustment(@widget)
+
+        # Collect bounds
+        upper = Subtly::Gtk::Scrolled.ffi_get_vadjust_lower(vadjust)
+        lower = Subtly::Gtk::Scrolled.ffi_get_vadjust_upper(vadjust)
+        page  = Subtly::Gtk::Scrolled.ffi_get_vadjust_page_size(vadjust)
+
+        # Calculation
+        percent = pos * 100
+        value   = lower * percent / 100
+
+        puts value
+
+        Subtly::Gtk::Scrolled.ffi_set_vadjust_value(vadjust, value)
       end
 
+      ## vadjust
+      # Get vadjustment position of scrolled window
+      #
+      # @return [Pointer] The #GtkAdjustment
+      ##
+
+      def vadjust
+        vadjust = Subtly::Gtk::Scrolled.ffi_get_vadjustment(@widget)
+
+        # Collect bounds
+        pos   = Subtly::Gtk::Scrolled.ffi_get_vadjust_value(vadjust)
+        upper = Subtly::Gtk::Scrolled.ffi_get_vadjust_lower(vadjust)
+        lower = Subtly::Gtk::Scrolled.ffi_get_vadjust_upper(vadjust)
+        page  = Subtly::Gtk::Scrolled.ffi_get_vadjust_page_size(vadjust)
+
+        # Calculation
+        real    = lower - page #< Substract page size
+        percent = pos * 100 / real
+
+        # FIXME: Better way to do this?
+        (percent / 100).to_s[0..3].to_f
+      end
+
+      private
+
       ## ffi_new
       # Create scrolled window
       #
-      # @param  [Pointer, #read]  Horizontal adjustment, #GtkAdjustment
-      # @param  [Pointer, #read]  Vertical adjustment, #GtkAdjustment
-      # @return [Pointer] Return the new widget
+      # @param  [Pointer, #read]  hadjustment  A #GtkAdjustment
+      # @param  [Pointer, #read]  vadjustment  A #GtkAdjustment
+      #
+      # @return [Pointer] The new widget
       ##
       
       attach_function(:ffi_new,
@@ -305,19 +441,88 @@
       ## ffi_get_vadjustment
       # Get vertical adjustment
       #
-      # @param  [Pointer, #read]  Scrolled widget
-      # @return [Pointer] Return the vertical adjustment, #GtkAdjustment
+      # @param  [Pointer, #read]  scrolled_window A #GtkScrolledWindow
+      #
+      # @return [Pointer] A #GtkAdjustment
       ##
 
       attach_function(:ffi_get_vadjustment,
         :gtk_scrolled_window_get_vadjustment, [ :pointer ], :pointer
       )
+
+      ## ffi_set_vadjust_value
+      # Set vertical adjustment value
+      #
+      # @param  [Pointer, #read]  adjustment  A #GtkAdjustment
+      # @param  [Float,   #read]  value       The new value
+      #
+      # @return [Pointer] A #GtkAdjustment
+      ##
+
+      attach_function(:ffi_set_vadjust_value,
+        :gtk_adjustment_set_value, [ :pointer, :float ], :void
+      )
+
+      ## ffi_get_vadjust_value
+      # Get vertical adjustment value
+      #
+      # @param  [Pointer, #read]  adjustment  A #GtkAdjustment
+      #
+      # @return [Float] The vadjustment value
+      ##
+
+      attach_function(:ffi_get_vadjust_value,
+        :gtk_adjustment_get_value, [ :pointer ], :float
+      )
+
+      ## ffi_get_vadjust_lower
+      # Get vertical adjustment lower value
+      #
+      # @param  [Pointer, #read]  adjustment  A #GtkAdjustment
+      #
+      # @return [Float] The vadjustment lower value
+      ##
+
+      attach_function(:ffi_get_vadjust_lower,
+        :gtk_adjustment_get_lower, [ :pointer ], :float
+      )
+
+      ## ffi_get_vadjust_upper
+      # Get vertical adjustment upper value
+      #
+      # @param  [Pointer, #read]  adjustment  A #GtkAdjustment
+      #
+      # @return [Float] The vadjustment upper value
+      ##
+ 
+      attach_function(:ffi_get_vadjust_upper,
+        :gtk_adjustment_get_upper, [ :pointer ], :float
+      )
+
+      ## ffi_get_vadjust_page_size
+      # Get vertical adjustment page size
+      #
+      # @param  [Pointer, #read]  adjustment  A #GtkAdjustment
+      #
+      # @return [Float] The vadjustment page size
+      ##
+      #
+      attach_function(:ffi_get_vadjust_page_size,
+        :gtk_adjustment_get_page_size, [ :pointer ], :float
+      )
     end # }}}
 
     class Box < Subtly::Gtk::Widget # {{{
       extend FFI::Library
 
-      ffi_lib("libgtk-x11-2.0")
+      ## initialize
+      # Create a new box
+      #
+      # @param  [Symbol, #read]  type  Type of box
+      # @param  [Bool,   #read]  homogeneous  Homogeneous or not
+      # @param  [Bool,   #read]  spacing      Spacing
+      # @return [Object] New box
+      ##
 
       def initialize(type, homogenous, spacing)
         if(:vbox == type)
@@ -327,15 +532,25 @@
         end
       end
 
+      ## add
+      # Add widget to box
+      #
+      # @param  [Widget, #read]  widget   A #Widget
+      # @param  [Bool,   #read]  expand   Expand widget
+      # @param  [Bool,   #read]  padding  Pad widget
+      ##
+
       def add(widget, expand, fill, padding)
         Subtly::Gtk::Box.ffi_add(@widget, widget.to_wid, expand, fill, padding)
       end
 
+      private
+
       ## ffi_vbox_new
       # Create vbox widget
       #
-      # @param  [Bool,   #read]  Homogeneous or not
-      # @param  [Fixnum, #read]  Default space between children
+      # @param  [Bool,   #read]  homogenous  Homogeneous or not
+      # @param  [Fixnum, #read]  spacing     Default space between children
       # @return [Pointer] Return the new widget
       ##
 
@@ -346,8 +561,8 @@
       ## ffi_hbox_new
       # Create hbox widget
       #
-      # @param  [Bool,   #read]  Homogeneous or not
-      # @param  [Fixnum, #read]  Default space between children
+      # @param  [Bool,   #read]  homogeneous  Homogeneous or not
+      # @param  [Fixnum, #read]  spacing      Default space between children
       # @return [Pointer] Return the new widget
       ##
 
@@ -358,11 +573,11 @@
       ## ffi_add
       # Add widget to box
       #
-      # @param  [Pointer, #read]  Box widget
-      # @param  [Pointer, #read]  Widget to add
-      # @param  [Bool,    #read]  Expand widget
-      # @param  [Bool,    #read]  Fill widget
-      # @param  [Fixnum,  #read]  Padding of children
+      # @param  [Pointer, #read]  box      Box widget
+      # @param  [Pointer, #read]  child    Widget to add
+      # @param  [Bool,    #read]  expand   Expand widget
+      # @param  [Bool,    #read]  fill     Fill widget
+      # @param  [Fixnum,  #read]  padding  Padding of children
       ##
 
       attach_function(:ffi_add,
@@ -371,6 +586,16 @@
     end # }}}
 
     class Label < Subtly::Gtk::Widget# {{{
+
+      ## initialize
+      # Create new label
+      #
+      # @param  [Bool, #read]  single      Single line?
+      # @param  [Bool, #read]  selectable  Selectable?
+      #
+      # @return  [Widget]  New adjustment
+      ##
+
       def initialize(single, selectable)
         @widget = Subtly::Gtk::Label.ffi_new("Subtly")
 
@@ -378,17 +603,31 @@
         Subtly::Gtk::Label.ffi_selectable(@widget,  selectable)
       end
 
+      ## text=
+      # Set text of label
+      #
+      # @param  [String, #read]  str  String for label
+      ##
+
       def text=(str)
         Subtly::Gtk::Label.ffi_set_text(@widget, str)
       end
 
+      ## markup=
+      # Set markup of label
+      #
+      # @param  [String, #read]  str  Markup for label
+      ##
+
       def markup=(str)
         Subtly::Gtk::Label.ffi_set_markup(@widget, str)
       end
 
+      private
+
       ## ffi_new
       # Create label widget
-      # 
+      #
       # @param  [String, #read]  String to display
       # @return [Pointer] Return the new widget
       ##
@@ -399,6 +638,7 @@
 
       ## ffi_set_text
       # Set widget label text
+      #
       # @param  [Pointer, #read]  Widget to set text
       # @param  [String,  #read]  String to set
       ##
@@ -409,8 +649,9 @@
 
       ## ffi_set_markup
       # Set widget label markup
-      # @param  [Pointer, #read]  Widget to set text
-      # @param  [String,  #read]  String to set
+      #
+      # @param  [Pointer, #read]  label  A #GtkLabel
+      # @param  [String,  #read]  str    String to set
       ##
 
       attach_function(:ffi_set_markup,
@@ -419,6 +660,7 @@
 
       ## ffi_single_line
       # Set single line mode
+      #
       # @param  [Pointer, #read]  Widget to set text
       # @param  [Bool,    #read]  Set single line mode
       ##
@@ -429,6 +671,7 @@
 
       ## ffi_selectable
       # Set selected
+      #
       # @param  [Pointer, #read]  Widget to set text
       # @param  [Bool,    #read]  Set selectable
       ##
@@ -438,33 +681,88 @@
       )
     end # }}}
 
-    class Entry < Subtly::Gtk::Widget# {{{
+    class Entry < Subtly::Gtk::Widget # {{{
+      ## initialize
+      # Creaze new entry
+      #
+      # @param  [Bool, #read]  frame  Has frame?
+      #
+      # @return [Widget] New entry
+      ##
+
       def initialize(frame)
         @widget = Subtly::Gtk::Entry.ffi_new
 
         Subtly::Gtk::Entry.ffi_set_frame(@widget, frame)
       end
 
+      ## text
+      # Get text of entry
+      #
+      # @return [String] String of entry
+      ##
+
       def text
         Subtly::Gtk::Entry.ffi_get_text(@widget)
       end
 
+      ## text=
+      # Set text of entry
+      #
+      # @param  [String, #read]  str  String to set
+      ##
+
       def text=(str)
         Subtly::Gtk::Entry.ffi_set_text(@widget, str)
       end
 
+      ## empty?
+      # Is entry empty?
+      #
+      # @return [Bool] Empty or not
+      ##
+
       def empty?
         0 < Subtly::Gtk::Entry.ffi_get_length(@widget) ? false : true
       end
 
+      ## <<
+      # Append text to entry
+      #
+      # @param  [String, #read]  str  String to append
+      ##
+
       def <<(str)
         Subtly::Gtk::Entry.ffi_append_text(@widget, str)
       end
 
+      ## length=
+      # Set max length of widget
+      #
+      # @param  [Fixnum, #read]  max  Max length
+      ##
+
+      def length=(max)
+        Subtly::Gtk::Entry.ffi_set_length(@widget, max)
+      end
+
+      ## width=
+      # Set width in chars of widget
+      #
+      # @param  [Pointer, #read]  entry    A #GtkEntry
+      # @param  [Fixnum,  #read]  n_chars  Width in chars
+      ##
+
+      def width=(num)
+        Subtly::Gtk::Entry.ffi_set_width_chars(@widget, num)
+      end
+
+      private
+
       ## ffi_new
       # Create entry widget
       # 
-      # @return [Pointer] Return the new widget
+      # @return [Pointer] Mew widget
       ##
 
       attach_function(:ffi_new,
@@ -473,8 +771,9 @@
 
       ## ffi_set_frame
       # Set widget frame
-      # @param  [Pointer, #read]  Widget to set text
-      # @param  [Bool,  #read]    Set frame
+      #
+      # @param  [Pointer, #read]  entry    A #GtkEntry
+      # @param  [Bool,    #read]  setting  Set frame
       ##
 
       attach_function(:ffi_set_frame,
@@ -483,7 +782,9 @@
 
       ## ffi_get_text
       # Set widget entry text
-      # @param  [Pointer, #read]  Widget to get text
+      #
+      # @param  [Pointer, #read]  entry  A #GtkEntry
+      #
       # @return [String] Entry text
       ##
 
@@ -493,8 +794,9 @@
 
       ## ffi_set_text
       # Set widget entry text
-      # @param  [Pointer, #read]  Widget to set text
-      # @param  [String,  #read]  String to set
+      #
+      # @param  [Pointer, #read]  widget  A #GtkEntry
+      # @param  [String,  #read]  text    String to set
       ##
 
       attach_function(:ffi_set_text,
@@ -503,7 +805,9 @@
 
       ## ffi_get_length
       # Get entry text length
-      # @param  [Pointer, #read]  Widget to get length
+      #
+      # @param  [Pointer, #read]  widget  A #GtkEntry
+      #
       # @return [Uin16] Length of text
       ##
 
@@ -511,15 +815,63 @@
         :gtk_entry_get_text_length, [ :pointer ], :uint16
       )
 
+      ## ffi_set_length
+      # Set entry text length
+      #
+      # @param  [Pointer, #read]  entry  A #GtkEntry
+      # @param  [Uint16r, #read]  max    Maximum length of entry
+      ##
+
+      attach_function(:ffi_set_length,
+        :gtk_entry_set_max_length, [ :pointer, :uint16 ], :void
+      )
+
       ## ffi_append_text
       # Append text to entry
-      # @param  [Pointer, #read]  Widget to get length
-      # @param  [String, #read]   Text to append
+      #
+      # @param  [Pointer, #read]  widget  A #GtkEntry
+      # @param  [String,  #read]  text    Text to append
       ##
 
       attach_function(:ffi_append_text,
         :gtk_entry_append_text, [ :pointer, :string ], :void
       )
+
+      ## ffi_set_width_chars
+      # Set width in chars of widget
+      #
+      # @param  [Pointer, #read]  widget   A #GtkEntry
+      # @param  [Fixnum,  #read]  n_chars  Width in chars
+      ##
+
+      attach_function(:ffi_set_width_chars,
+        :gtk_entry_set_width_chars, [ :pointer, :int ], :void
+      )
+    end # }}}
+
+    class List < Subtly::Gtk::Widget # {{{
+      ## initialize
+      # Creaze new entry
+      #
+      # @param  [Bool, #read]  frame  Has frame?
+      #
+      # @return [Widget] New entry
+      ##
+
+      def initialize
+      end
+
+      private
+
+      ## ffi_new
+      # Create entry widget
+      # 
+      # @return [Pointer] Mew widget
+      ##
+
+      attach_function(:ffi_new,
+        :gtk_entry_new, [ ], :pointer
+      )
     end # }}}
 
     class Adjustment < FFI::Struct # {{{