我有一個包含兩個按鈕和一個框架的網頁。在框架內顯示網頁。我試圖讓它如此按鈕在鞋架中鞋子網址'/ AAA',而按鈕B在鞋架中'鞋子'/'BBB'。我怎麼能這樣做?Pyjs /睡衣框架:如何使用按鈕來更改框架中的url
以下是我有:
class ImageButton(SimplePanel):
def __init__(self, image_location):
'''(None, str) -> None'''
SimplePanel.__init__(self)
img = Image(image_location, StyleName='rangler')
img.addClickListener(getattr(self, "onImageClick"))
self.add(img)
def onImageClick(self, sender=None):
pass
#This is where I need help!?
class QAFrame(SimplePanel):
def __init__(self, current_url):
SimplePanel.__init__(self)
frame = Frame(current_url,
Width="200%",
Height="650px")
self.add(frame)
def caption():
style_sheet = HTML("""<link rel='stylesheet' href='about_us.css'>""")
srah_pic = ImageButton("Steve.jpg")
fl_pic = ImageButton("Fraser.jpg")
horizontal = HorizontalPanel()
vertical = VerticalPanel()
vertical.add(srah_pic)
vertical.add(fl_pic)
horizontal.add(vertical)
QAFrame('Fraser_qa.htm')
QAFrame('Steve_qa.htm')
horizontal.add(QAFrame('Steve_qa.htm'))
RootPanel().add(horizontal)