本文整理汇总了Python中pyjamas.ui.HorizontalPanel.HorizontalPanel.setPadding方法的典型用法代码示例。如果您正苦于以下问题:Python HorizontalPanel.setPadding方法的具体用法?Python HorizontalPanel.setPadding怎么用?Python HorizontalPanel.setPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.HorizontalPanel.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setPadding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _gridShortcutsLinks
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setPadding [as 别名]
def _gridShortcutsLinks(self):
bh1 = Hyperlink(_("Current"))
bh1.addClickListener(getattr(self, 'onToday'))
b2 = Button(_("Choose"),self.onMonthSelected)
bh3 = Hyperlink(self.cancel)
bh3.addClickListener(getattr(self, 'onCancel'))
b = HorizontalPanel()
b.addStyleName("calendar-shortcuts")
b.add(bh1)
b.add(b2)
b.add(bh3)
self.vp.setHorizontalAlignment("center")
b.setPadding(10)
self.vp.add(b)
示例2: onModuleLoad
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setPadding [as 别名]
def onModuleLoad(self):
"""
Gets run when the page is first loaded.
Creates the widgets.
"""
self.remote = DataService()
main_layout = VerticalPanel()
h_layout = HorizontalPanel()
h_layout.setPadding(10)
songlist_layout = VerticalPanel()
songlist_layout.add(Label("Add New Song:"))
self.newSongTextBox = TextBox()
self.newSongTextBox.addKeyboardListener(self)
songlist_layout.add(self.newSongTextBox)
self.addSongButton = Button("Add Song")
self.addSongButton.addClickListener(self)
songlist_layout.add(self.addSongButton)
#songlist_layout.add(Label("Click to Remove:"))
self.songListBox = ListBox()
self.songListBox.setVisibleItemCount(7)
self.songListBox.setWidth("300px")
self.songListBox.setHeight("400px")
self.songListBox.addClickListener(self)
songlist_layout.add(self.songListBox)
self.deleteSongButton = Button("Delete")
self.deleteSongButton.addClickListener(self)
songlist_layout.add(self.deleteSongButton)
h_layout.add(songlist_layout)
#self.textArea = TextArea()
#self.textArea.setCharacterWidth(30)
#self.textArea.setVisibleLines(50)
#h_layout.add(self.textArea)
#self.scrollPanel = ScrollPanel(Size=("400px", "500px"))
self.songHtml = HTML("<b>Please select a song in the left table</b>")
#self.scrollPanel.add(self.songHtml)
#h_layout.add(self.scrollPanel)
h_layout.add(self.songHtml)
main_layout.add(h_layout)
self.status = Label()
main_layout.add(self.status)
RootPanel().add(main_layout)
# Populate the song table:
self.remote.getAllSongs(self)