當前位置: 首頁>>代碼示例>>Python>>正文


Python Window.getClientWidth方法代碼示例

本文整理匯總了Python中Window.getClientWidth方法的典型用法代碼示例。如果您正苦於以下問題:Python Window.getClientWidth方法的具體用法?Python Window.getClientWidth怎麽用?Python Window.getClientWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Window的用法示例。


在下文中一共展示了Window.getClientWidth方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: onModuleLoad

# 需要導入模塊: import Window [as 別名]
# 或者: from Window import getClientWidth [as 別名]
    def onModuleLoad(self):
        self.singleton = self

        topPanel = TopPanel()
        rightPanel = VerticalPanel()
        self.mailDetail = MailDetail()
        self.shortcuts = Shortcuts()

        topPanel.setWidth("100%")

        # MailList uses Mail.get() in its constructor, so initialize it after
        # 'singleton'.
        mailList = MailList(self.singleton)
        mailList.setWidth("100%")
        
        # Create the right panel, containing the email list & details.
        rightPanel.add(mailList)
        rightPanel.add(self.mailDetail)
        mailList.setWidth("100%")
        self.mailDetail.setWidth("100%")

        # Create a dock panel that will contain the menu bar at the top,
        # the shortcuts to the left, and the mail list & details taking the rest.
        outer = DockPanel()
        outer.add(topPanel, DockPanel.NORTH)
        outer.add(self.shortcuts, DockPanel.WEST)
        outer.add(rightPanel, DockPanel.CENTER)
        outer.setWidth("100%")

        outer.setSpacing(4)
        outer.setCellWidth(rightPanel, "100%")

        # Hook the window resize event, so that we can adjust the UI.
        #FIXME need implementation # Window.addWindowResizeListener(this)
        #Window.addWindowResizeListener(self)

        # Get rid of scrollbars, and clear out the window's built-in margin,
        # because we want to take advantage of the entire client area.
        Window.enableScrolling(False)
        Window.setMargin("0px")
        
        # Finally, add the outer panel to the RootPanel, so that it will be
        # displayed.
        #RootPanel.get().add(outer) # FIXME get#
        RootPanel().add(outer)
        RootPanel().add(Logger())
        
        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        # FIXME - need implementation#
        #     DeferredCommand.add(onWindowResized(Window.getClientWidth(), Window.getClientHeight()))

        self.onWindowResized(Window.getClientWidth(), Window.getClientHeight())
開發者ID:AwelEshetu,項目名稱:cwm,代碼行數:57,代碼來源:Mail.py

示例2: onClick

# 需要導入模塊: import Window [as 別名]
# 或者: from Window import getClientWidth [as 別名]
    def onClick(self, sender):
        if (sender == self.signOutLink):
            Window.alert("If this were implemented, you would be signed out now.")
        elif (sender == self.aboutLink):
            # When the 'About' item is selected, show the AboutDialog.
            # Note that showing a dialog box does not block -- execution continues
            # normally, and the dialog fires an event when it is closed.
            dlg = AboutDialog()

            # Position it roughly in the middle of the screen.
            left = (Window.getClientWidth() - 512) / 2
            top = (Window.getClientHeight() - 256) / 2
            #Logger("TopPanel", "left: " + left)
            #Logger("TopPanel", "top: " + top)
            dlg.setPopupPosition(left, top)

            dlg.show()
開發者ID:pombredanne,項目名稱:pyjamas-desktop,代碼行數:19,代碼來源:TopPanel.py

示例3: execute

# 需要導入模塊: import Window [as 別名]
# 或者: from Window import getClientWidth [as 別名]
 def execute(self):
     self.onWindowResized(Window.getClientWidth(), Window.getClientHeight())
開發者ID:pombredanne,項目名稱:pyjamas-desktop,代碼行數:4,代碼來源:Mail.py


注:本文中的Window.getClientWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。