aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Caseiro <puppetmaster.e17@gmail.com>2006-02-08 15:29:06 +0100
committerPuppet_Master <puppetmaster.e17@gmail.com>2006-02-08 15:29:06 +0100
commit5b81f8a927c65a2e9405ea2539e9f0ab90141614 (patch)
tree3168a8425692e4f1a139aaeaff5ebbd2ac3342cd
parentcontinue working on tool box (diff)
downloadensorcel-5b81f8a927c65a2e9405ea2539e9f0ab90141614.tar.gz
Adding src/ensorcel_gaze.c (I have forget it ...)
Change widget placement on src/ensorcel_gaze.c
-rw-r--r--src/ensorcel.h2
-rw-r--r--src/ensorcel_gaze.c45
-rw-r--r--src/ensorcel_sourcemage_tools.c4
3 files changed, 47 insertions, 4 deletions
diff --git a/src/ensorcel.h b/src/ensorcel.h
index da12ba2..44df76c 100644
--- a/src/ensorcel.h
+++ b/src/ensorcel.h
@@ -207,7 +207,7 @@ void ensorcel_dispel (void *data);
/*
* ENSORCEL TOOL BOX FUNCS
*/
-Etk_Widget *ensorcel_gaze_note_book_table_put ();
+Etk_Widget *ensorcel_gaze_what_page_put ();
/* DEAD FUNCS
Etk_Widget *ensorcel_button_vbox_create(int num_bt, Ensorcel_Button_Set bt_tab[],Etk_Widget *win, int indice);
diff --git a/src/ensorcel_gaze.c b/src/ensorcel_gaze.c
new file mode 100644
index 0000000..574d822
--- /dev/null
+++ b/src/ensorcel_gaze.c
@@ -0,0 +1,45 @@
+#include "ensorcel.h"
+
+static Etk_Bool _ensorcel_entry_what_cb(void *data)
+{
+ Ensorcel_Tools_Objects *obj = data;
+
+ sprintf(obj->cmd,"gaze -q what %s",etk_entry_text_get(ETK_ENTRY(obj->entry)));
+ ensorcel_cmd_run(obj->cmd,ETK_LABEL(obj->label));
+ return(1);
+}
+
+
+Etk_Widget *ensorcel_gaze_what_page_put ()
+{
+ Etk_Widget *table;
+ Etk_Widget *button;
+ Etk_Widget *fm_what;
+ Etk_Widget *vbox;
+
+ vbox = etk_vbox_new (FALSE, 0);
+
+ fm_what = etk_frame_new(_("What is this spell ?"));
+ etk_widget_size_request_set (ETK_WIDGET (fm_what), 200, 200);
+
+ Ensorcel_Tools_Objects *objects;
+ objects = (Ensorcel_Tools_Objects *) malloc (sizeof (Ensorcel_Tools_Objects));
+
+ table = etk_table_new(2, 4, 1);
+
+ objects->entry = etk_entry_new();
+ etk_table_attach_defaults(ETK_TABLE(table),objects->entry, 0 ,0 ,1 ,1);
+
+ button = etk_button_new_with_label(_("Run"));
+ etk_table_attach_defaults(ETK_TABLE(table),button ,1 ,1 ,1 ,1);
+ etk_signal_connect("clicked", ETK_OBJECT(button), ETK_CALLBACK(_ensorcel_entry_what_cb), objects);
+
+ objects->label = etk_label_new("Answer");
+ etk_table_attach_defaults(ETK_TABLE(table), objects->label, 0, 1, 2, 2);
+
+ etk_container_add(ETK_CONTAINER(fm_what),table);
+
+ etk_box_pack_start(ETK_BOX(vbox),fm_what, FALSE, FALSE, 0);
+
+ return(vbox);
+}
diff --git a/src/ensorcel_sourcemage_tools.c b/src/ensorcel_sourcemage_tools.c
index 9f3f894..050e17b 100644
--- a/src/ensorcel_sourcemage_tools.c
+++ b/src/ensorcel_sourcemage_tools.c
@@ -40,9 +40,7 @@ void ensorcel_sorcery_tools_window_create (void *data _UNUSED_)
etk_widget_size_request_set (ETK_WIDGET (note_book), 800, 600);
/* NOTE BOOK PAGES ADD */
- printf("ici\n");
- page_gaze = ensorcel_gaze_note_book_table_put();
- printf("LA\n");
+ page_gaze = ensorcel_gaze_what_page_put();
etk_notebook_page_append (ETK_NOTEBOOK (note_book), "Gaze", page_gaze);
etk_notebook_page_append (ETK_NOTEBOOK (note_book), "NetConf", lb_netconf);