X-Git-Url: http://git.code-monkey.de/?p=snett.git;a=blobdiff_plain;f=bin%2Fsnett;h=62b82692261e6df5b3d92a512a87e330b567b69f;hp=58896a5e07ba164a8afc2f3fdd15392b6c132524;hb=4c63ffb5a224e4366a7bbdd42a0e29d09eb2252b;hpb=5a7e1ef2f334d07d7d24b0c6a02c26afc265b27b diff --git a/bin/snett b/bin/snett index 58896a5..62b8269 100755 --- a/bin/snett +++ b/bin/snett @@ -37,7 +37,7 @@ class Gtk::MenuItem def set_callback(meth, args = []) args.unshift(meth) - signal_connect("button_release_event") do + signal_connect("activate") do Snett::Snett.instance.xmms.send(*args) false end @@ -71,6 +71,7 @@ module Snett @xmms = Xmms::Client.new(PKG_NAME) @xmms.connect(ENV["XMMS_PATH"]) @xmms.add_to_glib_mainloop + @xmms.on_disconnect { destroy } @broadcasts = [] @@ -99,15 +100,12 @@ module Snett event_box.events = Gdk::Event::BUTTON_PRESS_MASK | Gdk::Event::BUTTON_RELEASE_MASK - event_box.signal_connect("button_release_event") do |_, event| - menu.popup(event) if event.button == 3 - false - end - event_box.signal_connect("button_press_event") do |_, event| if event.button == 1 x, y = Gdk::Display.default.pointer[1, 2] self.begin_move_drag(event.button, x, y, event.time) + elsif event.button == 3 + menu.popup(event) end false @@ -178,7 +176,7 @@ module Snett item = Gtk::ImageMenuItem.new(text) item.image = Gtk::Image.new(stock, Gtk::IconSize::MENU) - item.signal_connect("button_release_event") do + item.signal_connect("activate") do PlaylistDialog.new(sym).show_all false end @@ -194,7 +192,7 @@ module Snett append(Gtk::SeparatorMenuItem.new) item = Gtk::ImageMenuItem.new(Gtk::Stock::ABOUT) - item.signal_connect("button_release_event") do + item.signal_connect("activate") do props = { "name" => PKG_NAME, "version" => VERSION, @@ -209,7 +207,7 @@ module Snett append(item) item = Gtk::ImageMenuItem.new(Gtk::Stock::QUIT) - item.signal_connect("button_release_event") do + item.signal_connect("activate") do Snett.instance.signal_emit("destroy") false end