Handle situations were ruby-gtk2 is available, but cairo is not. Fixes #191

git-svn-id: file:///home/svn/framework3/trunk@5407 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-02-09 08:17:20 +00:00
parent d8d9db3299
commit cd5d111296
2 changed files with 20 additions and 15 deletions

View File

@ -256,6 +256,8 @@ module Msf
da = Gtk::DrawingArea.new da = Gtk::DrawingArea.new
da.set_size_request(600, 60) da.set_size_request(600, 60)
if(da.window.respond_to?('create_cairo_context'))
Signal Signal
da.signal_connect('expose-event') do |widget, event| da.signal_connect('expose-event') do |widget, event|
cr = widget.window.create_cairo_context cr = widget.window.create_cairo_context
@ -269,8 +271,10 @@ module Msf
cr.paint cr.paint
end end
else
# da = Gtk::Image.new(driver.get_image("banner_assistant.png")) # Ugly, but better than a crash
da = Gtk::Image.new(driver.get_image("banner_assistant.png"))
end
return da return da
end end

3
msfgui
View File

@ -16,7 +16,8 @@ begin
require 'gtk2' require 'gtk2'
require 'libglade2' require 'libglade2'
rescue ::Exception => e rescue ::Exception => e
$stderr.puts "[*] The msfgui interface requires the ruby-gtk2 and ruby-libglade2 package" $stderr.puts "[*] The msfgui interface requires the ruby-gtk2 and ruby-libglade2 packages"
$stderr.puts "[*] Dependencies include ruby-pango, ruby-glib2, ruby-gdkpixbuf2, and ruby-atk"
exit(0) exit(0)
end end