×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    26

    Question HELP (about navigation tabs & UI)

    i want to make 2 navigation tabs. (1st tab is canvas type, 2nd tab is text type).
    in 1st tab i want to put some Classess. but i confuse how to write it. is there any good example for that?
    and 2nd tab i want to use variable from 1st tab, is that possible?

    and about appuifw.app.body, i need some example how to make UI so we can change from canvas to text,and the opposite.

    thx

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: HELP (about navigation tabs & UI)

    Search the Wiki for the words "Python tabs" and you will find an article that explains how to use them. You can also read the PyS60 Library Reference, the section about tabs, for more detailed information.

    Quote Originally Posted by bagindraerix View Post
    and about appuifw.app.body, i need some example how to make UI so we can change from canvas to text,and the opposite.
    I think you should explain what you mean by this. If you want to change the type of body from Canvas to Text or the other way around without using tabs all you have to do is set appuifw.app.body to an instance of Canvas or Text.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    26

    Re: HELP (about navigation tabs & UI)

    I think you should explain what you mean by this. If you want to change the type of body from Canvas to Text or the other way around without using tabs all you have to do is set appuifw.app.body to an instance of Canvas or Text.
    for appuifw.app.body i just need in one tab, so i dont need navigation tabs.
    i have tried set appuifw.app.body to an instance of Canvas or Text. but it won't work.
    is there any example?

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: HELP (about navigation tabs & UI)

    Quote Originally Posted by bagindraerix View Post
    for appuifw.app.body i just need in one tab, so i dont need navigation tabs.
    I don't understand why you want to use tabs if you only need one tab, but if that's what you want...

    Quote Originally Posted by bagindraerix View Post
    i have tried set appuifw.app.body to an instance of Canvas or Text. but it won't work.
    is there any example?
    How doesn't it work? Does it throw an error? Does nothing happen?

    Code:
    import appuifw, e32
     
    
    #Create an instance of Text
    t = appuifw.Text(u"This is an instance of Text")
    
    #Create an instance of Canvas
    c = appuifw.Canvas()
    
    #Set t as the application's body
    appuifw.app.body = t
    
    #Wait 3 seconds
    e32.ao_sleep(3)
    
    #Set c as the application's body
    appuifw.app.body = c
    
    #Wait 3 seconds
    e32.ao_sleep(3)

  5. #5
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: HELP (about navigation tabs & UI)

    bagindraerix

    Is the following behavior that you want ? I mean, different bodies depending on tab position ?

    Code:
    # -*- coding: utf-8 -*-
    import e32
    from appuifw import *
    import types
    
    class TabDemo(object):
        def __init__(self):
            self.lock = e32.Ao_lock()
            app.exit_key_handler = self.close_app
            self.app_title = u"TabDemo"
            app.menu = [( u"Exit", self.close_app )]        
            self.text = Text(u"Text")
            self.canvas = Canvas()
            self.refresh(0)
            app.set_tabs([u"Canvas",u"Text"],self.refresh)
            
        def refresh(self,idx):
            if idx == 0:
                app.body = self.canvas
            else:
                app.body = self.text
    
        def close_app(self):
            self.lock.signal()
    
        def run(self):
            old_title = app.title
            self.lock.wait()
            app.set_tabs( [], None )
            app.title = old_title
            app.menu = []
            app.body = None
            app.set_exit()
    
    if __name__ == "__main__":
    
        td = TabDemo()
        td.run()
    Marcelo Barros

Similar Threads

  1. Tabs issue
    By ramanathan_s12 in forum Symbian User Interface
    Replies: 5
    Last Post: 2009-03-17, 09:22
  2. Navigation tabs corrupted
    By nadav70 in forum Symbian User Interface
    Replies: 5
    Last Post: 2009-03-11, 06:59
  3. Navigation Tabs (or Tabs Pane) in J2ME/Series 60
    By shadisky in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-05-05, 19:48
  4. Navigation Tabs (or Tabs Pane) in J2ME/Series 60
    By shadisky in forum Mobile Java General
    Replies: 0
    Last Post: 2005-05-05, 19:43
  5. Make the Navigation Tabs Invisible
    By yfho in forum Symbian
    Replies: 1
    Last Post: 2004-01-15, 11:47

Posting Permissions

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