class Metasm::Gui::ToolWindow

Public Class Methods

new(parent=nil, *a, &b) click to toggle source
Calls superclass method
# File metasm/gui/gtk.rb, line 963
def initialize(parent=nil, *a, &b)
        super('toolwin', parent, Gtk::Dialog::DESTROY_WITH_PARENT)
        set_events Gdk::Event::ALL_EVENTS_MASK
        set_can_focus true
        @child = vbox
        initialize_window(*a, &b)
        show_all
end

Public Instance Methods

destroy_window() click to toggle source
Calls superclass method
# File metasm/gui/win32.rb, line 2432
def destroy_window
        @parent.popups.delete self if @parent
        super
end
initialize_visible_() click to toggle source
Calls superclass method
# File metasm/gui/win32.rb, line 2412
def initialize_visible_
        super
        # center on the parent from size in initial_size
        w, h = @widget.initial_size
        r1 = Win32Gui.alloc_c_struct('RECT')
        Win32Gui.getwindowrect(@parent.hwnd, r1)
        r2 = Win32Gui.alloc_c_struct('RECT', :left => 0, :top => 0, :right => w, :bottom => h)
        Win32Gui.adjustwindowrectex(r2, @parent.win32style, Win32Gui::FALSE, @parent.win32styleex)
        x = r1[:left]+(r1[:right]-r1[:left]-r2[:right]+r2[:left])/2
        y = r1[:top ]+(r1[:bottom]-r1[:top]-r2[:bottom]+r2[:top])/2
        Win32Gui.movewindow(@hwnd, x, y, r2[:right]-r2[:left], r2[:bottom]-r2[:top], Win32Gui::FALSE)
end
widget() click to toggle source
# File metasm/gui/gtk.rb, line 982
def widget
        @child
end
widget=(w) click to toggle source
# File metasm/gui/gtk.rb, line 972
def widget=(w)
        remove @child if @child
        @child = w
        add @child
        if @child.respond_to? :initial_size
                resize(*@child.initial_size)
        end
        show_all
end
win32style() click to toggle source
# File metasm/gui/win32.rb, line 2410
def win32style; Win32Gui::WS_POPUP | Win32Gui::WS_SYSMENU | Win32Gui::WS_CAPTION | Win32Gui::WS_THICKFRAME ; end
win32styleex() click to toggle source
# File metasm/gui/win32.rb, line 2409
def win32styleex; Win32Gui::WS_EX_TOOLWINDOW ; end