Class: Tk::TclX::XPG3_MsgCat

Inherits:
Object
  • Object
show all
Defined in:
lib/tkextlib/tclx/tclx.rb

Instance Method Summary collapse

Constructor Details

#initialize(catname, fail_mode = false) ⇒ XPG3_MsgCat

Returns a new instance of XPG3_MsgCat.



52
53
54
55
56
57
58
# File 'lib/tkextlib/tclx/tclx.rb', line 52

def initialize(catname, fail_mode=false)
  if fail_mode
    @msgcat_id = Tk.tk_call('catopen', '-fail', catname)
  else
    @msgcat_id = Tk.tk_call('catopen', '-nofail', catname)
  end
end

Instance Method Details

#close(fail_mode = false) ⇒ Object



60
61
62
63
64
65
66
67
# File 'lib/tkextlib/tclx/tclx.rb', line 60

def close(fail_mode=false)
  if fail_mode
    Tk.tk_call('catclose', '-fail', @msgcat_id)
  else
    Tk.tk_call('catclose', '-nofail', @msgcat_id)
  end
  self
end

#get(setnum, msgnum, defaultstr) ⇒ Object



69
70
71
# File 'lib/tkextlib/tclx/tclx.rb', line 69

def get(setnum, msgnum, defaultstr)
  Tk.tk_call('catgets', @msgcat_id, setnum, msgnum, defaultstr)
end