Tiled Home created dynamically
#1
Hi,

I want to build my own home dinamically with Python. How can I do it?

I want to have an empty home (only logo) and add dinamycally controls or group of controls. My idea is to create a home with controls like windows 8.1 tiles.

Something like http://fc02.deviantart.net/fs70/i/2012/3...5jkgs6.png

I want to create a tiled list of apps in the home modifying the home.xml. Any ideas?

Thanks in advance
Reply
#2
I guess it would theoretically be possible with a combination of python and smart skinning, but it would be over my head.
Reply
#3
Hi Kib,

I am experimenting with the <onload> in the home.xml skin window and a script in python.

I thought it might overwrite the python script that controls the home but it seems that is a class in cpp (CGUIWindowHome) and I do not dare to touch this code.

thanks.
Reply
#4
If all your tiles are going to be the same size, you can pretty much achieve this already with the skin shortcuts script - you'd create a panel view with a tile-like layout and include the relevant menu built by the script. (Tile color would need to be added via a custom property). If you're wanting to allow different size tiles then some work would be needed, but the way the script writes a file for the skin to include might give you a start on this. (As the menu isn't something that constantly changes, I find it far faster to build the file once and have the skin include it, rather than have the script build the menu each time the home page is loaded.)
Reply
#5
Hi Unfledged,

thanks for the response and sorry for my answer's delay (I was on summer holidays). I see you code and is very interesting and hard for me (I'm a newbie in scripting code).

I'm looking for a sample code based on panel container in python. I want to create custom controls and add to the panel. The controls can be different and not necessary labels and images.

My idea is extract some information from a database and show this information on the panel based on the database register type. For example, if the register is a film, I want to add an image, a label with the title and the rating. If the register is a domotic control (with Arduino), I want to add a button to control the lights and a image to show the state.

I add a to the skin the example piece of code from the wiki.

Code:
<control type="panel" id="52">
            <posx>190</posx>
            <posy>100</posy>
            <width>485</width>
            <height>425</height>
            <onleft>9000</onleft>
            <onright>60</onright>
            <onup>52</onup>
            <ondown>52</ondown>
            <scrolltime tween="sine" easing="out">200</scrolltime>
            <autoscroll>true</autoscroll>
            <viewtype label="536">icon</viewtype>
            <pagecontrol>60</pagecontrol>
            <itemlayout height="141" width="120">
                <control type="image">
                    <posx>10</posx>
                    <posy>10</posy>
                    <width>100</width>
                    <height>100</height>
                    <info>ListItem.Icon</info>
                </control>
                <control type="image">
                    <posx>80</posx>
                    <posy>75</posy>
                    <width>32</width>
                    <height>32</height>
                    <info>ListItem.Overlay</info>
                </control>
                <control type="label">
                    <posx>60</posx>
                    <posy>115</posy>
                    <width>110</width>
                    <height>22</height>
                    <font>font13</font>
                    <selectedcolor>green</selectedcolor>
                    <align>center</align>
                    <info>ListItem.Label</info>
                </control>
            </itemlayout>
            <focusedlayout height="141" width="120">
                <control type="image">
                    <width>110</width>
                    <height>110</height>
                    <posx>5</posx>
                    <posy>5</posy>
                    <texture>folder-focus.png</texture>
                    <animation effect="zoom" end="0,0,120,120" time="100">focus</animation>
                </control>
                <control type="image">
                    <posx>10</posx>
                    <posy>10</posy>
                    <width>100</width>
                    <height>100</height>
                    <info>ListItem.Icon</info>
                    <animation effect="zoom" end="5,5,110,110" time="100">focus</animation>
                </control>
                <control type="image">
                    <posx>80</posx>
                    <posy>75</posy>
                    <width>32</width>
                    <height>32</height>
                    <info>ListItem.Overlay</info>
                    <animation effect="slide" end="5,5" time="100">focus</animation>
                </control>
                <control type="label">
                    <posx>60</posx>
                    <posy>120</posy>
                    <width>110</width>
                    <height>22</height>
                    <font>font13</font>
                    <selectedcolor>green</selectedcolor>
                    <align>center</align>
                    <info>ListItem.Label</info>
                </control>
            </focusedlayout>
        </control>
but I don't know how to control and add items from python. Is this possible? Any example is welcomed.

I try with grouplist but I can get the control from python. In the log I see "Unknown control type for python". Any ideas?

Best regards
Reply

Logout Mark Read Team Forum Stats Members Help
Tiled Home created dynamically0