Hi all!
I have developed a panel applet, and it seems to work fine, but I am
missing the popup menu when I right-click on the menu.
I do get the following warning after a while:
(simple_applet.rb:4227): Bonobo-WARNING **: Never got frame, control
died - abnormal exit condition
What do I have to do to get the popup-menu working?
I there a tutorial for the panel applet? …or a sample panel applet?
Any help is greatly appreciated.
My code follows:
class SimpleApplet
def initialize(applet, iid)
@applet = applet
@iid = iid
@label = Gtk::Label.new("Hello World")
@button = Gtk::Button.new
@button.relief = Gtk::RELIEF_NONE
@button.add(@label)
@applet.add(@button)
@applet.show_all
@button.signal_connect("clicked") do |w|
Thread.start do
do_stuff
end
end
Thread.start do
do_stuff
end
end
private
def do_stuff
@label.label = “Working”
# lots of nifty business logic here
@label.label = “Done”
end
end
init = proc do |applet, iid|
SimpleApplet.new(applet, iid)
true
end
oafiid = OAFIID
run_in_window = (ARGV.length == 1 && ARGV.first == “run-in-window”)
oafiid += “_debug” if run_in_window
PanelApplet.main(oafiid, “Simple Applet (Ruby-GNOME2)”, “0”, &init)
if run_in_window
main_window = Gtk::Window.new
main_window.set_title “Simple Applet”
main_window.signal_connect(“destroy”) { Gtk::main_quit }
app = PanelApplet.new
init.call(app, oafiid)
app.reparent(main_window)
main_window.show_all
puts “Main Window”; STDOUT.flush
Gtk::main
puts “Finished Window”; STDOUT.flush
end
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642