官术网_书友最值得收藏!

There's more...

We subclassed the Tk class in our example, but it is also common to subclass other widget classes. We did this to reproduce the same statements that we had before we refactored the code.

However, it may be more convenient to subclass Frame or Toplevel in larger programs, such as those with multiple windows. This is because a Tkinter application should have only one Tk instance, and the system creates one automatically if you instantiate a widget before you create the Tk instance.

Keep in mind that this decision does not affect the structure of our App class since all widget classes have a mainloop method that internally starts the Tk main loop.

主站蜘蛛池模板: 兴安县| 安阳市| 阳曲县| 介休市| 怀远县| 将乐县| 中卫市| 沈阳市| 许昌市| 罗源县| 韶山市| 北碚区| 铜川市| 博客| 准格尔旗| 涡阳县| 屯留县| 横山县| 阿坝县| 葫芦岛市| 工布江达县| 阿拉善左旗| 磐石市| 威信县| 辰溪县| 萝北县| 格尔木市| 平舆县| 区。| 岢岚县| 理塘县| 高尔夫| 沁阳市| 格尔木市| 临泉县| 建德市| 蒲城县| 苏尼特左旗| 盐源县| 新晃| 建昌县|