Method: TkDialogObj#show

Defined in:
lib/tk/dialog.rb

#showObject



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/tk/dialog.rb', line 166

def show
  # if @command.kind_of?(Proc)
  if TkComm._callback_entry?(@command)
    @command.call(self)
  end

  if @default_button.kind_of?(String)
    default_button = @buttons.index(@default_button)
  else
    default_button = @default_button
  end
  # default_button = '{}' if default_button == nil
  default_button = '' if default_button == nil
  #Tk.ip_eval('eval {global '[email protected]+';'+@config+
  #          'set '[email protected]+' [tk_dialog '+
  #          @path+" "+@title+" {#{@message}} "+@bitmap+" "+
  #          String(default_button)+" "[email protected](' ')+']}')
  Tk.ip_eval(@config)
  # @val = Tk.ip_eval('tk_dialog ' + @path + ' ' + @title +
  #                 ' {' + @message + '} ' + @bitmap + ' ' +
  #                 String(default_button) + ' ' + @buttons.join(' ')).to_i
  # @val = Tk.ip_eval(self.class::TkCommandNames[0] + ' ' + @path + ' ' +
  #                   @title + ' {' + @message + '} ' + @bitmap + ' ' +
  #                   String(default_button) + ' ' + @buttons.join(' ')).to_i
  @val = Tk.ip_eval(array2tk_list([
                                    self.class::TkCommandNames[0],
                                    @path, @title, @message, @bitmap,
                                    String(default_button)
                                  ].concat(@buttons))).to_i
end