| Reply | « Previous Thread | Next Thread » |
|
I've been wondering what the heck is this EControlPane, ETitlePane etc. stuff in appuif module.
The Documentation (1.4.5 PDF, Chapter 5.1.4 Application Type) says following: Quote:
Here is the script: Code:
# Aapo Rista 2009 (public domain)
import appuifw
import e32
import TopWindow
import graphics
def show_layout_window(text, size, position, color):
"""Show a TopWindow instance in 'position'."""
topwin = TopWindow.TopWindow()
topwin.size = size
topwin.position = position
topwin.corner_type = 'square'
topwin.background_color = 0x0000ff
topwin.shadow = 0
img = graphics.Image.new(size)
img.clear(fill=color)
img.text((0, 15), text, font=(u"Series 60 Sans", 15), fill=0x000000)
topwin.add_image(img, (0,0))
topwin.show()
return topwin
def get_layout_ids():
"""Put all Esomething attributes found from appuifw to a list."""
layout_ids = []
for layout in dir(appuifw):
if layout.startswith("E"):
layout_ids.append(unicode(layout))
return layout_ids
def show_layout():
"""Show requested appuifw.Esomething on the screen."""
layout = layout_ids[layout_listbox.current()]
text = layout
try:
(size, position) = appuifw.app.layout(eval("appuifw.%s" % (layout)))
topwin = show_layout_window(text, size, position, 0xffff00)
except:
topwin = show_layout_window("FAILED: " + text, (150, 50), (20, 100), 0xff0000)
e32.ao_sleep(0.5)
topwin.hide()
def exit_key_handler():
app_lock.signal()
layout_ids = get_layout_ids()
layout_listbox = appuifw.Listbox(layout_ids, show_layout)
appuifw.app.body = layout_listbox
app_lock = e32.Ao_lock()
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
|
|
Hi Aaaapo,
Why not add it to the Wiki, with few comments? Best Regards, Croozeus |
|
http://wiki.forum.nokia.com/index.ph...Layout_Example
Not much comments yet, though. But hey, it's a wiki, isn't it? :-) |
|
Quote:
|
|
Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
I only could check your code today. Really interesting for displaying messages without conflict with user interface. Sometime ago I was trying to put a topwindow in my screen and all tested position seemed terrible.
![]() Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |