On 06/29/2012 07:50 PM, Bruno Dilly wrote:
On Fri, Jun 29, 2012 at 12:10 PM, Daniel Willmann
<[email protected]> wrote:
I've attached a patch to fix the example documentation. I'm in the process
of updating the progressbar example doc as well - to explain the format
function and changed signal. But that will come at a later time.

Thanks Daniel, applied.

Good news! I'll be waiting for your patch.
Doc improvements are always very welcome.

And here it is, with explanation of the format function and changed callback.

Regards,
Daniel
>From b5cfb210f7e97ca7da089593c94e7481439932ec Mon Sep 17 00:00:00 2001
From: Daniel Willmann <[email protected]>
Date: Tue, 3 Jul 2012 16:10:42 +0100
Subject: [PATCH] elementary: Update documentation for progressbar example


Signed-off-by: Daniel Willmann <[email protected]>
---
 trunk/elementary/doc/examples.dox                  |   27 +++++++++++++++++++-
 .../elementary/src/examples/progressbar_example.c  |    2 ++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/trunk/elementary/doc/examples.dox b/trunk/elementary/doc/examples.dox
index 390b836..0ce4b13 100644
--- a/trunk/elementary/doc/examples.dox
+++ b/trunk/elementary/doc/examples.dox
@@ -5112,7 +5112,7 @@
  * @until pb2
  *
  * Next, comes a progress bar with an @b icon, a primary label and a
- * @b custom unit label set. It's also made to grow its bar in an
+ * unit label @b function set. It's also made to grow its bar in an
  * @b inverted manner, so check that out during the timer's progression:
  * @dontinclude progressbar_example.c
  * @skip ic1 =
@@ -5123,6 +5123,31 @@
  * manually, as you can see in the @ref progressbar_example_c
  * "complete code".
  *
+ * The format callback is a simple function that gets passed the progress value
+ * and returns a string. A free function should be provided as well, if the
+ * format callback allocates memory.
+ * @dontinclude progressbar_example.c
+ * @skip Format callback
+ * @until }
+ * @until }
+ * 
+ * The last horizontal progress bar has a callback that gets called when its
+ * value is @b changed. This callback updates a label to provide an estimate
+ * when the operation finishes.
+ * @dontinclude progressbar_example.c
+ * @skip pb3
+ * @skip changed trigger
+ * @until pb4
+ *
+ * The "changed" signal is emitted every time the progressbar value is updated
+ * through @ref elm_progressbar_value_set(). This callback calculates and
+ * displays the ETA based on the progress and time that has passed.
+ * @dontinclude progressbar_example.c
+ * @skip Callback for "changed" signal
+ * @until }
+ * @until }
+ * @until }
+ *
  * The next three progress bars are just variants on the ones already
  * shown, but now all being @b vertical. Another time we use one of
  * than to give the window a minimum vertical size, with
diff --git a/trunk/elementary/src/examples/progressbar_example.c b/trunk/elementary/src/examples/progressbar_example.c
index c6dca5f..0aa9b79 100644
--- a/trunk/elementary/src/examples/progressbar_example.c
+++ b/trunk/elementary/src/examples/progressbar_example.c
@@ -86,6 +86,7 @@ _progressbar_example_stop(void        *data,
      }
 }
 
+/* Format callback */
 static char *
 _progress_format_cb(double val)
 {
@@ -102,6 +103,7 @@ _progress_format_free(char *str)
    free(str);
 }
 
+/* Callback for "changed" signal */
 static void
 _on_changed(void        *data,
             Evas_Object *obj,
-- 
1.7.9.5

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to