本文整理汇总了Python中pyjamas.ui.Image.Image.getUrl方法的典型用法代码示例。如果您正苦于以下问题:Python Image.getUrl方法的具体用法?Python Image.getUrl怎么用?Python Image.getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.Image.Image
的用法示例。
在下文中一共展示了Image.getUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MechDrawing
# 需要导入模块: from pyjamas.ui.Image import Image [as 别名]
# 或者: from pyjamas.ui.Image.Image import getUrl [as 别名]
class MechDrawing(VerticalPanel):
def __init__(self, handle, idx, image, variables = None, code = None,
perspective = '', checkOptions = [False, True]):
VerticalPanel.__init__(self)
self._handle = handle
self.idx = idx
# set style
self.setStyleName('os-mech-drawing')
# create widgets
self._img = Image(image)
self._img.setStyleName('os-mech-thumb')
self._img.addClickListener(self.onClickDrawing)
self._perspective = '%d - %s'%(idx, perspective.capitalize())
self._optionPanel = MechOptionPanel(handle, idx, checkOptions)
textArea = TextArea(code)
textArea.setText(code)
textArea.setStyleName('os-mech-code-locked')
textArea.setReadonly(self, True)
# populate drawing
self.add(self._img)
self.add(self._optionPanel)
self.add(textArea)
def actRatioChange(self, ratio):
self._optionPanel.actRatioChange(ratio)
def onClickDrawing(self, sender, event):
Window.open(self._img.getUrl() + '&render=html&title=%s'%self._perspective, self._perspective, "status=1,resizeable=1,scrollbars=1")
示例2: __init__
# 需要导入模块: from pyjamas.ui.Image import Image [as 别名]
# 或者: from pyjamas.ui.Image.Image import getUrl [as 别名]
def __init__(self):
Sink.__init__(self)
img = Image("images/num1.png")
img.addMouseListener(TooltipListener("An image: " + img.getUrl()))
img2 = Image("images/num2.png")
img2.addMouseListener(TooltipListener("An image: " + img2.getUrl()))
html = HTML("Some <i>HTML</i> text.")
html.addMouseListener(TooltipListener("An HTML component."))
panel_h = HorizontalPanel()
panel_h.add(img)
panel_h.add(img2)
panel_h.setSpacing(8)
panel = VerticalPanel()
panel.add(panel_h)
panel.add(html)
panel.setSpacing(8)
self.setWidget(panel)