Tuesday, November 29, 2011

Como cambiarle la propiedad text a un Label de GTK::STOCK::XX

Como cambiarle la propiedad text a un Label de GTK::STOCK::XX código para ruby
  1. MiBoton = Gtk::Button.new(Gtk::Stock::OK)
  2. MiBoton.child().child().children[1].text="nuevo texto"
Con esto se mantiene el icono OK y se cambia la leyenda a "nuevo texto" rafael@rafael-desktop:~$ irb irb(main):001:0> require 'gtk2' => true irb(main):002:0> miboton=Gtk::Button.new(Gtk::Stock::OK) => # irb(main):003:0> miboton.class.name => "Gtk::Button" irb(main):004:0> miboton.child().class.name => "Gtk::Alignment" irb(main):005:0> miboton.child().child().class.name => "Gtk::HBox" irb(main):006:0> miboton.child().child().children[0].class.name => "Gtk::Image" irb(main):007:0> miboton.child().child().children[1].class.name => "Gtk::Label" irb(main):008:0>

Como configurar GNOME para que los botones tengan un icono además de la leyenda.

Como configurar GNOME para que los botones tengan un icono además de la leyenda.
  1. Ejecutar desde la consola gconf-editor luego
  2. desktop
  3. gnome
  4. interface
  5. buttons_have_icons checked
Listo, eso es todo.