Add the splash screen, some reformatting

git-svn-id: file:///home/svn/framework3/trunk@5233 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2007-12-31 00:23:33 +00:00
parent a233a9c29e
commit dde128f52c
3 changed files with 390 additions and 340 deletions

View File

@ -9,6 +9,7 @@ module Msf
###
class GladeXML < GladeXML
def connect(source, target, signal, handler, data, after = false)
@handler_proc ||= Proc.new{}
handler = canonical_handler(handler)
if target
@ -78,13 +79,47 @@ module Msf
end
end
###
#
# This class provides the splash screen
#
###
class MySplash < Gtk::Window
include Msf::Ui::Gtk2::MyControls
def initialize
super(Gtk::Window::TOPLEVEL)
set_type_hint(Gdk::Window::TYPE_HINT_SPLASHSCREEN)
set_decorated(false)
set_window_position(Gtk::Window::POS_CENTER)
set_default_size(460,301)
set_border_width(0)
image = Gtk::Image.new(driver.get_icon("splash.png"))
image.queue_draw
add(image)
realize
show_all
end
end
###
#
# This class provides the main window.
#
###
class MyApp < MyGlade
attr_accessor :window
include Msf::Ui::Gtk2::MyControls
def initialize

View File

@ -67,11 +67,26 @@ module Msf
# Init GTK2
Gtk.init
# Initialize the Gtk2 application object
@gtk2app = Msf::Ui::Gtk2::MyApp.new()
# Register event handlers
@splash = Msf::Ui::Gtk2::MySplash.new()
done_splash = false
Gtk.idle_add do
if(done_splash)
@gtk2app = Msf::Ui::Gtk2::MyApp.new()
@gtk2app.window.show
@splash.destroy
register_event_handlers
false
else
@splash.queue_draw
done_splash = true
true
end
end
end
#

View File

@ -34,7 +34,7 @@ module Msf
obj.description.each_line do |line|
desc << line.strip + "\n"
end
@buffer.insert_with_tags(start, desc, 'black_italic_wrap')
@buffer.insert_with_tags(start, desc, 'black_wrap')
end
end