コード例 #1
0
    def __init__(self,**params):
        title = gui.Label("Open...")
        
        def load_vals(fname,form):
            if not ini.has_section(fname): return
            
            for k,v in ini.items(fname):
                if k in form:
                    form[k].value = v

        doc = html.HTML(globals={'load_vals':load_vals,'ini':ini,'gui':gui,'dialog':self},data="""<form id='form'><table>
        
        <tr><td align=right>File Name:&nbsp;<td  align=left><input type='file' size=20 name='fname' value='' onchange='load_vals(self.value,form)'>

        <tr><td align=right>Level&nbsp;<br>Type:&nbsp;
        <td align=left><input type=radio name='class' value='pgu.tilevid.Tilevid' checked> Tile<br><input type=radio name='class' value='pgu.isovid.Isovid'> Isometric<br><input type=radio name='class' value='pgu.hexvid.Hexvid'> Hexoganol
        
        <tr><td align=right>Tiles:&nbsp;<td align=left><input type='text' size=20 name='tiles' value='%(tiles)s'>
        <tr><td align=right>Codes:&nbsp;<td align=left><input type='text' size=20 name='codes' value='%(codes)s'>
        
        <tr><td align=right>Tile Width:&nbsp;<td align=left><input type='text' size='4' value='%(tile_w)s' name='tile_w'>
        <tr><td align=right>Tile Height:&nbsp;<td align=left><input type='text' size='4' value='%(tile_h)s' name='tile_h'>


<tr><td>&nbsp;

<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>

</table>"""%ini_to_dict('None'))
        gui.Dialog.__init__(self,title,doc)
        
        self.value = doc['form']
コード例 #2
0
ファイル: tileedit.py プロジェクト: allencch/Speckpater
    def __init__(self, **params):
        title = gui.Label("Open...")

        def load_vals(fname, form):
            if not ini.has_section(fname): return

            for k, v in ini.items(fname):
                if k in form:
                    form[k].value = v

        doc = html.HTML(globals={
            'load_vals': load_vals,
            'ini': ini,
            'gui': gui,
            'dialog': self
        },
                        data="""<form id='form'><table>
        
        <tr><td align=right>File Name:&nbsp;<td  align=left><input type='file' size=20 name='fname' value='' onchange='load_vals(self.value,form)'>
        <tr><td align=right>Tile Width:&nbsp;<td align=left><input type='text' size='4' value='%(tile_w)s' name='tile_w'>
        <tr><td align=right>Tile Height:&nbsp;<td align=left><input type='text' size='4' value='%(tile_h)s' name='tile_h'>
        
        <tr><td align=right>Palette:&nbsp;<td align=left><input type='text' size=20 name='palette' value='%(palette)s'>
        
        <tr><td>&nbsp;
        
        <tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>
        
        </table>""" % ini_to_dict('None'))
        gui.Dialog.__init__(self, title, doc)

        self.value = doc['form']
コード例 #3
0
    def run(self):
        """Run the item"""

        # Initialize the item
        self.set_item_onset()

        # Create the app
        self.app = gui.Desktop(item=self)
        self.app.connect(gui.QUIT, self.app.quit, None)

        pad = 0  # The maximum line length, used to pad the options

        # Create an HTML document for the content
        doc = html.HTML("")
        for l in self.experiment.unsanitize(self.get("question")).split("\n"):
            doc.add(gui.Label(l))
            pad = max(pad, len(l))
            doc.br(0)

        # Create a 2-column table, start with the HTML on the first row
        c = gui.Table()
        c.tr()
        c.td(doc, align=-1)

        c.tr()
        e = gui.Button(self.get("accept_text"))
        e.connect(gui.CLICK, self.app.quit, None)
        c.td(e, align=-1, height=32, valign=1)

        self.app.run(c)

        # Return success
        return True
コード例 #4
0
ファイル: tileedit.py プロジェクト: allencch/Speckpater
    def __init__(self, **params):
        title = gui.Label("New...")

        doc = html.HTML(globals={
            'gui': gui,
            'dialog': self
        },
                        data="""<form id='form'><table>
        <tr>
        <td align=center>Image Size
        <td align=center>Tile Size

        <tr><td colspan='1' align='center' style='padding-right:8px;'><table>
        <tr><td align=right>Width: <td><input type='text' size='4' value='%(width)s' name='width'>
        <tr><td align=right>Height: <td><input type='text' size='4' value='%(height)s' name='height'>
        </table>
        
        <td colspan='1' align='center'><table>
        <tr><td align=right>Width: <td><input type='text' size='4' value='%(tile_w)s' name='tile_w'>
        <tr><td align=right>Height: <td><input type='text' size='4' value='%(tile_h)s' name='tile_h'>
        </table>
        
        <tr><td colspan=2>Palette: <input type='text' size=20 name='palette' value='%(palette)s'>
        
        <tr><td>&nbsp;
        
        <tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>
        
        </table>""" % ini_to_dict('None'))
        gui.Dialog.__init__(self, title, doc)

        self.value = doc['form']
コード例 #5
0
    def run(self):
        """Run the item"""

        # Initialize the item
        self.set_item_onset()
        self.sri = self.time()
        self.experiment.set("response", None)
        self.experiment.set("response_time", None)

        # Create the app
        self.app = gui.Desktop(item=self)
        self.app.connect(gui.QUIT, self.app.quit, None)

        pad = 0  # The maximum line length, used to pad the options

        # Create an HTML document for the content
        doc = html.HTML("")
        for l in self.experiment.unsanitize(self.get("question")).split("\n"):
            doc.add(gui.Label(l))
            pad = max(pad, len(l))
            doc.br(0)

        # Create a 2-column table, start with the HTML on the first row
        c = gui.Table()
        c.tr()
        c.td(doc, colspan=self.get("maximum_rating") + 1, align=-1)

        c.tr()
        surf = pygame.image.load(
            self.experiment.resource("rating_inactive.png"))
        self.img_list = []
        for i in range(self.get("maximum_rating")):
            img = gui.Image(surf)
            img.connect(gui.CLICK, self.set_response, i)
            c.td(img, align=-1, width=64, height=64)
            self.img_list.append(img)

        c.tr()
        e = gui.Button(self.get("accept_text"))
        e.connect(gui.CLICK, self.app.quit, None)
        c.td(e,
             colspan=self.get("maximum_rating") + 1,
             align=-1,
             height=32,
             valign=1)

        # Keep running the app until a response has been received
        while True:
            self.app.run(c)
            if self.get("response") != "None":
                break

        # Return success
        return True
コード例 #6
0
    def __init__(self, level, **params):
        title = html.HTML("<b>High Scores for Level<i>%s</i></b>" %
                          level.level_name)
        scoreboard = ScoreTable(level)

        tbl = gui.Table()
        for highscore in scoreboard:
            tbl.tr()
            tbl.td(gui.Label(highscore.name), colspan=2)
            tbl.td(gui.Label('%d' % highscore.score))

        gui.Dialog.__init__(self, title, tbl, **params)
コード例 #7
0
    def run(self):
        """Run the item"""

        # Initialize the item
        self.set_item_onset()
        self.sri = self.time()
        self.experiment.set("response", None)
        self.experiment.set("response_time", None)

        # Create the app
        self.app = gui.Desktop(item=self)
        self.app.connect(gui.QUIT, self.app.quit, None)

        pad = 0  # The maximum line length, used to pad the options

        # Create an HTML document for the content
        doc = html.HTML("")
        for l in self.experiment.unsanitize(self.get("question")).split("\n"):
            doc.add(gui.Label(l))
            pad = max(pad, len(l))
            doc.br(0)

        # Create a 2-column table, start with the HTML on the first row
        c = gui.Table()
        c.tr()
        c.td(doc, align=-1)

        c.tr()
        t = gui.TextArea(width=self.get("text_area_width"),
                         height=self.get("text_area_height"))
        c.td(t, align=-1)

        c.tr()
        e = gui.Button(self.get("accept_text"))
        e.connect(gui.CLICK, self.app.quit, None)
        c.td(e, align=-1, height=32, valign=1)

        # Keep running the app until a response has been received
        while True:
            self.app.run(c)
            if t.value.strip() != "" or self.get("allow_empty") == "yes":
                break

        # Set the response and response time
        self.experiment.set(
            "response",
            self.experiment.usanitize(unicode(QtCore.QString(
                t.value.strip()))))
        self.experiment.set("response_time", self.time() - self.sri)

        # Return success
        return True
コード例 #8
0
def make_box(text, markup=False):
    style = {
        'border' : 1,
        'padding_left': 2,
        'padding_right': 2,
        'padding_top': 2,
        'padding_bottom': 2,
    }
    if markup:
        word = html.HTML(text, style=style)
    else:
        word = gui.Label(text, style=style)
    return word
コード例 #9
0
ファイル: leveledit.py プロジェクト: PerroTron/HostilPlanet
    def __init__(self, **params):
        title = gui.Label("New...")

        doc = html.HTML(globals={
            'gui': gui,
            'dialog': self
        },
                        data="""
<form id='form'>

<table>

<tr><td colspan=2>

<table>
<tr><td>Level<br>Type:
<td align=left><input type=radio name='class' value='pgu.tilevid.Tilevid' checked> Tile<br>
<input type=radio name='class' value='pgu.isovid.Isovid'> Isometric<br>
<input type=radio name='class' value='pgu.hexvid.Hexvid'> Hexoganol

<tr><td >Tiles: <td><input type='text' size=20 name='tiles' value='%(tiles)s'>
<tr><td>Codes: <td><input type='text' size=20 name='codes' value='%(codes)s'>
</table>

<tr>
<td align=center>Level Size
<td align=center>Tile Size


<tr><td colspan='1' align='center' style='padding-right:8px;'>
<table>
<tr><td align=right>Width: <td><input type='text' size='4' value='%(width)s' name='width'>
<tr><td align=right>Height: <td><input type='text' size='4' value='%(height)s' name='height'>
</table>

<td colspan='1' align='center'>
<table>
<tr><td align=right>Width: <td><input type='text' size='4' value='%(tile_w)s' name='tile_w'>
<tr><td align=right>Height: <td><input type='text' size='4' value='%(tile_h)s' name='tile_h'>
</table>

<tr><td>&nbsp;

<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>

</table>""" % ini_to_dict('None'))
        gui.Dialog.__init__(self, title, doc)

        self.value = doc['form']
コード例 #10
0
ファイル: leveledit.py プロジェクト: allencch/Speckpater
	def __init__(self,**params):
		title = gui.Label("File not yet saved...")
		data = "Your file is not yet saved.<br>Are you sure you want to continue?"
		
		doc = html.HTML(globals={'gui':gui,'dialog':self},data="""
<form id='form'>

<table>
<tr><td><h1>&nbsp;<b>!<b>&nbsp;</h1>
<td>"""+data+"""
<tr><td>&nbsp;
<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>
</table>""")
		gui.Dialog.__init__(self,title,doc)
		self.value = doc['form']
コード例 #11
0
ファイル: leveledit.py プロジェクト: allencch/Speckpater
	def __init__(self,tt,data,**params):
		title = gui.Label("Error: "+tt)
		data = str(data)
		
		doc = html.HTML(globals={'gui':gui,'dialog':self},data="""
<form id='form'>

<table>
<tr><td><h1>&lt;!&gt;&nbsp;</h1>
<td>"""+data+"""
<tr><td>&nbsp;
<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE);dialog.close()'>
</table>""")
		gui.Dialog.__init__(self,title,doc)
		self.value = doc['form']
コード例 #12
0
ファイル: leveledit.py プロジェクト: allencch/Speckpater
	def __init__(self,**params):
		title = gui.Label("New...")
		
		import levels
		
		tilesetopts = ""
		tsn = levels.tilesets.__all__
		for set in tsn:
			tilesetopts += "<option value='" + set + "'>" + set
		
		doc = html.HTML(globals={'gui':gui,'dialog':self},data="""
<form id='form'>

<table>

<tr><td colspan=2>

<table>
<tr><td >Name: <td><input type='text' size=20 name='lname' value=''>
<tr><td>Tileset: <td> <select name="tiles" value='commontiles'>
""" + tilesetopts + """
</select>

<tr><td>Background: <td><input type='text' size=20 name='bgname' value='junglebg'>
</table>

<tr>
<td align=center>Level Size

<tr><td colspan='1' align='center' style='padding-right:8px;'>

<table>
<tr><td align=right>Width: <td><input type='text' size='4' value='120' name='width'>
<tr><td align=right>Height: <td><input type='text' size='4' value='30' name='height'>
</table>

<td colspan='1' align='center'>

<tr><td>&nbsp;

<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>

</table>""")

		gui.Dialog.__init__(self,title,doc)

		self.value = doc['form']	
コード例 #13
0
    def __init__(self,**params):
        title = gui.Label("Save As...")
        
        doc = html.HTML(globals={'gui':gui,'dialog':self},data="""
<form id='form'>

<table>

<tr><td colspan=2>File Name: <input type='file' size=20 name='fname' value=''>

<tr><td>&nbsp;

<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>

</table>""")
        gui.Dialog.__init__(self,title,doc)
        
        self.value = doc['form']
コード例 #14
0
    def __init__(self,**params):
        title = gui.Label("New Picture...")
        
        ##Note how the global variables are set for the scripting of HTML
        ##::        
        picker = ColorDialog("#ffffff")
        doc = html.HTML(globals={'gui':gui,'dialog':self,'picker':picker},data="""
<form id='form'>

<table>

<tr><td colspan='2' align='center'>
Size
<tr><td colspan='2' align='center'>
<table>
<tr><td align=right>Width: <td><input type='text' size='4' value='256' name='width'>
<tr><td align=right>Height: <td><input type='text' size='4' value='256' name='height'>
</table>

<tr><td>Format<td>Background

<tr><td>
<input type='radio' name='format' value='rgb' checked> RGB<br>
<input type='radio' name='format' value='bw'> Grayscale
<td>
<input type='radio' name='background' value='#000000'> Black<br>
<input type='radio' name='background' value='#ffffff' checked> White<br>
<input type='radio' name='background' value='custom'> <object type='gui.Color' width=48 height=16 value='#ffffff' name='custom' border=1 onclick='picker.open()'>

<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>

</table>

""")
        gui.Dialog.__init__(self,title,doc)
        
        picker.connect(gui.CHANGE,gui.action_setvalue,(picker,doc['form']['custom']))
        ##
        
        self.value = doc['form']
コード例 #15
0
ファイル: leveledit.py プロジェクト: allencch/Speckpater
	def __init__(self,**params):
		title = gui.Label("Load...")
		
		options = ""
		
		files = glob.glob(os.path.join('levels', '*.lev'))
		limit = 10
		for file in files:
			limit = limit - 1
			if limit < 0: break
			fn = os.path.basename(file)
			n = os.path.splitext(fn)[0]
			options += "<option value='" + n + "'>" + fn
		
		doc = html.HTML(globals={'gui':gui,'dialog':self},data="""
<form id='form'>

<table width="200" height="70">


<tr>

<td>Level file: <td> <select name="fname">
""" + options + """
</select>


<tr>

<tr><td colspan=2><input type='button' value='Okay' onclick='dialog.send(gui.CHANGE)'> <input type='button' value='Cancel' onclick='dialog.close()'>

</table>""")

		gui.Dialog.__init__(self,title,doc)

		self.value = doc['form']	
コード例 #16
0
ファイル: html3.py プロジェクト: nikhil-2000/PhysicsSimApp
<input type='text' name='weight' size=5>
<tr><td>Sex<td style='padding-left:8px' align=left><input type='radio' name='sex' value='male'>Male <input type='radio' name='sex' value='female'>Female
<tr><td>Color<td style='padding-left:8px' align=left><select name='color' onchange='cview.value=self.value'>
<option value='#000000'>Black
<option value='#0000ff'>Blue
<option value='#00ff00'>Green
<option value='#00ffff'>Cyan
<option value='#ff0000'>Red
<option value='#ff00ff'>Purple
<option value='#ffff00'>Yellow
<option value='#ffffff'>White
</select>
 <object type='gui.Color' width=80 height=20 border=1 id='cview'>
<tr><td>Pets<td style='padding-left:8px' align=left>
<table><tr><td align=left><input type='checkbox' name='pets' value='goat'> Goat <td align=left><input type='checkbox' name='pets' value='horse'> Horse <tr><td align=left><input type='checkbox' name='pets' value='hog'> Hog <td align=left><input type='checkbox' name='pets' value='cow'> Cow </table>
</table>

<center>
<input type='submit' value='Submit' onclick='print(form.results())'>
</center>

</form>

"""
##

doc = html.HTML(data,align=-1,valign=-1)

app.connect(gui.QUIT,app.quit,None)
app.run(doc)
コード例 #17
0
    def __init__(self, gameboard, level, **params):
        gui.Table.__init__(self, **params)
        scoreboard = ScoreTable(level)

        def return_pressed():
            pygame.event.post(constants.GO_MAIN_MENU)

        def quit_pressed():
            pygame.event.post(constants.DO_QUIT)

        score = gameboard.cash + \
                level.sell_price_chicken * len(gameboard.chickens) + \
                level.sell_price_egg * gameboard.eggs

        made_list = scoreboard.check(score) is not None
        if level.is_game_over(gameboard):
            if len(gameboard.chickens) > 0:
                self.survived = WON
                try:
                    player = getpass.getuser()
                except Exception:
                    player = 'You'
                scoreboard.submit(score, player)
                message = random.choice(WON_MESSAGES)
            else:
                self.survived = LOST
                message = random.choice(LOST_MESSAGES)
        else:
            self.survived = LEFT
            message = random.choice(LEFT_MESSAGES)

        self.tr()
        self.td(gui.Label(message, color=constants.FG_COLOR), colspan=3)
        self.add_spacer()

        # heading options
        head_kwargs = {
            'color': constants.FG_COLOR,
            'style': {
                'padding_top': 10,
                'padding_bottom': 5,
            },
        }

        # show the scoreboard

        self.tr()
        self.td(html.HTML(
            '<b>High Scores for Level<i>%s:</i></b>' % level.level_name,
            **head_kwargs),
                colspan=3)

        for highscore in scoreboard:
            self.tr()
            self.td(gui.Label(highscore.name, color=constants.FG_COLOR),
                    colspan=2)
            self.td(gui.Label('%d' % highscore.score,
                              color=constants.FG_COLOR))

        # show player score

        self.tr()
        self.td(html.HTML('<b>Your Score:</b>', **head_kwargs), colspan=3)

        self.tr()
        self.td(
            gui.Label("Groats : %d" % gameboard.cash,
                      color=constants.FG_COLOR))
        self.td(
            gui.Label("   Chickens : %d " % len(gameboard.chickens),
                      color=constants.FG_COLOR))
        self.td(
            gui.Label("   Eggs : %d" % gameboard.eggs,
                      color=constants.FG_COLOR))
        self.add_spacer()
        self.tr()
        self.td(gui.Label("You killed %d foxes" % gameboard.killed_foxes,
                          color=constants.FG_COLOR),
                colspan=3)
        self.add_spacer()
        self.tr()
        self.td(gui.Label("Final score : %d" % score,
                          color=constants.FG_COLOR),
                colspan=3)

        if made_list:
            self.tr()
            if self.survived == WON:
                msg = "You made the high scores!"
                scoreboard.save()
            else:
                msg = "Pity, you could have made the high scores."
            self.td(html.HTML("<b>%s</b>" % msg, **head_kwargs), colspan=3)

        self.add_spacer(50)

        return_button = gui.Button("Return to Main Menu")
        return_button.connect(gui.CLICK, return_pressed)

        quit_button = gui.Button("Quit")
        quit_button.connect(gui.CLICK, quit_pressed)

        style = {
            "padding_bottom": 15,
        }
        td_kwargs = {
            "align": 0,
            "style": style,
            "colspan": 3,
        }

        self.tr()
        self.td(return_button, **td_kwargs)

        self.tr()
        self.td(quit_button, **td_kwargs)
コード例 #18
0
# the following line is not needed if pgu is installed
import sys
sys.path.insert(0, "..")

from pgu import gui
from pgu import html

app = gui.Desktop()

c = gui.Table(width=500, height=500)
c.tr()

dw = 400
data = """
<div style='margin: 8px; padding: 8px; border: 1px; border-color: #88ffff; background: #eeffff;'><img src='cuzco.png' align=right>cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. </div>"""
doc = html.HTML(data, width=dw)
c.td(doc)

c.tr()
s = gui.HSlider(300, 200, 450, 100, width=dw)


def mychange(value):
    s, doc = value
    doc.style.width = s.value
    doc.chsize()


s.connect(gui.CHANGE, mychange, (s, doc))
c.td(s)
コード例 #19
0
	def run(self):

		"""Run the item"""

		# Initialize the item
		self.set_item_onset()
		self.sri = self.time()
		self.experiment.set("response", None)
		self.experiment.set("response_time", None)

		# Create the app
		self.app = gui.Desktop(item=self)
		self.app.connect(gui.QUIT, self.app.quit, None)

		# Create a list of choices
		choices = []
		for choice in self.get("choices").split(";"):
			choices.append(self.experiment.unsanitize(choice))

		pad = 0 # The maximum line length, used to pad the options

		# Create an HTML document for the content
		doc = html.HTML("")
		for l in self.experiment.unsanitize(self.get("question")).split("\n"):
			doc.add(gui.Label(l))
			pad = max(pad, len(l))
			doc.br(0)

		# Determine the colspan
		if self.get("orientation") == "vertical":
			span = 2
		else:
			span = len(choices)

		# Create a 2-column table, start with the HTML on the first row
		c = gui.Table()
		c.tr()
		c.td(doc, colspan=span, align=-1)

		# A group for the responses
		group = gui.Group()

		if self.get("orientation") == "vertical":

			# In the vertical orientation each choice is in a row
			for option in choices:
				l = gui.Label(option.ljust(pad))
				if self.get("allow_multiple") == "no":
					r = gui.Radio(group, value=option)
				else:
					r = gui.Checkbox(group, value=option)
				r.connect(gui.CLICK, self.set_response, option)
				c.tr()
				c.td(r, align=-1, width=32, height=32)
				c.td(l, align=-1, height=32)

		else:

			# In the horizontal orientation each choise is in a column
			# First a row with labels
			c.tr()
			for option in choices:
				l = gui.Label(option)
				c.td(l, align=-1, height=32)

			# Next a row with response buttons
			c.tr()
			for option in choices:
				if self.get("allow_multiple") == "no":
					r = gui.Radio(group, value=option)
				else:
					r = gui.Checkbox(group, value=option)
				r.connect(gui.CLICK, self.set_response, option)
				c.td(r, align=-1, width=32, height=32)


		# Add the accept button, if necessary
		if self.get("accept_on_click") == "no":
			c.tr()
			e = gui.Button(self.get("accept_text"))
			e.connect(gui.CLICK, self.app.quit, None)
			c.td(e, colspan=span, align=-1, height=32, valign=1)

		# Keep running the app until a response has been received
		while True:
			self.app.run(c)
			if self.get("response") != "None" or self.get("allow_empty") == "yes":
				break

		# Return success
		return True
コード例 #20
0
    <td border=1 style='padding:4px'>things: <ul>
        <li>grass
        <li>trees
        <li>snakes
        <li>scum
        </ul>
    <td border=1 style='padding:4px'>things: <ol>
        <li>water
        <li>sky
        <li>goats
        <li>pizza
        </ol>
</table>
    
<pre>    
class Desktop(App):
    def __init__(self,**params):
        params.setdefault('cls','desktop')
        App.__init__(self,**params)
</pre>

<div style='margin: 8px; padding: 8px; border: 1px; border-color: #88ffff; background: #eeffff;' width=700><img src='cuzco.png' align=right>cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. cuzco is my goat. </div>"""

##this example just uses the HTML widget
##::
doc = html.HTML(data)
##

app.connect(gui.QUIT, app.quit, None)
app.run(doc)
コード例 #21
0
ファイル: html5.py プロジェクト: cicean/EarlyCollegeHomework
import sys
sys.path.insert(0, "..")

from pgu import gui
from pgu import html

app = gui.Desktop()

##check if the documentation has been built
##::
fname = "../docs/index.html"
if not os.path.isfile(fname):
    print 'to run this demo, the documentation must be built'
    print '$ cd docs'
    print '$ python build.py'
##
else:

    ##open the file, hand it to a HTML object and display it
    ##::
    f = open(fname)
    text = "".join(f.readlines())
    f.close()

    doc = html.HTML(text, align=-1, valign=-1, width=800)

    view = gui.ScrollArea(doc, 820, 400)
    app.connect(gui.QUIT, app.quit, None)
    app.run(view)
    ##