×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Question 7 litle questions about Amaretto !

    Hello ,

    After searching in the documentation and trying other things i can resolve these following problems !

    1) How to use sub-menu in menu. I try to use sublist but it doesn't work :-(

    Options -> menu 1 -> submenu 1
    -> submenu 2

    2) How to exit directly from a python script without entering in Python Installer ?

    3) I try and i succeed to use the right soft key (app.exit_key_handler) for making other things than exiting python script but how to change the name of this right soft key ?

    4) How to retrieve the text selected in the text editor UI control (with pencil and arrow keys) ?

    5) How to capture in the text editor UI control the following keys with bind : Pencil or ABC , alphabetic character ( A,B,C,D etc.) , Keys 0 to 9
    Menu key , Red key and Green key , key combinations (pencil and 1) ?

    6) How to modify the following properties of the text editor UI control ?

    - Font color (It appears in green only ?)
    - Font size (Only 8 lines per screen ?)
    - Proportional font only ? (Can i use fixed font instead ?)

    7) Last but not least ... The callable object in a bind statement is called for a specified event in the following order :


    a) callback function setup by bind
    b) real function

    Can i replace the real function by the callback or inverse the previous calling order ?

    Thank you for your answers !

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    8

    answer to question 2

    Originally posted by cyke64

    2) How to exit directly from a python script without entering in Python Installer ?
    Well, I know this one. Use appuifw.app.set_exit(). Here's a function that only sets this for a script that wasn't executed from the interpreter (such as a py2sis application):

    Code:
    def set_exit_if_standalone():
        """Only set_exit() if this wasn't invoked from the interpreter ui."""
        appname = appuifw.app.full_name()
        if appname[-10:] != u"Python.app":
            appuifw.app.set_exit()

  3. #3
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: 7 litle questions about Amaretto !

    Originally posted by cyke64
    Hello ,

    After searching in the documentation and trying other things i can resolve these following problems !

    1) How to use sub-menu in menu. I try to use sublist but it doesn't work :-(

    Options -> menu 1 -> submenu 1
    -> submenu 2

    2) How to exit directly from a python script without entering in Python Installer ?

    3) I try and i succeed to use the right soft key (app.exit_key_handler) for making other things than exiting python script but how to change the name of this right soft key ?

    4) How to retrieve the text selected in the text editor UI control (with pencil and arrow keys) ?

    5) How to capture in the text editor UI control the following keys with bind : Pencil or ABC , alphabetic character ( A,B,C,D etc.) , Keys 0 to 9
    Menu key , Red key and Green key , key combinations (pencil and 1) ?

    6) How to modify the following properties of the text editor UI control ?

    - Font color (It appears in green only ?)
    - Font size (Only 8 lines per screen ?)
    - Proportional font only ? (Can i use fixed font instead ?)

    7) Last but not least ... The callable object in a bind statement is called for a specified event in the following order :


    a) callback function setup by bind
    b) real function

    Can i replace the real function by the callback or inverse the previous calling order ?

    Thank you for your answers !
    You already got the answer for question 2. Features 1,3,4,6 and 7 are not supported. As to question 5, you should be able to bind at least the green button and the menu key.

  4. #4
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    Re: 7 litle questions about Amaretto !

    Originally posted by cyke64

    1) How to use sub-menu in menu. I try to use sublist but it doesn't work :-(

    Options -> menu 1 -> submenu 1
    -> submenu 2
    This is supported in the new alpha releases (1.1.1 onwards, inclusive):

    Code:
        appuifw.app.menu = [(u"item 1", func1),
                            (u"Submenu 1", ((u"sub item 1", func2), 
                                            (u"sub item 2", func3) ))
                            ]
    Notice though that "py2sis" generated SIS files will not be able to use sub-menus yet - this results in "CONE 14" panic. There is a workaround though: "unsis" the release package and move the "python.rsc" to folder "templates" (under "py2sis") and rename "python.rsc" to "pyrsc_template.tmp".

  5. #5
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: 7 litle questions about Amaretto !

    Originally posted by cyke64
    Hello ,

    6) How to modify the following properties of the text editor UI control ?

    - Font color (It appears in green only ?)
    - Font size (Only 8 lines per screen ?)
    - Proportional font only ? (Can i use fixed font instead ?)

    This is now supported in the 1.1 series.

Posting Permissions

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