Drawing basic graphics with a custom widget

2 messages - 947 views

At first thanks for the great framework.

So my problem is that I want to draw some basic graphics into my midlet. I think I need to use a custom widget. Ok this is not the problem, I can draw an arc like in the “create a custom widget” tutorial. But how can I change the size of the arc dynamical at the runtime?

For this I use the DynamicDataProvider to update the new value into my xml-file and my Widget, in that I draw the arc, get the new Attribute.

In the 5 tutorial you learn how to use dynamic datas, so I want to set my radius dynamic too. But I have no idea how I should do that.

But how I can set the following part dynamic? I know I have to use the @{} syntax to use a dynamic data and I have no problem to make a <text> dynamic.

<screen>

    <mywidget radius="50" />

</screen>

 

Or should I use another xml-parser like kxml?

Because I want to draw a state or bar graph with predefined x and y axis.

Sorry for my bad english but english is not my native language.

Thanks for your help.

 

Ok after a few more tries I get it started =) I only have to say

<screen>

    <mywidget>

        <_radius>@{radius}</_radius>

    </mywidget>

</screen>

 

Now I can start with my real project