当前位置: 首页>>代码示例>>Python>>正文


Python Notebook.place方法代码示例

本文整理汇总了Python中ttk.Notebook.place方法的典型用法代码示例。如果您正苦于以下问题:Python Notebook.place方法的具体用法?Python Notebook.place怎么用?Python Notebook.place使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ttk.Notebook的用法示例。


在下文中一共展示了Notebook.place方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: View

# 需要导入模块: from ttk import Notebook [as 别名]
# 或者: from ttk.Notebook import place [as 别名]
class View(Toplevel):
    def __init__(self, model):
        self.model = model
        self.model_config = self.model.get_config()
        self.channels_num = 0
        self.channels_amount = 0

        self.root = Tk()
        self.root.resizable(width=FALSE, height=FALSE)
        self.root.title("RaaS. event_proxy configurator")
        #: self.root.iconbitmap('resourse/vit.ico')
        self.config_route = self.model.get_config_route()

        self.panelFrame = Frame(self.root, height=60)
        self.canvas = Canvas(self.root, borderwidth=0)
        self.textFrame = Frame(self.canvas, height=340, width=600)
        self.mainFrame = LabelFrame(self.root, width=200, text="Main:",
                                    height=340, relief=RAISED, borderwidth=1)
        self.chanelFrame = LabelFrame(self.root, width=370, text="Channels:",
                                      height=340, relief=RAISED, borderwidth=1)

        #: self.vsb = Scrollbar(self.root, orient="horizontal",
        #:                     command=self.canvas.xview)
        #:self.canvas.configure(xscrollcommand=self.vsb.set)
        #:self.vsb.pack(side="bottom", fill="x")
        self.canvas.pack(side="bottom", fill="both", expand=True)
        self.canvas.configure(scrollregion=self.canvas.bbox("all"))
        self.root.protocol("WM_DELETE_WINDOW", self.quit_handler)

        self.tabs = Notebook(self.root)
        self.in_channel_text = []
        self.out_port_text = []
        self.out_channel_text = []

        self.c = self.model.get_channels().keys()
        self.channels_len = len(self.model.get_channels())
        #:print self.model.get_channels()
        self.panelFrame.pack(side='top', fill='x')
        self.textFrame.pack(side='bottom', fill='both', expand=1)
        self.mainFrame.place(x=10, y=60)
        self.chanelFrame.place(x=220, y=60)
        self.tabs.place(x=230, y=80)

        x = (self.root.winfo_screenwidth() - self.root.winfo_reqwidth()) / 2
        y = (self.root.winfo_screenheight() - self.root.winfo_reqheight()) / 2
        self.root.geometry("+%d+%d" % (x-150, y-150))

        for i in range(self.channels_len):
            self.channels_num += 1
            self.channels_amount += 1

            self.f1 = Frame(self.tabs, height=290, width=350)
            self.tabs.add(self.f1, text='Channel {0}'.format(i + 1))

            self.in_channel = Label(self.f1, text="In channel")
            self.out_port = Label(self.f1, text="Out port")
            self.out_channel = Label(self.f1, text="Out channel")

            self.in_channel_text.append(Entry(self.f1, width=20, bd=3))
            self.in_channel_text[i].insert(0, self.c[i])

            self.out_port_text.append(Entry(self.f1, width=20, bd=3))
            self.out_port_text[i].insert(0, self.model.get_channels()[
                self.c[i]].out_port)

            self.out_channel_text.append(Entry(self.f1, width=20, bd=3))
            self.out_channel_text[i].insert(0, self.model.get_channels()[
                self.c[i]].out_channel)

            self.in_channel.place(x=5, y=10)
            self.in_channel_text[i].place(x=5, y=30)

            self.out_port.place(x=5, y=50)
            self.out_port_text[i].place(x=5, y=70)

            self.out_channel.place(x=5, y=90)
            self.out_channel_text[i].place(x=5, y=110)

            self.del_ch_btn = Button(self.f1, text='Delete channel {0}'.format(
                self.channels_amount),
                                     command=
                                     lambda: self.del_channel(i))
            self.del_ch_btn.bind("<Button-1>")
            self.del_ch_btn.place(x=5, y=140, width=100, height=30)

        self.server_host_label = Label(self.root, text="Server host")
        self.server_port_label = Label(self.root, text="Server port")
        self.raas_port_label = Label(self.root, text="Raas port")
        self.encoding_label = Label(self.root, text='Encoding')
        self.levenshtein_distance_label = Label(self.root,
                                                text='Levenshtein distance')
        self.window_time_label = Label(self.root, text='Window time')

        self.server_host_entity = Entry(self.root, width=20, bd=3)
        self.server_host_entity.insert(0, self.model_config['server_host'])

        self.server_port_entity = Entry(self.root, width=20, bd=3)
        self.server_port_entity.insert(0, self.model_config['server_port'])

        self.raas_port_entity = Entry(self.root, width=20, bd=3)
#.........这里部分代码省略.........
开发者ID:imressed,项目名称:pythonway,代码行数:103,代码来源:tkinter.py


注:本文中的ttk.Notebook.place方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。