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


Python Sink.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.fPasswordText = PasswordTextBox()
        self.fTextArea = TextArea()
        self.fTextBox = TextBox()

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.add(HTML("Normal text box:"))
        panel.add(self.createTextThing(self.fTextBox))
        panel.add(HTML("Password text box:"))
        panel.add(self.createTextThing(self.fPasswordText))
        panel.add(HTML("Text area:"))
        panel.add(self.createTextThing(self.fTextArea))
        
        panel.add(HTML("""Textarea below demos oninput event. oninput allows
to detect when the content of an element has changed. This is different
from examples above, where changes are detected only if they are made with
keyboard. oninput occurs when the content is changed through any user
interface(keyboard, mouse, etc.). For example, at first type few chars, but
then paste some text to the text areas above and below by selecting 'Paste'
command from context menu or by dragging&dropping and see the difference.
oninput is similar to onchange event, but onchange event fires only when a
text-entry widget loses focus."""))
        vp = VerticalPanel()
        self.echo = HTML()
        textArea = TextArea()
        vp.add(textArea)
        vp.add(self.echo)
        textArea.addInputListener(self)
        panel.add(vp)
        
        self.initWidget(panel)
开发者ID:anandology,项目名称:pyjamas,代码行数:35,代码来源:Text.py

示例2: __init__

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

        Sink.__init__(self, parent)

        text="""
            <div class='infoProse'>
             This is the AstroData Control Center Engineering Interface. 
             <p>
             The "astrodata control center" is an application which 
             acts as a common point of contact for the "reduce" command
             which executes "recipes", providing coordinated sevices such as
             calibration search, image display, stacking-list maintainance,
             and image quality statics.
             </p>
             <p>
             It is
             written in Pyjamas which is a system that compiles python 
             programs into HTML+Javascript. It is entirely separate from 
             the "adcc" 
             application, except that the adcc HTTP interface will serve the 
             HTML which is required for the interface to make use of HTTPRequest.
             </p>
             <p>
             When invoked from the command line, "reduce", if there is no adcc
             running, reduce will start one. This mode could be considered the
             baseline, or normal case. The reduce instance communicates with the
             adcc using XMLRPC, and the adcc essentially acts as a library
             which happens to have its own process.  This interface is only useful
             when adcc is started ahead of time, since otherwise when reduce is
             finished running, the adcc will shut down as well.
             </p>
            </div>"""
        self.initWidget(HTML(text, True))
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:35,代码来源:Info.py

示例3: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):

        Sink.__init__(self)

        self.vp = VerticalPanel()
        self.initWidget(self.vp)
        self.loaded = False
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:Chapter.py

示例4: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.curImage=0
        self.image=Image()
        self.loadingImage = Image(self.baseURL() + "images/blanksearching.gif")
        self.nextButton = Image(self.baseURL() + "rembrandt/forward.gif")
        self.prevButton = Image(self.baseURL() + "rembrandt/back.gif")
        self.sImages=["rembrandt/JohannesElison.jpg", "rembrandt/LaMarcheNocturne.jpg", "rembrandt/SelfPortrait1628.jpg", "rembrandt/SelfPortrait1640.jpg", "rembrandt/TheArtistInHisStudio.jpg", "rembrandt/TheReturnOfTheProdigalSon.jpg"]

        for i in range(len(self.sImages)):
            self.sImages[i]=self.baseURL() + self.sImages[i]
        
        self.image.addLoadListener(self)
        self.prevButton.addClickListener(self)
        self.nextButton.addClickListener(self)
        
        topPanel = DockPanel()
        topPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        topPanel.add(self.prevButton, DockPanel.WEST)
        topPanel.add(self.nextButton, DockPanel.EAST)
        topPanel.add(self.loadingImage, DockPanel.CENTER)
        
        panel = VerticalPanel()
        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        panel.add(HTML("<h2>A Bit of Rembrandt</h2>", True))
        panel.add(topPanel)
        panel.add(self.image)
        
        panel.setWidth("100%")
        self.initWidget(panel)
        self.image.setStyleName("ks-images-Image")
        self.nextButton.setStyleName("ks-images-Button")
        self.prevButton.setStyleName("ks-images-Button")
        
        self.loadImage(0)           
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:37,代码来源:Images.py

示例5: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        Sink.__init__(self)
        colour_grid = ColourGridCanvas()
        rotated = RotatedCanvas()       
        spheres = SpheresCanvas()
        #pattern = PatternCanvas()
        spiro = SpiroCanvas()
        self.solar = SolarCanvas()
        
        row0 = HorizontalPanel()
        row0.setSpacing(8)
        row0.add(colour_grid)
        row0.add(rotated)
        row0.add(spheres)
        #row0.add(pattern)
        
        row1 = HorizontalPanel()
        row1.setSpacing(8)
        row1.add(self.solar)
        row1.add(spiro)

        panel = VerticalPanel()
        panel.add(row0)
        panel.add(row1)

        self.setWidget(panel)
开发者ID:anandology,项目名称:pyjamas,代码行数:28,代码来源:CanvasTab.py

示例6: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
 def __init__(self):
     Sink.__init__(self)
     self.frame=Frame(self.baseURL() + "rembrandt/LaMarcheNocturne.html")
     
     self.frame.setWidth("100%")
     self.frame.setHeight("48em")
     self.initWidget(self.frame)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:9,代码来源:Frames.py

示例7: __init__

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

示例8: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
 def __init__(self):
     Sink.__init__(self)
     self.menu = MenuBar()
     
     subMenu = MenuBar(True)
     subMenu.addItem("<code>Code</code>", True, self)
     subMenu.addItem("<strike>Strikethrough</strike>", True, self)
     subMenu.addItem("<u>Underlined</u>", True, self)
     
     menu0 = MenuBar(True)
     menu0.addItem("<b>Bold</b>", True, self)
     menu0.addItem("<i>Italicized</i>", True, self)
     menu0.addItem("More &#187;", True, subMenu)
     menu1 = MenuBar(True)
     menu1.addItem("<font color='#FF0000'><b>Apple</b></font>", True, self)
     menu1.addItem("<font color='#FFFF00'><b>Banana</b></font>", True, self)
     menu1.addItem("<font color='#FFFFFF'><b>Coconut</b></font>", True, self)
     menu1.addItem("<font color='#8B4513'><b>Donut</b></font>", True, self)
     menu2 = MenuBar(True)
     menu2.addItem("Bling", self)
     menu2.addItem("Ginormous", self)
     menu2.addItem("<code>w00t!</code>", True, self)
     
     self.menu.addItem(MenuItem("Style", menu0))
     self.menu.addItem(MenuItem("Fruit", menu1))
     self.menu.addItem(MenuItem("Term", menu2))
     
     self.menu.setWidth("100%")
     
     self.initWidget(self.menu)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:32,代码来源:Menus.py

示例9: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):

        Sink.__init__(self)

        text="<div class='infoProse'>This is the Kitchen Sink sample.  "

        self.vp = VerticalPanel()
        self.initWidget(self.vp)
        self.loaded = False
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:11,代码来源:Slide.py

示例10: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
 def __init__(self, parent=None):
     Sink.__init__(self, parent)
     self.RVDock = HorizontalPanel(Spacing=5)
     self.RList = ListBox() 
     self.RList.addClickListener(getattr(self, "onRecipeSelected"))
     
     self.RView = HTML()
     HTTPRequest().asyncGet("recipes.xml", RecipeListLoader(self))
     self.RVDock.add(self.RList)
     self.RVDock.add(self.RView)
     self.initWidget(self.RVDock)
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:13,代码来源:RecipeViewer.py

示例11: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.fTabs = TabPanel()
        self.fTabs.add(self.createImage(self.baseURL() + "rembrandt/JohannesElison.jpg"), "1634")
        self.fTabs.add(self.createImage(self.baseURL() + "rembrandt/SelfPortrait1640.jpg"), "1640")
        self.fTabs.add(self.createImage(self.baseURL() + "rembrandt/LaMarcheNocturne.jpg"), "1642")
        self.fTabs.add(self.createImage(self.baseURL() + "rembrandt/TheReturnOfTheProdigalSon.jpg"), "1662")
        self.fTabs.selectTab(0)

        self.fTabs.setWidth("100%")
        self.fTabs.setHeight("100%")
        self.initWidget(self.fTabs)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:14,代码来源:Tabs.py

示例12: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        colours = ['Azure', 'Red', 'Rust', 'Green', 'Beige', 'Brass', 'Brown', 'Bronze', 'Blue', 'Black', 'Burgundy', 'Pink', 'Gold', 'Gray', 'Purple', 'Yellow', 'White']
        Sink.__init__(self)
        self.colour_input = AutoCompleteTextBox()
        self.colour_input.setCompletionItems(colours)
        
        panel = HorizontalPanel()
        panel.add(HTML("Enter a colour: "))
        panel.add(self.colour_input)

        panel.setSpacing(8)
        self.setWidget(panel)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:14,代码来源:AutoCompleteTab.py

示例13: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        Sink.__init__(self)

        text="<div class='infoProse'>This is the Kitchen Sink sample.  "
        text+="It demonstrates many of the widgets in the Google Web Toolkit."
        text+="<p>This sample also demonstrates something else really useful in GWT: "
        text+="history support.  "
        text+="When you click on a link at the left, the location bar will be "
        text+="updated with the current <i>history token</i>, which keeps the app "
        text+="in a bookmarkable state.  The back and forward buttons work properly "
        text+="as well.  Finally, notice that you can right-click a link and 'open "
        text+="in new window' (or middle-click for a new tab in Firefox).</p></div>"
        self.initWidget(HTML(text, True))
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:15,代码来源:Info.py

示例14: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.fPasswordText = PasswordTextBox()
        self.fTextArea = TextArea()
        self.fTextBox = TextBox()

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.add(HTML("Normal text box:"))
        panel.add(self.createTextThing(self.fTextBox))
        panel.add(HTML("Password text box:"))
        panel.add(self.createTextThing(self.fPasswordText))
        panel.add(HTML("Text area:"))
        panel.add(self.createTextThing(self.fTextArea))
        self.initWidget(panel)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:17,代码来源:Text.py

示例15: __init__

# 需要导入模块: from Sink import Sink [as 别名]
# 或者: from Sink.Sink import __init__ [as 别名]
 def __init__(self):
     Sink.__init__(self)
     self.fDialogButton = Button("Show Dialog", self)
     self.fPopupButton = Button("Show Popup", self)
     
     panel = VerticalPanel()
     panel.add(self.fPopupButton)
     panel.add(self.fDialogButton)
     
     list = ListBox()
     list.setVisibleItemCount(5)
     for i in range(10):
         list.addItem("list item %d" % i)
     panel.add(list)
     
     panel.setSpacing(8)
     self.initWidget(panel)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:19,代码来源:Popups.py


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