Class: Gtk::Dialog

Inherits:
Object show all
Defined in:
lib/knj/jruby-gtk2/dialog.rb,
lib/knj/ironruby-gtk2/dialog.rb

Constant Summary collapse

RESPONSE_OK =
RealGtk::ResponseType.Ok
RESPONSE_YES =
RealGtk::ResponseType.Yes
RESPONSE_NO =
RealGtk::ResponseType.No
RESPONSE_CANCEL =
RealGtk::ResponseType.Cancel
RESPONSE_CLOSE =
RealGtk::ResponseType.Close
RESPONSE_DELETE_EVENT =
RealGtk::ResponseType.DeleteEvent
0

Instance Method Summary collapse

Constructor Details

#initialize(*paras) ⇒ Dialog

Returns a new instance of Dialog.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/knj/jruby-gtk2/dialog.rb', line 12

def initialize(title = nil, win_parent = nil, modal = nil, *buttons)
  if Gtk.takeob
    @ob = Gtk.takeob
    Gtk.takeob = nil
  else
    @ob = Gtk.evalob("org.gnome.gtk.Dialog").new(title, win_parent, modal)
    
    buttons.each do |button|
      self.add_button(button[0], button[1])
    end
    
    self.signal_connect("response") do
      self.destroy
    end
  end
end

Instance Method Details

#destroyObject



37
38
39
40
41
42
43
# File 'lib/knj/jruby-gtk2/dialog.rb', line 37

def destroy
  if @ob
    @ob.hide
  end
  
  @ob = nil
end

#has_separator=(newval) ⇒ Object



33
34
35
# File 'lib/knj/jruby-gtk2/dialog.rb', line 33

def has_separator=(newval)
  # FIXME: No way to do this in Java-GTK?
end

#vboxObject



29
30
31
# File 'lib/knj/jruby-gtk2/dialog.rb', line 29

def vbox
  return self
end