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


Python Window.addWindowResizeListener方法代码示例

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


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

示例1: createRightPanel

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def createRightPanel(self):
        span = self.stabPanel = SimplePanel(Height="100%")
        
        tabs = self.tabPanel = TabPanel(Width="100%", Border=1,Height="100%")
        
        
        adgui = self.adinfoPanel = AdinfoIFACE(self)
        tabs.add(adgui.panel, "AstroData Viewer")
        
        calsgui = self.calsPanel = CalsIFACE(self)
        tabs.add(calsgui.panel, "Calibrations")
        
        
        rsgui = RecipeSystemIFACE.ReducePanelIFACE(self)
        tabs.add(rsgui.panel, "Execute Reduce")

        rogui = RecipeSystemIFACE.ReduceOutputIFACE(self)
        tabs.add(rogui.panel, "Reduce Output")
        Window.addWindowResizeListener(rogui)
        
        tifs = self.tabIFACEs = [adgui, calsgui, rsgui, rogui]
        self.tabIFACEdict = {"adgui": tifs.index(adgui),
                            "calsgui": tifs.index(calsgui),
                            "rsgui": tifs.index(rsgui),
                            "rogui": tifs.index(rogui)}
        self.curTabIFACE = tifs[0]
        tabs.selectTab(0)
        
        span.add(tabs)
        
        
        tabs.addTabListener(self, getattr(self, "onTabSelected"))
        
        return span
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:36,代码来源:ADViewerIFACE.py

示例2: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):

        dock = DockPanel(Width="100%")
        self.header = HTML(Width="100%", Height="220px")
        self.footer = HTML(Width="100%")
        self.sidebar = HTML(Width="200px", Height="100%", StyleName="sidebar")
        self.fTabs = DecoratedTabPanel(Size=("100%", "100%"), StyleName="tabs")

        #dp = DecoratorTitledPanel("Tabs", "bluetitle", "bluetitleicon",
        #              ["bluetop", "bluetop2", "bluemiddle", "bluebottom"])
        #dp.add(self.fTabs)

        dock.add(self.header, DockPanel.NORTH)
        dock.add(self.footer, DockPanel.SOUTH)
        dock.add(self.sidebar, DockPanel.EAST)
        dock.add(self.fTabs, DockPanel.CENTER)
        dock.setCellVerticalAlignment(self.fTabs, HasAlignment.ALIGN_TOP)
        #dock.setCellHorizontalAlignment(self.fTabs, HasAlignment.ALIGN_CENTER)
        dock.setCellWidth(self.header, "100%")
        dock.setCellHeight(self.header, "220px")
        dock.setCellWidth(self.footer, "100%")
        dock.setCellWidth(self.sidebar, "200px")

        RootPanel().add(dock)
        self.dock = dock

        self.loadPageList()

        Window.addWindowResizeListener(self)

        DeferredCommand.add(self)
开发者ID:brodybits,项目名称:pyjs.org,代码行数:33,代码来源:website.py

示例3: __init__

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def __init__(self, parent=None):

        Sink.__init__(self, parent)

        self.frame = Frame("/summary", Size=("100%",rccutil.getHeight()))
        self.initWidget(self.frame)
        Window.addWindowResizeListener(self)
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:9,代码来源:FITSStoreFACE.py

示例4: testResize

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
 def testResize(self):
     # TODO: window resizing does not work accuratly in browser
     # because getClientWidth etc does not really match GWT. We
     # need to copy the GWT implementation
     if IN_BROWSER:
         return
     self.resize_test = True
     Window.addWindowResizeListener(self)
     self.h = Window.getClientHeight()
     self.w = Window.getClientWidth()
     Window.resize(800, 600)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:13,代码来源:WindowTest.py

示例5: __init__

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
 def __init__(self, parent = None):
     PanelIFACE.__init__(self, parent)
     
     self.panel = ScrollPanel()
     adinfo = HTML("", Size=("100%", parent.getHeight()))
     self.panel.setSize("100%", parent.getHeight())
     
     self.panel.add(adinfo)
     self.adInfo = parent.adInfo = adinfo
     Window.addWindowResizeListener(self)
     return
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:13,代码来源:DataDictTree.py

示例6: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [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.

        DeferredCommand.add(self)
开发者ID:Afey,项目名称:pyjs,代码行数:54,代码来源:Mail.py

示例7: __init__

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def __init__(self):
        SimplePanel.__init__(self, StyleName='main-panel')
        self.setWidth('100%')
        self.tabs = tabs.Tabs()
        self.tabs.addTabListener(self)
        self.add(self.tabs)
        
        Window.addWindowResizeListener(self)
        DeferredCommand.add(self)

        args = Window.getLocation().getSearchDict()
        userlist.setSortKey(args.get('sort'))        
        userlist.setIconSize(args.get('icons'))        
开发者ID:jdunck,项目名称:Tickery,代码行数:15,代码来源:index.py

示例8: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):

        self.remote = InfoServicePython()

        self.tree_width = 200

        self.tp = HorizontalPanel()
        self.tp.setWidth("%dpx" % (self.tree_width))
        self.treeview = Trees()
        self.treeview.fTree.addTreeListener(self)
        self.sp = ScrollPanel()
        self.tp.add(self.treeview)
        self.sp.add(self.tp)
        self.sp.setHeight("100%")

        self.horzpanel1 = HorizontalPanel()
        self.horzpanel1.setSize("100%", "100%")
        self.horzpanel1.setBorderWidth(1)
        self.horzpanel1.setSpacing("10px")

        self.rp = RightPanel()
        self.rps = ScrollPanel()
        self.rps.add(self.rp)
        self.rps.setWidth("100%")
        self.rp.setWidth("100%")

        self.cp1 = CollapserPanel(self)
        self.cp1.setWidget(self.sp)
        self.cp1.setHTML(" ")


        self.midpanel = MidPanel(self)
        self.cp2 = CollapserPanel(self)
        self.cp2.setWidget(self.midpanel)
        self.cp2.setHTML(" ")

        self.horzpanel1.add(self.cp1)
        self.horzpanel1.add(self.cp2)
        self.horzpanel1.add(self.rps)

        self.cp1.setInitialWidth("%dpx" % self.tree_width)
        self.cp2.setInitialWidth("200px")

        RootPanel().add(self.horzpanel1)

        width = Window.getClientWidth()
        height = Window.getClientHeight()

        self.onWindowResized(width, height)
        Window.addWindowResizeListener(self)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:52,代码来源:InfoDirectory.py

示例9: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):
        b = Button("Click me", greet)
        hp = HorizontalPanel()
        hp.setWidth("100%")
        hp.setHeight("100%")
        hp.setBorderWidth("1")
        l = Label("hello world")
        hp.add(l)
        RootPanel().add(b)
        RootPanel().add(hp)

        #DOM.setCapture(l)
        #DOM.setEventListener(l, self)

        Window.addWindowResizeListener(self)
        Timer(1000, self)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:18,代码来源:Hello.py

示例10: loadChapters

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def loadChapters(self):

        self.curInfo = ''
        self.curSink = None
        self.description = HTML()
        self.sink_list = SinkList()
        self.panel = DockPanel()
        
        self.loadSinks()
        self.sinkContainer = DockPanel()
        self.sinkContainer.setStyleName("ks-Sink")

        #self.nf = NamedFrame("section")
        #self.nf.setWidth("100%")
        #self.nf.setHeight("10000")

        height = Window.getClientHeight()

        self.sp = ScrollPanel(self.sinkContainer)
        #self.sp = VerticalSplitPanel()
        self.sp.setWidth("100%")
        self.sp.setHeight("%dpx" % (height-110))

        #self.sp.setTopWidget(self.sinkContainer)
        #self.sp.setBottomWidget(self.nf)
        #self.sp.setSplitPosition(10000) # deliberately high - max out.

        vp = VerticalPanel()
        vp.setWidth("100%")
        vp.setHeight("100%")
        vp.add(self.description)
        vp.add(self.sp)

        self.description.setStyleName("ks-Intro")

        self.panel.add(self.sink_list, DockPanel.WEST)
        self.panel.add(vp, DockPanel.CENTER)

        self.panel.setCellVerticalAlignment(self.sink_list,
                                            HasAlignment.ALIGN_TOP)
        self.panel.setCellWidth(vp, "100%")
        self.panel.setCellHeight(vp, "100%")

        Window.addWindowResizeListener(self)

        History.addHistoryListener(self)
        RootPanel().add(self.panel)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:49,代码来源:Bookreader.py

示例11: loadChapters

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def loadChapters(self):

        self.curInfo = ''
        self.curSink = None
        self.description = HTML()
        self.sink_list = SinkList()
        self.panel = DockPanel()

        self.loadSinks()
        self.sinkContainer = DockPanel()
        self.sinkContainer.setStyleName("ks-Sink")

        #self.nf = NamedFrame("section")
        #self.nf.setWidth("100%")
        #self.nf.setHeight("10000")

        self.sp = ScrollPanel(self.sinkContainer)
        #self.sp = VerticalSplitPanel()
        self.sp.setWidth("100%")
        self.sp.setHeight("100%")

        #self.sp.setTopWidget(self.sinkContainer)
        #self.sp.setBottomWidget(self.nf)
        #self.sp.setSplitPosition(10000) # deliberately high - max out.

        vp = VerticalPanel()
        vp.setWidth("99%")
        vp.setHeight("100%")
        vp.add(self.description)
        vp.add(self.sp)

        authors = [
            ("2008, 2009", "Kenneth Casson Leighton", "[email protected]")
        ]
        for years, name, email in authors:
            authors_html = \
            '&copy; %s <a href="mailto:%s">%s</a><br />' %\
            (years, email, name)
        authors_panel = HTML()
        authors_panel.setStyleName("ks-Authors")
        authors_panel.setHTML(authors_html[:-6])

        left_panel = DockPanel(Height="100%")
        left_panel.add(self.sink_list, DockPanel.NORTH)
        left_panel.add(authors_panel, DockPanel.SOUTH)

        self.description.setStyleName("ks-Intro")

        self.panel.add(left_panel, DockPanel.WEST)
        self.panel.add(vp, DockPanel.CENTER)

        self.panel.setCellVerticalAlignment(self.sink_list,
                                            HasAlignment.ALIGN_TOP)
        self.panel.setCellWidth(vp, "100%")
        self.panel.setCellHeight(vp, "100%")

        Window.addWindowResizeListener(self)

        History.addHistoryListener(self)
        RootPanel().add(self.panel)

        self.onWindowResized(Window.getClientWidth(), Window.getClientHeight())
开发者ID:Afey,项目名称:pyjs,代码行数:64,代码来源:Bookreader.py

示例12: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>History</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>History</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/History.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/History.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('History'),
]

        class_content = {
'History': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="History">class <strong>History</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Simple&nbsp;<a href="#History">History</a>&nbsp;management&nbsp;class&nbsp;for&nbsp;back/forward&nbsp;button&nbsp;support.<br>
&nbsp;<br>
This&nbsp;class&nbsp;allows&nbsp;your&nbsp;AJAX&nbsp;application&nbsp;to&nbsp;use&nbsp;a&nbsp;history.&nbsp;&nbsp;Each&nbsp;time&nbsp;you<br>
call&nbsp;<a href="#History-newItem">newItem</a>(),&nbsp;a&nbsp;new&nbsp;item&nbsp;is&nbsp;added&nbsp;to&nbsp;the&nbsp;history&nbsp;and&nbsp;the&nbsp;history<br>
listeners&nbsp;are&nbsp;notified.&nbsp;&nbsp;If&nbsp;the&nbsp;user&nbsp;clicks&nbsp;the&nbsp;browser's&nbsp;forward&nbsp;or&nbsp;back&nbsp;<br>
buttons,&nbsp;the&nbsp;appropriate&nbsp;item&nbsp;(a&nbsp;string&nbsp;passed&nbsp;to&nbsp;newItem)&nbsp;is&nbsp;fetched<br>
from&nbsp;the&nbsp;history&nbsp;and&nbsp;the&nbsp;history&nbsp;listeners&nbsp;are&nbsp;notified.<br>
&nbsp;<br>
The&nbsp;address&nbsp;bar&nbsp;of&nbsp;the&nbsp;browser&nbsp;contains&nbsp;the&nbsp;current&nbsp;token,&nbsp;using&nbsp;<br>
the&nbsp;"#"&nbsp;seperator&nbsp;(for&nbsp;implementation&nbsp;reasons,&nbsp;not&nbsp;because&nbsp;we&nbsp;love&nbsp;<br>
the&nbsp;#&nbsp;mark).<br>
&nbsp;<br>
You&nbsp;may&nbsp;want&nbsp;to&nbsp;check&nbsp;whether&nbsp;the&nbsp;hash&nbsp;already&nbsp;contains&nbsp;a&nbsp;history<br>
token&nbsp;when&nbsp;the&nbsp;page&nbsp;loads&nbsp;and&nbsp;use&nbsp;that&nbsp;to&nbsp;show&nbsp;appropriate&nbsp;content;<br>
this&nbsp;allows&nbsp;users&nbsp;of&nbsp;the&nbsp;site&nbsp;to&nbsp;store&nbsp;direct&nbsp;links&nbsp;in&nbsp;their<br>
bookmarks&nbsp;or&nbsp;send&nbsp;them&nbsp;in&nbsp;emails.<br>
&nbsp;<br>
To&nbsp;make&nbsp;this&nbsp;work&nbsp;properly&nbsp;in&nbsp;all&nbsp;browsers,&nbsp;you&nbsp;must&nbsp;add&nbsp;a&nbsp;specially<br>
named&nbsp;iframe&nbsp;to&nbsp;your&nbsp;html&nbsp;page,&nbsp;like&nbsp;this:<br>
&nbsp;<br>
&lt;iframe&nbsp;id='__pygwt_historyFrame'&nbsp;style='width:0;height:0;border:0'&gt;&lt;/iframe&gt;<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="History-addHistoryListener"><strong>addHistoryListener</strong></a>(self, listener)</dt></dl>

<dl><dt><a name="History-back"><strong>back</strong></a>(self)</dt></dl>

<dl><dt><a name="History-fireHistoryChangedAndCatch"><strong>fireHistoryChangedAndCatch</strong></a>(self)</dt><dd><tt>#&nbsp;TODO</tt></dd></dl>

<dl><dt><a name="History-fireHistoryChangedImpl"><strong>fireHistoryChangedImpl</strong></a>(self, historyToken)</dt></dl>

<dl><dt><a name="History-forward"><strong>forward</strong></a>(self)</dt></dl>

<dl><dt><a name="History-getToken"><strong>getToken</strong></a>(self)</dt></dl>

<dl><dt><a name="History-newItem"><strong>newItem</strong></a>(self, historyToken)</dt></dl>

<dl><dt><a name="History-onHistoryChanged"><strong>onHistoryChanged</strong></a>(self, historyToken)</dt><dd><tt>#&nbsp;TODO&nbsp;-&nbsp;fireHistoryChangedAndCatch&nbsp;not&nbsp;implemented</tt></dd></dl>

<dl><dt><a name="History-removeHistoryListener"><strong>removeHistoryListener</strong></a>(self, listener)</dt></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')
#.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:103,代码来源:docHistory.py

示例13: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>JSONParser</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>JSONParser</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/JSONParser.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/JSONParser.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""<tt>This&nbsp;module&nbsp;contains&nbsp;a&nbsp;JSON&nbsp;Parser&nbsp;class<br>
&nbsp;<br>
JSONEncode:<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;PYGWT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Python&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;JSON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+===============+===================+===============+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_Dict&nbsp;&nbsp;|&nbsp;dict&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;object&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_List&nbsp;&nbsp;|&nbsp;list,&nbsp;tuple&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;array&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;str,&nbsp;unicode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;int,&nbsp;long,&nbsp;float&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;False&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;None&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;<br>
&nbsp;<br>
JSONDecode:<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;JSON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Python&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;PYGWT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+===============+===================+==============+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;object&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;dict&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_Dict&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;array&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_List&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;unicode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;(int)&nbsp;&nbsp;|&nbsp;int,&nbsp;long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;(real)&nbsp;|&nbsp;float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;False&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;None&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+</tt>""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('JSONParser'),
]

        class_content = {
'JSONParser': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JSONParser">class <strong>JSONParser</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="JSONParser-decode"><strong>decode</strong></a>(self, str)</dt></dl>

<dl><dt><a name="JSONParser-decodeAsObject"><strong>decodeAsObject</strong></a>(self, str)</dt></dl>

#.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:103,代码来源:docJSONParser.py

示例14: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>Location</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Location</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/Location.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/Location.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        modules = [r'''<a href="docpyjslib.html">pyjslib</a>''']
        contents = self.multicolumn(modules)
        title = bigtitle('Modules')
        contents = section(title, 'module', contents)
        tp.add(contents, 'Modules')


        classes = [
Proto('Location'),
]

        class_content = {
'Location': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Location">class <strong>Location</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Retrieve&nbsp;this&nbsp;class&nbsp;by&nbsp;calling&nbsp;Window.getLocation().<br>
&nbsp;<br>
This&nbsp;provides&nbsp;a&nbsp;pyjs&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;current&nbsp;location,<br>
with&nbsp;some&nbsp;utility&nbsp;methods&nbsp;for&nbsp;convenience.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Location-__init__"><strong>__init__</strong></a>(self, location)</dt></dl>

<dl><dt><a name="Location-getHash"><strong>getHash</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHashDict"><strong>getHashDict</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHost"><strong>getHost</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHostname"><strong>getHostname</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHref"><strong>getHref</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getPageHref"><strong>getPageHref</strong></a>(self)</dt><dd><tt>Return&nbsp;href&nbsp;with&nbsp;any&nbsp;search&nbsp;or&nbsp;hash&nbsp;stripped</tt></dd></dl>

<dl><dt><a name="Location-getPathname"><strong>getPathname</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getPort"><strong>getPort</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getProtocol"><strong>getProtocol</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getSearch"><strong>getSearch</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getSearchDict"><strong>getSearchDict</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getSearchVar"><strong>getSearchVar</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Location-reload"><strong>reload</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-setHash"><strong>setHash</strong></a>(self, hash)</dt></dl>

<dl><dt><a name="Location-setHashDict"><strong>setHashDict</strong></a>(self, hashDict)</dt></dl>

<dl><dt><a name="Location-setHref"><strong>setHref</strong></a>(self, href)</dt></dl>
#.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:103,代码来源:docLocation.py

示例15: onModuleLoad

# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import addWindowResizeListener [as 别名]
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        # panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML("<h1>HTTPRequest</h1>")
        description = HTML("""""")
        # panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML(
            """
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>HTTPRequest</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/HTTPRequest.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/HTTPRequest.py</a></font></td></tr></table>
    """
        )
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        # panel.setCellHeight(tp, "100%")

        modules = [r"""<a href="docpyjamas.Cookies.html">pyjamas.Cookies</a>""", r"""<a href="docsys.html">sys</a>"""]
        contents = self.multicolumn(modules)
        title = bigtitle("Modules")
        contents = section(title, "module", contents)
        tp.add(contents, "Modules")

        classes = [Proto("HTTPRequest")]

        class_content = {
            "HTTPRequest": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="HTTPRequest">class <strong>HTTPRequest</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="HTTPRequest-asyncGet"><strong>asyncGet</strong></a>(self, user, pwd, url, handler)</dt><dd><tt>#&nbsp;also&nbsp;callable&nbsp;as:&nbsp;<a href="#HTTPRequest-asyncGet">asyncGet</a>(self,&nbsp;url,&nbsp;handler)</tt></dd></dl>

<dl><dt><a name="HTTPRequest-asyncGetImpl"><strong>asyncGetImpl</strong></a>(self, user, pwd, url, handler)</dt></dl>

<dl><dt><a name="HTTPRequest-asyncPost"><strong>asyncPost</strong></a>(self, user, pwd, url, postData<font color="#909090">=None</font>, handler<font color="#909090">=None</font>)</dt><dd><tt>#&nbsp;also&nbsp;callable&nbsp;as:&nbsp;<a href="#HTTPRequest-asyncPost">asyncPost</a>(self,&nbsp;url,&nbsp;postData,&nbsp;handler)</tt></dd></dl>

<dl><dt><a name="HTTPRequest-asyncPostImpl"><strong>asyncPostImpl</strong></a>(self, user, pwd, url, postData, handler)</dt></dl>

<dl><dt><a name="HTTPRequest-createXmlHTTPRequest"><strong>createXmlHTTPRequest</strong></a>(self)</dt></dl>

<dl><dt><a name="HTTPRequest-doCreateXmlHTTPRequest"><strong>doCreateXmlHTTPRequest</strong></a>(self)</dt></dl>

<dl><dt><a name="HTTPRequest-onReadyStateChange"><strong>onReadyStateChange</strong></a>(self, xmlHttp, event, ignorearg)</dt></dl>

</td></tr></table>"""
        }

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, "Classes")

        tp.addTabListener(self)
        tp.selectTab(0)

        # 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.

        DeferredCommand().add(self)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:90,代码来源:docHTTPRequest.py


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