Ben Ford wrote:
Nathan Ingersoll wrote:
ewl_simple_test needs updating badly. Use ewl_test and click on the
various test modes, or use ewl_test <test name>
I should have made it clear that I tried all of the executables and
they all crashed. I'll go build a fresh checkout of everything and
see if that helps. Thanks.
ewl_test is still broken, but I was able to create a working notebook by
puzzling through the source.
Now I have a couple of other problems. If I add a notebook page to a
notebook, I can no longer cleanly shut down the program.[1] I'm
assuming that destroying the window is supposed to recurse down and
destroy children, since nothing else complains. How should I take care
of this problem? Is the notebook failing to destroy it's children?
The second problem is this. I'm creating a text widget:
text2 = ewl_text_new();
ewl_text_text_set(EWL_TEXT(text2),txt);
ewl_object_alignment_set(EWL_OBJECT(text2), EWL_FLAG_ALIGN_LEFT);
/* none of these properties appear to set properly! */
ewl_text_wrap_set(EWL_TEXT(text2), TRUE);
ewl_text_underline_color_set(EWL_TEXT(text2), 0, 0, 0, 255);
ewl_text_double_underline_color_set(EWL_TEXT(text2), 50, 50, 50, 255);
ewl_text_shadow_color_set(EWL_TEXT(text2), 128, 128, 128, 128);
ewl_text_outline_color_set(EWL_TEXT(text2), 200, 200, 200, 200);
ewl_text_strikethrough_color_set(EWL_TEXT(text2), 0, 0, 0, 255);
ewl_text_glow_color_set(EWL_TEXT(text2), 0, 255, 0, 128);
ewl_container_child_append(EWL_CONTAINER(main_vbox), text2);
ewl_widget_show(text2);
and many properties aren't being set. Am I doing something wrong?
And last, I needed to find the number of pages in a notebook, so I wrote
a patch to do so. Please review it.
Thanks
-b
[1]
***** Ewl Developer Warning ***** :
To find where this is occurring set a breakpoint
for the function ewl_print_warning.
This program is calling:
ewl_notebook_page_destroy_cb();
With the paramter:
w
as the wrong type. ((null)) instead of (widget).
Please fix your program.
***** Ewl Developer Warning ***** :
To find where this is occurring set a breakpoint
for the function ewl_print_warning.
This program is calling:
ewl_widget_data_get();
With the paramter:
w
as the wrong type. ((null)) instead of (widget).
Please fix your program.
diff -ur ewl.orig/src/lib/ewl_notebook.c ewl/src/lib/ewl_notebook.c
--- ewl.orig/src/lib/ewl_notebook.c 2005-12-29 23:05:47.000000000 -0800
+++ ewl/src/lib/ewl_notebook.c 2006-01-05 00:47:49.000000000 -0800
@@ -521,6 +521,26 @@
DRETURN_INT(index, DLEVEL_STABLE);
}
+/**
+ * @param n: the notebook to retrieve the number of pages of
+ * @return Returns the number of pages on success.
+ * @brief Retrieves the number of pages in the notebook @a n or
+ * -1 on error..
+ */
+int
+ewl_notebook_number_pages_get(Ewl_Notebook *n)
+{
+ int pages = -1;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("n", n, pages);
+ DCHECK_TYPE_RET("n", n, "notebook", pages);
+
+ pages = ecore_list_nodes(n->pages);
+
+ DRETURN_INT(pages, DLEVEL_STABLE);
+}
+
void ewl_notebook_child_show_cb(Ewl_Container *n, Ewl_Widget *c)
{
printf("Tab box %p\n\t", n);
diff -ur ewl.orig/src/lib/ewl_notebook.h ewl/src/lib/ewl_notebook.h
--- ewl.orig/src/lib/ewl_notebook.h 2005-11-01 04:05:09.000000000 -0800
+++ ewl/src/lib/ewl_notebook.h 2006-01-05 00:47:46.000000000 -0800
@@ -66,6 +66,7 @@
void ewl_notebook_visible_page_set(Ewl_Notebook *n, int t);
int ewl_notebook_visible_page_get(Ewl_Notebook *n);
+int ewl_notebook_number_pages_get(Ewl_Notebook *n);
/*
* Internally used callbacks, override at your own risk.