當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。