Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: constrained gtk radio buttons
Guillaume Cottenceau
4/6/2005 7:58:00 PM
Hi Paul,
IMHO, your problem has more to do with gtk than ruby or ruby-gtk. And
for discussions about ruby-gtk, I am not sure this is the best list.
Anyway, so far I think you're connecting to the wrong signal. Also,
I'm going to use ruby-gtk2 and you should use set_active and not
set_state in gtk2. Anyway, here's how I would do it, and it seems to
work as you expected.
-=-=---=-=---=-=---=-=---=-=---=-=--
require 'gtk2'
class DwellWindow < Gtk::Window
def initialize
super
@single_button = Gtk::RadioButton.new("Single")
@double_button = Gtk::RadioButton.new(@single_button,"Double")
@double_button.signal_connect("toggled") {
if @double_button.active?
@left_button.set_active(true)
end
}
@left_button = Gtk::RadioButton.new("Left")
@right_button = Gtk::RadioButton.new(@left_button, "Right")
@right_button.signal_connect("toggled") {
if @right_button.active?
@single_button.set_active(true)
end
}
type_box = Gtk::VBox.new
type_box.add(@single_button)
type_box.add(@double_button)
button_box = Gtk::VBox.new
button_box.add(@left_button)
button_box.add(@right_button)
top_box = Gtk::HBox.new
top_box.add(button_box)
top_box.add(type_box)
add(top_box)
show_all
end
end
Gtk.init
dwell = DwellWindow.new
Gtk.main
-=-=---=-=---=-=---=-=---=-=---=-=--
--
Guillaume Cottenceau -
http://zar...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: constrained gtk radio buttons
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password