Module: TkProperties
- Defined in:
- lib/tk/al-tk.rb
Class Method Summary collapse
- .activebackground(_obj) ⇒ Object
- .activeforeground(_obj) ⇒ Object
- .anchor(_obj) ⇒ Object
- .background(_obj) ⇒ Object
- .bitmap(_obj) ⇒ Object
- .border(_obj) ⇒ Object
- .borderwidth(_obj) ⇒ Object
- .class(_obj) ⇒ Object
- .colormap(_obj) ⇒ Object
- .command(_obj) ⇒ Object
- .compound(_obj) ⇒ Object
- .container(_obj) ⇒ Object
- .cursor(_obj) ⇒ Object
- .disabledforeground(_obj) ⇒ Object
- .font(_obj) ⇒ Object
- .foreground(_obj) ⇒ Object
- .generic_color(_name, _obj) ⇒ Object
- .height(_obj) ⇒ Object
- .highlightbackground(_obj) ⇒ Object
- .highlightcolor(_obj) ⇒ Object
- .highlightthickness(_obj) ⇒ Object
- .image(_obj) ⇒ Object
- .justify(_obj) ⇒ Object
- .labelanchor(_obj) ⇒ Object
- .labelwidget(_obj) ⇒ Object
- .orient(_obj) ⇒ Object
- .overrelief(_obj) ⇒ Object
- .padx(_obj) ⇒ Object
- .pady(_obj) ⇒ Object
- .property(_name, _obj) ⇒ Object
- .relief(_obj) ⇒ Object
- .state(_obj) ⇒ Object
- .takefocus(_obj) ⇒ Object
- .text(_obj) ⇒ Object
- .width(_obj) ⇒ Object
- .wraplength(_obj) ⇒ Object
- .xscrollcommand(_obj) ⇒ Object
- .yscrollcommand(_obj) ⇒ Object
Class Method Details
.activebackground(_obj) ⇒ Object
1844 1845 1846 1847 1848 1849 1850 1851 |
# File 'lib/tk/al-tk.rb', line 1844 def TkProperties.activebackground(_obj) {'name'=>'activebackground', 'get'=> proc{_obj.cget('activebackground')}, 'set'=> proc{|activebackground| _obj.configure('activebackground'=>activebackground)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.activeforeground(_obj) ⇒ Object
1853 1854 1855 1856 1857 1858 1859 1860 |
# File 'lib/tk/al-tk.rb', line 1853 def TkProperties.activeforeground(_obj) {'name'=>'activeforeground', 'get'=> proc{_obj.cget('activeforeground')}, 'set'=> proc{|activeforeground| _obj.configure('activeforeground'=>activeforeground)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.anchor(_obj) ⇒ Object
2043 2044 2045 2046 2047 2048 2049 2050 |
# File 'lib/tk/al-tk.rb', line 2043 def TkProperties.anchor(_obj) {'name'=>'anchor', 'get'=> proc{_obj.cget('anchor')}, 'set'=> proc{|a| _obj.configure('anchor'=>a)}, 'def'=> "", 'type'=> TkType::TkagAnchor } end |
.background(_obj) ⇒ Object
1774 1775 1776 1777 1778 1779 1780 1781 |
# File 'lib/tk/al-tk.rb', line 1774 def TkProperties.background(_obj) {'name'=>'background', 'get'=> proc{_obj.cget('background')}, 'set'=> proc{|background| _obj.configure('background'=>background)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.bitmap(_obj) ⇒ Object
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 |
# File 'lib/tk/al-tk.rb', line 1980 def TkProperties.bitmap(_obj) {'name'=>'bitmap', 'get'=> proc{_obj.cget('bitmap')}, 'set'=> proc{|j| _obj.configure('bitmap'=>TkAllPhotoImage.new('file' => j))}, 'def'=> proc{|x| if x.to_s.length > 2 "bitmap TkAllPhotoImage.new('file' => #{x})" else "" end }, 'type'=> TkType::TkagFile } end |
.border(_obj) ⇒ Object
2005 2006 2007 2008 2009 2010 2011 2012 |
# File 'lib/tk/al-tk.rb', line 2005 def TkProperties.border(_obj) {'name'=>'border', 'default'=> 0, 'get'=> proc{_obj.cget('border')}, 'set'=> proc{|b| _obj.configure('border'=>b)}, 'def'=> "" } end |
.borderwidth(_obj) ⇒ Object
1996 1997 1998 1999 2000 2001 2002 2003 |
# File 'lib/tk/al-tk.rb', line 1996 def TkProperties.borderwidth(_obj) {'name'=>'borderwidth', #'default'=> 2, 'get'=> proc{_obj.cget('borderwidth')}, 'set'=> proc{|b| _obj.configure('borderwidth'=>b)}, 'def'=> "" } end |
.class(_obj) ⇒ Object
2088 2089 2090 2091 2092 2093 2094 2095 2096 |
# File 'lib/tk/al-tk.rb', line 2088 def TkProperties.class(_obj) {'name'=>'class', 'default'=> AG.near_class_wrapped(_obj).to_s, 'get'=> proc{_obj.cget('class')}, 'set'=> proc{|r| _obj.configure('class'=>r)}, 'def'=> "", 'kind'=>'on-create' } end |
.colormap(_obj) ⇒ Object
2098 2099 2100 2101 2102 2103 2104 2105 |
# File 'lib/tk/al-tk.rb', line 2098 def TkProperties.colormap(_obj) {'name'=>'colormap', 'get'=> proc{_obj.cget('colormap')}, 'set'=> proc{|r| _obj.configure('colormap'=>r)}, 'def'=> "", 'type'=> EnumType.new('new','') } end |
.command(_obj) ⇒ Object
1891 1892 1893 1894 1895 1896 1897 |
# File 'lib/tk/al-tk.rb', line 1891 def TkProperties.command(_obj) {'name'=>'command', 'get'=> proc{eval('@c = _obj.command_script'); @c}, 'set'=> proc{|r| _obj.configure('command'=>r)}, 'def'=> "" } end |
.compound(_obj) ⇒ Object
1917 1918 1919 1920 1921 1922 1923 1924 |
# File 'lib/tk/al-tk.rb', line 1917 def TkProperties.compound(_obj) {'name'=>'compound', 'get'=> proc{_obj.cget('compound')}, 'set'=> proc{|compound| _obj.configure('compound'=>compound)}, 'def'=> '', 'type'=> TkType::TkagCompound } end |
.container(_obj) ⇒ Object
2107 2108 2109 2110 2111 2112 2113 2114 |
# File 'lib/tk/al-tk.rb', line 2107 def TkProperties.container(_obj) {'name'=>'container', 'get'=> proc{_obj.cget('container')}, 'set'=> proc{|r| _obj.configure('container'=>r)}, 'def'=> "", 'type'=> TkType::TkagBool } end |
.cursor(_obj) ⇒ Object
2061 2062 2063 2064 2065 2066 2067 2068 |
# File 'lib/tk/al-tk.rb', line 2061 def TkProperties.cursor(_obj) {'name'=>'cursor', 'get'=> proc{_obj.cget('cursor')}, 'set'=> proc{|o| _obj.configure('cursor'=>o)}, 'def'=> "", 'type'=> TkType::TkagCursor } end |
.disabledforeground(_obj) ⇒ Object
1835 1836 1837 1838 1839 1840 1841 1842 |
# File 'lib/tk/al-tk.rb', line 1835 def TkProperties.disabledforeground(_obj) {'name'=>'disabledforeground', 'get'=> proc{_obj.cget('disabledforeground')}, 'set'=> proc{|foreground| _obj.configure('disabledforeground'=>foreground)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.font(_obj) ⇒ Object
1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 |
# File 'lib/tk/al-tk.rb', line 1926 def TkProperties.font(_obj) {'name'=>'font', 'get'=> proc{font = _obj.cget('font') if font.kind_of?(TkFont) keys = Hash.new font.configinfo.each{|key,value| keys[key]=value } keys['family']+"\s"+keys['size'].to_s+"\s"+keys['weight'].to_s else nil end }, 'set'=> proc{|f| _obj.configure('font'=>f)}, 'def'=> "", 'type'=> TkType::TkagFont } end |
.foreground(_obj) ⇒ Object
1826 1827 1828 1829 1830 1831 1832 1833 |
# File 'lib/tk/al-tk.rb', line 1826 def TkProperties.foreground(_obj) {'name'=>'foreground', 'get'=> proc{_obj.cget('foreground')}, 'set'=> proc{|foreground| _obj.configure('foreground'=>foreground)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.generic_color(_name, _obj) ⇒ Object
1764 1765 1766 1767 1768 1769 1770 1771 |
# File 'lib/tk/al-tk.rb', line 1764 def TkProperties.generic_color(_name, _obj) {'name'=>_name, 'get'=> proc{_obj.cget(_name)}, 'set'=> proc{|value| _obj.configure(_name=>value)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.height(_obj) ⇒ Object
1800 1801 1802 1803 1804 1805 1806 |
# File 'lib/tk/al-tk.rb', line 1800 def TkProperties.height(_obj) {'name'=>'height', 'get'=> proc{_obj.cget('height')}, 'set'=> proc{|t| _obj.configure('height'=>t)}, 'def'=> "" } end |
.highlightbackground(_obj) ⇒ Object
1783 1784 1785 1786 1787 1788 1789 1790 |
# File 'lib/tk/al-tk.rb', line 1783 def TkProperties.highlightbackground(_obj) {'name'=>'highlightbackground', 'get'=> proc{_obj.cget('highlightbackground')}, 'set'=> proc{|background| _obj.configure('highlightbackground'=>background)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.highlightcolor(_obj) ⇒ Object
1809 1810 1811 1812 1813 1814 1815 1816 |
# File 'lib/tk/al-tk.rb', line 1809 def TkProperties.highlightcolor(_obj) {'name'=>'highlightcolor', 'get'=> proc{_obj.cget('highlightcolor')}, 'set'=> proc{|background| _obj.configure('highlightcolor'=>background)}, 'def'=> '', 'type'=> TkType::TkagColor } end |
.highlightthickness(_obj) ⇒ Object
1818 1819 1820 1821 1822 1823 1824 |
# File 'lib/tk/al-tk.rb', line 1818 def TkProperties.highlightthickness(_obj) {'name'=>'highlightthickness', 'get'=> proc{_obj.cget('highlightthickness')}, 'set'=> proc{|x| _obj.configure('highlightthickness'=>x)}, 'def'=> '' } end |
.image(_obj) ⇒ Object
1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 |
# File 'lib/tk/al-tk.rb', line 1960 def TkProperties.image(_obj) {'name'=>'image', 'get'=> proc{_ret = _obj.cget('image') if ! _ret.kind_of?(String) _ret = _ret.cget('file') end _ret }, 'set'=> proc{|j| _obj.configure('image'=>TkAllPhotoImage.new('file' => j))}, 'def'=> proc{|x| if x.to_s.length > 2 "image TkPhotoImage.new('file' => #{x})" else "" end }, 'type'=> TkType::TkagFile } end |
.justify(_obj) ⇒ Object
2070 2071 2072 2073 2074 2075 2076 2077 |
# File 'lib/tk/al-tk.rb', line 2070 def TkProperties.justify(_obj) {'name'=>'justify', 'get'=> proc{_obj.cget('justify')}, 'set'=> proc{|j| _obj.configure('justify'=>j)}, 'def'=> "", 'type'=> TkType::TkagJustify } end |
.labelanchor(_obj) ⇒ Object
2052 2053 2054 2055 2056 2057 2058 2059 |
# File 'lib/tk/al-tk.rb', line 2052 def TkProperties.labelanchor(_obj) {'name'=>'labelanchor', 'get'=> proc{_obj.cget('labelanchor')}, 'set'=> proc{|a| _obj.configure('labelanchor'=>a)}, 'def'=> "", 'type'=> TkType::TkagAnchor } end |
.labelwidget(_obj) ⇒ Object
2124 2125 2126 2127 2128 2129 2130 |
# File 'lib/tk/al-tk.rb', line 2124 def TkProperties.(_obj) {'name'=>'labelwidget', 'get'=> proc{_obj.cget('labelwidget')}, 'set'=> proc{|t| _obj.configure('labelwidget'=>t)}, 'def'=> "" } end |
.orient(_obj) ⇒ Object
2034 2035 2036 2037 2038 2039 2040 2041 |
# File 'lib/tk/al-tk.rb', line 2034 def TkProperties.orient(_obj) {'name'=>'orient', 'get'=> proc{_obj.cget('orient')}, 'set'=> proc{|o| _obj.configure('orient'=>o)}, 'def'=> "", 'type'=> TkType::TkagOrient } end |
.overrelief(_obj) ⇒ Object
1881 1882 1883 1884 1885 1886 1887 1888 1889 |
# File 'lib/tk/al-tk.rb', line 1881 def TkProperties.overrelief(_obj) {'name'=>'overrelief', #'default'=> 'ridge', 'get'=> proc{_obj.cget('overrelief')}, 'set'=> proc{|r| _obj.configure('overrelief'=>r)}, 'def'=> "", 'type'=> TkType::TkagRelief } end |
.padx(_obj) ⇒ Object
2015 2016 2017 2018 2019 2020 2021 2022 |
# File 'lib/tk/al-tk.rb', line 2015 def TkProperties.padx(_obj) {'name'=>'padx', #'default'=> 0, 'get'=> proc{_obj.cget('padx')}, 'set'=> proc{|b| _obj.configure('padx'=>b)}, 'def'=> "" } end |
.pady(_obj) ⇒ Object
2024 2025 2026 2027 2028 2029 2030 2031 |
# File 'lib/tk/al-tk.rb', line 2024 def TkProperties.pady(_obj) {'name'=>'pady', #'default'=> 0, 'get'=> proc{_obj.cget('pady')}, 'set'=> proc{|b| _obj.configure('pady'=>b)}, 'def'=> "" } end |
.property(_name, _obj) ⇒ Object
1757 1758 1759 1760 1761 1762 |
# File 'lib/tk/al-tk.rb', line 1757 def TkProperties.property(_name, _obj) {'name'=>_name, 'get'=> proc{_obj.cget(_name)}, 'set'=> proc{|value| _obj.configure(_name=>value)} } end |
.relief(_obj) ⇒ Object
1871 1872 1873 1874 1875 1876 1877 1878 |
# File 'lib/tk/al-tk.rb', line 1871 def TkProperties.relief(_obj) {'name'=>'relief', 'get'=> proc{_obj.cget('relief')}, 'set'=> proc{|r| _obj.configure('relief'=>r)}, 'def'=> "", 'type'=> TkType::TkagRelief } end |
.state(_obj) ⇒ Object
1943 1944 1945 1946 1947 1948 1949 1950 |
# File 'lib/tk/al-tk.rb', line 1943 def TkProperties.state(_obj) {'name'=>'state', 'get'=> proc{_obj.cget('state')}, 'set'=> proc{|s| _obj.configure('state'=>s)}, 'def'=> "", 'type'=> TkType::TkagState } end |
.takefocus(_obj) ⇒ Object
2079 2080 2081 2082 2083 2084 2085 2086 |
# File 'lib/tk/al-tk.rb', line 2079 def TkProperties.takefocus(_obj) {'name'=>'takefocus', 'get'=> proc{_obj.cget('takefocus')}, 'set'=> proc{|j| _obj.configure('takefocus'=>j)}, 'def'=> "", 'type'=> EnumType.new(0,1) } end |
.text(_obj) ⇒ Object
2116 2117 2118 2119 2120 2121 2122 2123 |
# File 'lib/tk/al-tk.rb', line 2116 def TkProperties.text(_obj) {'name'=>'text', 'start'=> '<...>', 'get'=> proc{_obj.cget('text')}, 'set'=> proc{|t| _obj.configure('text'=>t)}, 'def'=> "" } end |
.width(_obj) ⇒ Object
1792 1793 1794 1795 1796 1797 1798 |
# File 'lib/tk/al-tk.rb', line 1792 def TkProperties.width(_obj) {'name'=>'width', 'get'=> proc{_obj.cget('width')}, 'set'=> proc{|t| _obj.configure('width'=>t)}, 'def'=> "" } end |
.wraplength(_obj) ⇒ Object
1952 1953 1954 1955 1956 1957 1958 |
# File 'lib/tk/al-tk.rb', line 1952 def TkProperties.wraplength(_obj) {'name'=>'wraplength', 'get'=> proc{_obj.cget('wraplength')}, 'set'=> proc{|w| _obj.configure('wraplength'=>w)}, 'def'=> "" } end |
.xscrollcommand(_obj) ⇒ Object
1899 1900 1901 1902 1903 1904 1905 |
# File 'lib/tk/al-tk.rb', line 1899 def TkProperties.xscrollcommand(_obj) {'name'=>'xscrollcommand', 'get'=> proc{_obj.cget('xscrollcommand')}, 'set'=> proc{|r| _obj.configure('xscrollcommand'=>r)}, 'def'=> "" } end |
.yscrollcommand(_obj) ⇒ Object
1907 1908 1909 1910 1911 1912 1913 |
# File 'lib/tk/al-tk.rb', line 1907 def TkProperties.yscrollcommand(_obj) {'name'=>'yscrollcommand', 'get'=> proc{_obj.cget('yscrollcommand')}, 'set'=> proc{|r| _obj.configure('yscrollcommand'=>r)}, 'def'=> "" } end |