Add Minimize & Maximize buttons to TK App?

Hello group,

I am trying to add minimize and maximize buttons(just like sg desktop) to a tk app,
sg_desktop_min_max_buttons

starterapp_no_buttons

Added these lines inside the constructor

self.setWindowFlag(QtCore.Qt.WindowMinimizeButtonHint, True)
self.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint, True)

but nothing happened …

What am I doing wrong here …?