ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-announce
python-announce
Python and XUL: Luxor XUL Python Example Suite Released
by Gerald Bauer other posts by this author
Mar 2 2003 4:07PM messages near this date
spyce v1.3.9 released | Vote on PEP 308: Ternary Operator
The Luxor XUL (XML User Interface Language) Python example suite is
now available and includes a mini calculator, a channel surfer, a
counter and more.

  Grab a copy at http://sourceforge.net/project/showfiles.php?group_id=28946
(look for the luxor-python-examples package).

  Here's a sneak preview:

counter.xul:
================================
<xul> 
  <vbox id="COUNTER"> 
    <groupbox> 
      <caption label="Counter"/> 
      <textbox id="DISPLAY"
         style="align: center; color: yellow; background: black; font:
24 bold monospace;" /> 
    </groupbox> 
    <hbox> 
      <button label="Dec (-)" command="dec" style="width: 90px" /> 
      <button label="Clear" command="clear" style="width: 90px" /> 
      <button label="Inc (+)" command="inc" style="width: 90px" /> 
    </hbox> 
  </vbox> 
</xul> 

counter.py
================================
# -- cut --

class CounterForm( XulForm ):
  def __init__( self ):
    XulForm.__init__( self, "COUNTER" )
    self.setup()

  def init( self ):
    self.display = XulInput( self, "DISPLAY" )

  def setCounter( self, counter ):
    self.display.text = str( counter )

class AppFrame( JFrame ):

  def __init__( self ):
    JFrame.__init__( self, "Luxor Counter Example" )

    DynXulAction( "inc", self.onIncCounter )
    DynXulAction( "dec", self.onDecCounter )

    xul = XulMan( "c:/sandbox/python/src/counter/chrome" )

  def onIncCounter( self ):
    self.counter += 1
    self.updateCounter()

  def onDecCounter( self ):
    self.counter -= 1
    self.updateCounter()

# -- cut --

  That's it. Enjoy.

  - Gerald (Luxor Project Lead)

PS: What is XUL?

To get started with XUL (XML User Interface Language) check out the
Richmond Post XUL Link-opida online @
http://luxor-xul.sourceforge.net/post/links.html

PSS: What is Luxor?

Luxor is an open-source XML User Interface Language (XUL) toolkit in
Java that supports handpicked Mozilla XUL goodies and includes a web
server, a portal engine (supporting RSS), a template engine
(Velocity), a scripting interpreter (Python) and more. For more info
check out the Luxor site @ http://luxor-xul.sourceforge.net

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved