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 >> anygui-devel
anygui-devel
RE: [Anygui-devel] Anygui on Zaurus
by Clark, Chris other posts by this author
Aug 11 2003 6:26PM messages near this date
[Anygui-devel] Anygui on Zaurus | Re: [Anygui-devel] app.run() will not return with qtgui
Glad to see a fellow Zaurus user :-) I've a few comments below.

Chris

>  -----Original Message-----
>  From: Stephen Wilbourne [mailto:stephenw@[...].au]
>  Sent: Monday, August 11, 2003 12:10 AM
>  To: devel@[...].org
>  Subject: [Anygui-devel] Anygui on Zaurus

.. Snip

>  1. To make the application run as a window that puts an icon 
>  on the taskbar, and that you can return to by selecting the icon:
>  
>  - at the top of the program, add:
>  	from qtpe import QPEApplication
>  

That's a good idea, I didn't think of embedded support and I started to use anygui for prett
y much the same reason as you :-)

I'm also new to python, so my suggestion below may not be the "best" python approach.

The above change will break QT backends where QT embedded is NOT installed (e.g. Windows box
es and most Linux QT installations). Consider TRYing to import the embedded stuff thusly:

# ----- code -----
try:
    from qtpe import *
    USE_QPE = 1
except:
    USE_QPE = 0
# ----- code -----

>  - throughout the program, change all references to 
>  'QApplication' to 'QPEApplication'
>  

Then instead of blanket changing the QApplication references consider:

# ----- code -----
    if USE_QPE == 1 :
        a = QPEApplication(sys.argv)
    else:
        a = QApplication(sys.argv)
# ----- code -----

I would guess this would give you more chance of getting your changes submitted into the Any
GUI codeline.

I use this approach in a QT application I've written (also using Py-sqlite) where anygui was
n't suitable (I really wanted a table field and whilst I was able to "emulate" it using a te
xt view, it didn't work that well).


>  .. Snip stuff to do with changing behaviour of AnyGUI under QT backend.

I'd be careful with these types of changes as if you have a different backend you run the ch
ance of having different behaviours (e.g. what happens if you use the win32 backend or the T
K one?) when you move your application.

Chris


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

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