Python and XUL: Luxor XUL Python Example Suite Released 
Author Message
 Python and XUL: Luxor XUL Python Example Suite Released

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://www.*-*-*.com/
(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

http://www.*-*-*.com/

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



Fri, 19 Aug 2005 00:07:39 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Mozilla, XUL and...Python?

2. Mozilla, XUL for Python?!

3. Python + Mozilla/XUL/...

4. xul/xpcom in Fortran

5. Q: XUL widget for Tk?

6. Example of Python code (C code to Python code)

7. Cygwin Python Distribution (was ANNOUNCE: Python 2.1 final release)

8. Python 2.1b2 SRPM (was: Re: Python 2.1b2 released)

9. Cygwin Python Distribution (was ANNOUNCE: Python 2.1 final release)

10. Cygwin Python Distribution (was ANNOUNCE: Python 2.1 final release)

11. Python 2.1b2 SRPM (was: Re: Python 2.1b2 released)

12. Building for Win64 (was: Re: [Python-Dev] Re: Python 2.0 release candidate 1)

 

 
Powered by phpBB® Forum Software