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.



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

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



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

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



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

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