Method: Tk::Tile::TPaned#paneconfiginfo

Defined in:
lib/tkextlib/tile/tpaned.rb

#paneconfiginfo(win) ⇒ Object Also known as: pane_configinfo



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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
196
197
198
199
# File 'lib/tkextlib/tile/tpaned.rb', line 118

def paneconfiginfo(win)
  if TkComm::GET_CONFIGINFO_AS_ARRAY
    win = _epath(win)
    if key
      conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
      conf[0] = conf[0][1..-1]
      if conf[0] == 'hide'
        conf[3] = bool(conf[3]) unless conf[3].empty?
        conf[4] = bool(conf[4]) unless conf[4].empty?
      end
      conf
    else
      tk_split_simplelist(tk_send_without_enc('pane', 
                                              win)).collect{|conflist|
        conf = tk_split_simplelist(conflist)
        conf[0] = conf[0][1..-1]
        if conf[3]
          if conf[0] == 'hide'
            conf[3] = bool(conf[3]) unless conf[3].empty?
          elsif conf[3].index('{')
            conf[3] = tk_split_list(conf[3]) 
          else
            conf[3] = tk_tcl2ruby(conf[3]) 
          end
        end
        if conf[4]
          if conf[0] == 'hide'
            conf[4] = bool(conf[4]) unless conf[4].empty?
          elsif conf[4].index('{')
            conf[4] = tk_split_list(conf[4]) 
          else
            conf[4] = tk_tcl2ruby(conf[4]) 
          end
        end
        conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
        conf
      }
    end
  else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
    win = _epath(win)
    if key
      conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
      key = conf.shift[1..-1]
      if key == 'hide'
        conf[2] = bool(conf[2]) unless conf[2].empty?
        conf[3] = bool(conf[3]) unless conf[3].empty?
      end
      { key => conf }
    else
      ret = {}
      tk_split_simplelist(tk_send_without_enc('pane', 
                                              win)).each{|conflist|
        conf = tk_split_simplelist(conflist)
        key = conf.shift[1..-1]
        if key
          if key == 'hide'
            conf[2] = bool(conf[2]) unless conf[2].empty?
          elsif conf[2].index('{')
            conf[2] = tk_split_list(conf[2]) 
          else
            conf[2] = tk_tcl2ruby(conf[2]) 
          end
        end
        if conf[3]
          if key == 'hide'
            conf[3] = bool(conf[3]) unless conf[3].empty?
          elsif conf[3].index('{')
            conf[3] = tk_split_list(conf[3]) 
          else
            conf[3] = tk_tcl2ruby(conf[3]) 
          end
        end
        if conf.size == 1
          ret[key] = conf[0][1..-1]  # alias info
        else
          ret[key] = conf
        end
      }
      ret
    end
  end
end