Question: i am new to python programming and i have still difficulties at some points. Now I struggle with recursive functions.
My assignment is to sum from 0 to 3 the square of that number, by using recursive functions My code so far looks like this:

```
sum = 0
n = 3
i = 1

def summe(i,sum):
    sum = sum +(i*i)
    if(i <= n):
       i = i+1
       print sum
       return summe(i, sum)
    else:
       print sum

```

The Output is empty, even the sum in the if-clause isnt printed out. I followed the examples I found online, but I dont see where i did something particular wrong.

Answer: 
Perhaps like you, I expected lines to expand as necessary. But I confirmed the problem with the code below, with the solution (the two style lines) omitted. When I could not find the solution [here](http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-Treeview.html) and the corresponding Style page, I googled and found [this](https://groups.google.com/forum/#!topic/comp.lang.tcl/dv2urOQTeUA). Scroll down to Emiliano's answer, and some of the following (there is also an indent option).

```
import tkinter as tk
from tkinter import ttk

root = tk.Tk()
root.geometry('500x200')
style = ttk.Style(root)
style.configure('Treeview', rowheight=40)  #SOLUTION
tree = ttk.Treeview(root)
tree.insert('', 0, text='Line 1 of many XXX', tags='T')
tree.insert('', 1, text='Line 2 of many XXX', tags='T')
tree.insert('', 2, text='Line 3 of many XXX', tags='T')
tree.column('#0', stretch=True)
tree.tag_configure('T', font='Arial 20')
tree.pack(fill='x')

```

The above, with the answer omitted, is an example of minimal code that exhibits the problem. This is the sort of thing to post!

**EDIT 1:**

To make the Calendar widget properly importable and usable in another application, it should use a custom style, so its style does not affect any other treeviews in the app. 

```
style.configure('Calendar.Treeview', rowheight=40)
tree = ttk.Treeview(root, style='Calendar.Treeview')

```

**EDIT 2:**

I am just learning about ttk styles myself. To answer your relief question, I went to this [style doc](http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-layouts.html) and tried the following in Idle's Shell after running the above, with the two modifications in Edit 1.

```
>>> style.layout('Calendar.Treeview')
[('Treeview.field', {'sticky': 'nswe', 'children': [('Treeview.padding',
{'sticky': 'nswe', 'children': [('Treeview.treearea', {'sticky': 'nswe'})]})], 'border': '1'})]
>>> style.element_options('Calendar.Treeview.border')
('-relief',)
>>> style.lookup('Calendar.Treeview.border', 'relief')
''
>>> style.configure('Calendar.Treeview.border', relief='raised')
{}

```

I do not see any border nor did not see any effect of the setting. Perhaps relief applies to borders between columns. I don't know. (Note that changing rowheight is immediately available, so configuration is 'live'.)
I found that the Tkinter Font object has a metrics() method, that gives its height as "linespace". That allows the row height to be scaled dynamically:

```
try:
    from tkinter.font import Font
    from tkinter.ttk import Style, Treeview
    from tkinter import *         
except:
    from tkFont import Font
    from ttk import Style, Treeview
    from Tkinter import *

font=Font(family='Arial', size=20)
font.metrics()
#output: {'ascent': 31, 'descent': 7, 'linespace': 38, 'fixed': 0}

```

With that, you can get the font height with:

```
font.metrics()['linespace']
#output: 38

```

Then use it to set the rowheight in your Treeview widget:

```
fontheight=font.metrics()['linespace']

style=Style()
style.configure('Calendar.Treeview', font=font, rowheight=fontheight)   

tree=Treeview(style='Calendar.Treeview')

```

Changing the font object parameters comfortably updates the Treeview widget, but the rowheight doesn't get updated, and needs to be redone. So for example, scaling the font size with a keyboard shortcut may look like this:

```
def scaleup(event):
    font['size']+=1
    style.configure('Calendar.Treeview', rowheight=font.metrics()['linespace'])

def scaledown(event):
    font['size']-=1
    style.configure('Calendar.Treeview', rowheight=font.metrics()['linespace'])

tree.bind('<Control-equal>', scaleup)
tree.bind('<Control-minus>', scaledown)

```

I actually wanted to do the same with Control-MouseWheel, but didn't figure out the behavior yet (Would be glad to hear how that works).

Hope this comes handy.