Class: JLDrill::Gtk::GtkEnterFilename

Inherits:
Gtk::FileChooserDialog
  • Object
show all
Defined in:
lib/jldrill/oldUI/GtkEnterFilename.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directory, mainWindow) ⇒ GtkEnterFilename

Returns a new instance of GtkEnterFilename.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/jldrill/oldUI/GtkEnterFilename.rb', line 10

def initialize(directory,mainWindow)
    super("Save File",
          mainWindow,
          Gtk::FileChooser::ACTION_SAVE,
          nil,
          [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL],
          [Gtk::Stock::SAVE, Gtk::Dialog::RESPONSE_ACCEPT])
    @resp = Gtk::Dialog::RESPONSE_CANCEL
    self.current_folder = "/home/mike/Desktop"
    print self.filename
    print "\n"
    print self.current_folder
    print "\n"
end

Instance Attribute Details

#respObject (readonly)

Returns the value of attribute resp.



8
9
10
# File 'lib/jldrill/oldUI/GtkEnterFilename.rb', line 8

def resp
  @resp
end

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
# File 'lib/jldrill/oldUI/GtkEnterFilename.rb', line 25

def run
    @resp = super()
    if @resp == Gtk::Dialog::RESPONSE_ACCEPT
        return filename
    else
        return ""
    end
end