[ruby-gnome2-doc-cvs] [Hiki] create - tut-gtk-holamundo

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2005年 3月 18日 (金) 02:11:58 JST


-------------------------
REMOTE_ADDR = 213.37.10.235
REMOTE_HOST = 
REMOTE_USER = ruby-gnome2-hiki        URL = http://ruby-gnome2.sourceforge.jp/cgi-bin/hiki/es/hiki.cgi?tut-gtk-holamundo
-------------------------
TITLE       = tut-gtk-holamundo
KEYWORD     = 
= Hola Mundo en Ruby/GTK2
{{link "tut-gtk-primeros-pasos", "tut-gtk-primeros-pasos", "tut-gtk", "tut-gtk-senales"}}
{{image_right("../helloworld.png")}}

Aqutenemos el cl疽ico programa "Hola Mundo" en Ruby/GTK2..

Este programa tambi駭 estdisponible en el archivo "gtk/sample/misc/helloworld.rb" del paquete ruby-gnome2.

  #!/usr/bin/env ruby
  =begin
    helloworld.rb - Ruby/GTK first sample script.
  
    Copyright (c) 2002,2003 Ruby-GNOME2 Project Team
    This program is licenced under the same licence as Ruby-GNOME2.
  
    $Id: helloworld.rb,v 1.4 2003/02/01 16:46:22 mutoh Exp $
  =end

  require 'gtk2'
  Gtk.init
  
  button = Gtk::Button.new("Hola Mundo")
  button.signal_connect("clicked") {
    puts "Hola Mundo"
  }
  
  window = Gtk::Window.new
  window.signal_connect("delete_event") {
    puts "Se produjo el evento delete"
    #true
    false
  }
  
  window.signal_connect("destroy") {
    puts "se produjo el evento destroy"
    Gtk.main_quit
  }
  
  window.border_width = 10
  window.add(button)
  window.show_all
  
  Gtk.main






ruby-gnome2-cvs メーリングリストの案内
Back to archive index