Enlightenment CVS committal Author : dj2 Project : e17 Module : docs
Dir : e17/docs/cookbook/xml/ewl Modified Files: ewl_intro.xml Log Message: - make the example work again - fixup some changed function calls =================================================================== RCS file: /cvsroot/enlightenment/e17/docs/cookbook/xml/ewl/ewl_intro.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_intro.xml 15 Feb 2005 23:53:03 -0000 1.9 +++ ewl_intro.xml 16 Feb 2005 00:40:39 -0000 1.10 @@ -529,10 +529,19 @@ <title>File dialog open button callback</title> <programlisting> /* the file dialog open button callback */ -static void open_file_cb(Ewl_Widget *win, void *ev, void *data) { +static void open_file_cb(Ewl_Widget *w, void *ev, void *data) { char *text = NULL; - text = read_file((char *)ev); - + int *response = (int *)ev; + + switch (*response) { + case EWL_RESPONSE_OPEN: + text = read_file(ewl_filedialog_file_get(EWL_FILEDIALOG(w))); + break; + + case EWL_RESPONSE_CANCEL: + break; + } + if (text) { ewl_text_text_set(EWL_TEXT(data), text); free(text); @@ -572,7 +581,7 @@ home = getenv("HOME"); if (home) - ewl_filedialog_set_directory(fd, home); + ewl_filedialog_path_set(fd, home); } </programlisting> </example> @@ -581,7 +590,7 @@ display the contents of their home directory to them. We set the file dialog as the user data to the callback, so we cast that back to the Ewl_Filedialog and grabbing the home directory from the environment. The -call to <function>ewl_filedialog_set_directory()</function> changes the current directory +call to <function>ewl_filedialog_path_set()</function> changes the current directory the file dialog is displaying to be the users home directory. </para> @@ -699,7 +708,7 @@ </para> <example> -<title>Complication</title> +<title>Compilation</title> <screen> [EMAIL PROTECTED] [ewl_intro] -< gcc -Wall -o ewl_text main.c \ `ewl-config --cflags --libs` ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs