The Artima Developer Community
Sponsored Link

Python Buzz Forum
Wax 0.2.28: properties, autoevents, and more

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Hans Nowak

Posts: 1114
Nickname: roodbaard
Registered: Jun, 2003

Hans Nowak is a Dutch Python addict who currently resides in Florida.
Wax 0.2.28: properties, autoevents, and more Posted: Jul 30, 2004 11:11 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Hans Nowak.
Original Post: Wax 0.2.28: properties, autoevents, and more
Feed Title: Efectos Especiales
Feed URL: http://www.zephyrfalcon.org/weblog2/rss.xml
Feed Description: Ramblings, rants, musings, ideas and observations. Topics include (but are not limited to): programming (especially Python), books, games (especially CCGs and board games), astrology, design, writing, painting, etc.
Latest Python Buzz Posts
Latest Python Buzz Posts by Hans Nowak
Latest Posts From Efectos Especiales

Advertisement
OK, after considering people's comments about the so-called property parameters, I've decided to allow a single parameter properties in a constructor call. This parameter takes a dict and is used like this: from wax import * myproperties = { 'Size': (300, 150), 'BackgroundColor': 'white', } class MainFrame(VerticalFrame): def Body(self): # Method 1: Set properties through constructor p1 = Panel(self, border='sunken', properties=myproperties) self.AddComponent(p1, expand="both", border=5) # Method 2: Set properties through SetAttributes() p2 = Panel(self, border='raised') self.AddComponent(p2, expand="both", border=5) p2.SetAttributes(**myproperties) self.BackgroundColor = p1.BackgroundColor self.Pack() app = Application(MainFrame) app.Run() So, in spite of my earlier plans, you *cannot* do: b = Button(parent, Size=this, BackgroundColor=that) # XXX not allowed The WaxObject.SetAttributes method was already available, and it can be used to set properties (or other attributes) as well. ... [696 words]

Read: Wax 0.2.28: properties, autoevents, and more

Topic: Java link dump Previous Topic   Next Topic Topic: Soft-coding the class's name

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use