×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    3

    Problem with TopWindow module in 320x240 resolution

    Hi mate I've written a simple script to show some notes on Active Standby.And it is working fine in my N73(240x320).But When I am trying to run my app in E71(not 240x320) its not showing any TopWindow on Desktop.If anyone can help me to resolve this problem so as to provide me code for Landscape mode.

    My Script



    Code:
    ##This Software is made by Nishith##
    
    import e32, os, appuifw, graphics, TopWindow,appswitch, time
    from graphics import*
    from appuifw import*
    ###########
    app_lock = e32.Ao_lock()
    ###########
    def quit():
        global running
        running=0
        window.hide()
        app_lock.signal()
        appuifw.app.set_exit()
        appswitch.kill_app(u'Desktop')
    appuifw.app.exit_key_handler=quit
    ###########
    def txt():
        global Start
        t=open('C:\\Desk.txt','r')
        txt=t.read()
        t.close()
        text=appuifw.query(u'Enter Text(32)','text',unicode(txt))    
        f=open('C:\\Desk.txt','wr')
        f.write(text)
        f.close()
        Start()      
    ############   
    window = TopWindow.TopWindow()
    Timer=e32.Ao_timer()
    window.size = (200, 30)
    window.fading=4
    window.shadow = 1
    window.corner_type = 'corner1'
    ###########
    Phone=[u"Standby mode"]
    running=1
    ###########
    def Stnd():
        global running
        global Phone
        if (appswitch.application_list(1)[0] in Phone):
            running=1
            window.show()
        else:
            visible=0
            window.hide()
        Timer.after(0.1,Stnd)
    ###########
    def Position():
        c=open('C:\\Set.txt','r')
        a=c.read()
        s=a.split ("|")
        x=int(s[0])
        y=int(s[1])
        Dim=(x,y)
        c.close()
        global Start    
        x=appuifw.query(u'Enter X','number',Dim [0])
        y=appuifw.query(u'Enter Y','number',Dim [1])
        Dim=(x,y)
        f=open('C:\\Set.txt','wr')
        Cord= str(Dim [0]) + "|" +str(Dim [1])
        f.write(Cord)
        f.close()
        Start()
    ###########    
    def Back():
        appswitch.switch_to_bg(u'Desktop')
        appswitch.switch_to_fg(u'Telephone')
    ##########
    def TColor():
        c=open('C:\\TColr.txt','r')
        a=c.read()
        s=a.split ("|")
        r=int(s[0])
        g=int(s[1])
        b=int(s[2])
        Dim=(r,g,b)
        c.close()
        global Strat
        r=appuifw.query(u'Enter R','number',Dim [0])
        g=appuifw.query(u'Enter G','number',Dim [1])
        b=appuifw.query(u'Enter B','number',Dim [2])
        Dim=(r,g,b)
        f=open('C:\\TColr.txt','wr')
        Cord= str(Dim [0]) + "|" +str(Dim [1])+ "|"+ str(Dim[2])
        f.write(Cord)
        f.close()
        Start()
    ##########
    def tohex(r,g,b):
    	hexchars="0123456789ABCDEF"
    	return "0x"+hexchars[r/16]+hexchars[r%16]+hexchars[g/16]+hexchars[g%16]+hexchars[b/16]+hexchars[b%16]   
    ##########
    def BColor():
        c=open('C:\\BColr.txt','r')
        a=c.read()
        s=a.split ("|")
        r=int(s[0])
        g=int(s[1])
        b=int(s[2])
        Dim=(r,g,b)
        c.close()
        global Start
        r=appuifw.query(u'Enter R','number',Dim [0])
        g=appuifw.query(u'Enter G','number',Dim [1])
        b=appuifw.query(u'Enter B','number',Dim [2])
        Dim=(r,g,b)
        f=open('C:\\BColr.txt','wr')
        Cord= str(Dim [0]) + "|" +str(Dim [1])+ "|"+ str(Dim[2])
        f.write(Cord)
        f.close()
        Start()
    ##########
    def Start():
        t=open('C:\\Desk.txt','r')
        text=t.read()
        t.close()
        ########
        b=open('C:\\BColr.txt','r')
        bcolr=b.read()
        m=bcolr.split("|")
        R=int(m[2])
        G=int(m[1])
        B=int(m[0])
        b.close()
        window.background_color =eval(tohex(R,G,B))
        #########
        col=open('C:\\TColr.txt','r')
        colr=col.read()
        n=colr.split("|")
        r=int(n[0])
        g=int(n[1])
        b=int(n[2])
        col.close()
        img = graphics.Image.new((192, 24))
        img.clear(0xdddddd)
        window.add_image(img, (4, 3))
        img.text((2, 18),unicode(text),(r,g,b))
        #########
        c=open('C:\\Set.txt','r')
        a=c.read()
        s=a.split ("|")
        x=int(s[0])
        y=int(s[1])
        window.position=(x,y)
        c.close()
        #########
        appswitch.switch_to_bg(u'Desktop')
        appswitch.switch_to_fg(u'Telephone')
        window.show()
        Timer.after(0.1,Stnd)
    ###########
    def Menu():
        appuifw.app.screen='normal'
        im=Image.open('C:\\data\\images\\main.jpg')
        appuifw.app.body=k=appuifw.Canvas()
        im.text((26,86), u'DeskNotes By Nishith',0xcccccc,'normal')
        k.blit(im)
        ##########
        def handle_redraw(rect):
            canvas.blit(im)
        running=1
        canvas=appuifw.Canvas(event_callback=None, redraw_callback=handle_redraw)
        appuifw.app.body=canvas
        ##########
        appuifw.app.menu=[(u'Type Message',txt),(u'Change Position',Position),(u'Change Back Color',BColor),(u'Chagne Text Color',TColor),(u'Go Background',Back),(u'Exit',quit)]
    ##########   
    Menu()
    Start()
    app_lock.wait()
    Last edited by nisnokia; 2009-09-07 at 11:20.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Problem with TopWindow module in 320x240 resolution

    hello nisnokia

    it will be great if you edit your post and use the code tags(#) provided in your editor box to the code, so that we can look the code.

    Code tags maintain identation in your Python code.

    Regards,

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    3

    Re: Problem with TopWindow module in 320x240 resolution

    Quote Originally Posted by gaba88 View Post
    hello nisnokia

    it will be great if you edit your post and use the code tags(#) provided in your editor box to the code, so that we can look the code.

    Code tags maintain identation in your Python code.

    Regards,
    Thnax mate for correcting me I am New here and don't know how to post here.If u can help me plz help.

  4. #4
    Regular Contributor
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    176

    Re: Problem with TopWindow module in 320x240 resolution

    Code:
        c=open('C:\\Set.txt','r')
        a=c.read()
        s=a.split ("|")
        x=int(s[0])
        y=int(s[1])
        window.position=(x,y)
    what are your values for 'x' and 'y' here? in other words, whats the data stored in Set.txt
    The86Hitman
    PyS60 1.9.7 on E71
    http://www.drhtailor.com/pys60

Similar Threads

  1. [moved] Problem using phonon module in QtCreator
    By BalajiR in forum [Archived] Qt General ( Qt技术)
    Replies: 2
    Last Post: 2009-07-17, 10:18
  2. getSnapshot problem on setting resolution
    By gregschua in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2008-10-27, 07:47
  3. Problem with "Positioning" module
    By rohitthebest in forum Symbian
    Replies: 9
    Last Post: 2008-09-14, 10:56
  4. Replies: 2
    Last Post: 2002-11-25, 20:41
  5. Replies: 0
    Last Post: 2002-10-29, 12:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×