title: find index of elements created with window_create inside tkinter Text
body: <p>I used window_create to create interactive buttons inside a Text element. The buttons represent random or static values and I want to be able to compile the contents of the text element and replace the buttons with their respective values. However, I cannot find where any of the buttons are.</p>
  
  <p>I've tried <code>self.text.get("1.0",tk.END)</code>, but it only returns the text, not including the button elements</p>
  
  <p>the button elements are created like so:</p>
  
  <pre class="lang-py prettyprint-override"><code>btn_text = tk.StringVar()
  value = StaticValue('static', btn_text, self.custom_val_veiwer, idx)
  button = tk.Button(self.text, 
                          textvariable=btn_text, command=lambda v=value: 
                          self.veiw_custom_val(None, val=v))
  btn_text.set('static')
  self.custom_vals.append(value)
  self.text.window_create(tk.INSERT, window=button)
  </code></pre>
  
  <p>edit:
  if you want to recreate the problem use this:</p>
  
  <pre class="lang-py prettyprint-override"><code>import tkinter as tk
  
  root = tk.Tk()
  text = tk.Text(root)
  text.pack()
  
  text.insert(tk.END, 'before button')
  
  button = tk.Button(text, text='button')
  text.window_create(tk.END, window=button)
  
  text.insert(tk.END, 'after button')
  print(text.get("1.0",tk.END))
  root.mainloop()
  </code></pre>
  
  <p>notice how the button appears in the text field, but it is not printed out </p>
  
  <p>(the output is  <code>before buttonafter button</code> I want someting like <code>before button&lt;button&gt;after button</code> or a function that would tell me there is a button at row x at index y)</p>