1
키를 누르면 Genie에서이 위젯을 어떻게 멈출 수 있습니까?Gtk.Spinner를 중지 하시겠습니까?
// compila con valac --pkg gtk+-3.0 nombre_archivo.gs uses Gtk init Gtk.init (ref args) var test = new TestVentana() test.show_all() Gtk.main() class TestVentana: Window spinner: Gtk.Spinner init title = "Ejemplo Gtk" default_height = 300 default_width = 300 border_width = 50 window_position = WindowPosition.CENTER destroy.connect(Gtk.main_quit) var spinner = new Gtk.Spinner() spinner.active = true add (spinner) //key_press_event += tecla // OBSOLETO key_press_event.connect(tecla) def tecla(key : Gdk.EventKey):bool //spinner.active = false ??? //spinner.stop() ??? return true
편집 :
// compila con valac --pkg gtk+-3.0 nombre_archivo.gs uses Gtk init Gtk.init (ref args) var test = new TestVentana() test.show_all() Gtk.main() class TestVentana: Window spinner: Gtk.Spinner init title = "Ejemplo Gtk" default_height = 300 default_width = 300 border_width = 50 window_position = WindowPosition.CENTER destroy.connect(Gtk.main_quit) spinner = new Gtk.Spinner() spinner.active = true add (spinner) // key_press_event += tecla // OBSOLETO key_press_event.connect(tecla) def tecla(key : Gdk.EventKey):bool spinner.active = false return true
내 질문을 편집 해 주셔서 감사합니다. – Webierta