Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    How to show expanders in treeview

    Reply
    maacruz | # 1 | 2010-05-15, 13:05 | Report

    Hi,
    I'm trying to get expanders shown in a gtk.TreeView (with pygtk) in maemo4.
    I've already tryed to set the expander size setting a style
    Code:
    gtk.rc_parse_string('''style "toolkit"
    {
            GtkTreeView::expander-size = 12
    }
    
    class "GtkTreeView" style "toolkit"
    ''')
    but the expanders aren't drawn.
    Is there any way to get the expanders shown?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Alberto Garcia | # 2 | 2010-05-17, 16:44 | Report

    Originally Posted by maacruz View Post
    Hi,
    but the expanders aren't drawn.
    Is there any way to get the expanders shown?
    They're hidden by default in Maemo-gtk. Try with this function:

    http://maemo.org/api_refs/5.0/beta/g...show-expanders

    Edit | Forward | Quote | Quick Reply | Thanks

     
    maacruz | # 3 | 2010-05-17, 18:41 | Report

    Originally Posted by Alberto Garcia View Post
    They're hidden by default in Maemo-gtk. Try with this function:

    http://maemo.org/api_refs/5.0/beta/g...show-expanders
    They are already enabled by default, and I can expand the tree, but the little triangles are not drawn.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Alberto Garcia | # 4 | 2010-05-18, 15:54 | Report

    Originally Posted by maacruz View Post
    They are already enabled by default, and I can expand the tree, but the little triangles are not drawn.
    Strange, since in C they are disabled by default.

    Anyway, this works for me here:

    Code:
        gtk_rc_parse_string ("style \"toolkit\"\n"
                             "{\n"
                             "GtkTreeView::expander-size = 40\n"
                             "}\n"
                             "class \"GtkTreeView\" style \"toolkit\"\n");
    (this is C, not Python, but it should work the same)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    maacruz | # 5 | 2010-05-18, 15:59 | Report

    But you are using maemo5 (N900), aren't you?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Alberto Garcia | # 6 | 2010-05-18, 16:16 | Report

    Originally Posted by maacruz View Post
    But you are using maemo5 (N900), aren't you?
    Yes, but it also works in Maemo 4 (I don't have a device here,
    but I tested in the SDK).

    But I really had to enable 'show-expanders'. Maemo 4 doesn't seem to have gtk_tree_view_set_show_expanders (), but you can use:

    g_object_set (tree_view, "show-expanders", TRUE, NULL);

    I can upload a complete test case (in C) if you want.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Alberto Garcia For This Useful Post:
    maacruz

     
    maacruz | # 7 | 2010-05-18, 16:45 | Report

    That did it!!!
    Thank you very much!!!

    Now, for being so helpful, I'm going to really abuse you
    My program (zim) runs in maemo5 too, but since there is no fullscreen hardware buton, once it goes fullscreen there is no way to go back to windowed mode.
    It seems that by clicking on the lower right corner of the screen a fullscreen switch button should appear, but it doesn't (people showed me browser screenshots to demonstrate the function). Can I make appear such button (by calling some hildon function/object)? Or must I implement my own fullscreen button?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Alberto Garcia | # 8 | 2010-05-18, 16:48 | Report

    Originally Posted by maacruz View Post
    My program (zim) runs in maemo5 too, but since there is no fullscreen hardware buton, once it goes fullscreen there is no way to go back to windowed mode.
    I'm afraid you have to implement it yourself (or use any other mechanism, such as the +/- buttons, or whatever)

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Alberto Garcia For This Useful Post:
    maacruz

     
vBulletin® Version 3.8.8
Normal Logout