"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "examples/enable_disable.c" between
gtkdatabox-0.9.3.1.tar.gz and gtkdatabox-1.0.0.tar.gz

About: GtkDatabox is a Gtk+-widget for live display of large amounts of fluctuating numerical data.

enable_disable.c  (gtkdatabox-0.9.3.1):enable_disable.c  (gtkdatabox-1.0.0)
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2.1 * as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <stdio.h> #include <stdio.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gtkdatabox.h> #include <gtkdatabox.h>
#include <gtkdatabox_bars.h> #include <gtkdatabox_bars.h>
#include <math.h> #include <math.h>
#define POINTS 50 #define POINTS 50
skipping to change at line 87 skipping to change at line 87
GtkWidget *box2; GtkWidget *box2;
GtkWidget *close_button; GtkWidget *close_button;
GtkWidget *enable_box; GtkWidget *enable_box;
GtkWidget *box; GtkWidget *box;
GtkWidget *table; GtkWidget *table;
GtkWidget *label; GtkWidget *label;
GtkWidget *separator; GtkWidget *separator;
GtkDataboxGraph *graph; GtkDataboxGraph *graph;
gfloat *X; gfloat *X;
gfloat *Y; gfloat *Y;
GdkColor color; GdkRGBA color;
gint i; gint i;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request (window, 600, 600); gtk_widget_set_size_request (window, 600, 600);
g_signal_connect (GTK_OBJECT (window), "destroy", g_signal_connect (G_OBJECT (window), "destroy",
G_CALLBACK (gtk_main_quit), NULL); G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_title (GTK_WINDOW (window), gtk_window_set_title (GTK_WINDOW (window),
"GtkDatabox: Enable/Disable Features"); "GtkDatabox: Enable/Disable Features");
gtk_container_set_border_width (GTK_CONTAINER (window), 0); gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box1 = gtk_vbox_new (FALSE, 0); box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), box1); gtk_container_add (GTK_CONTAINER (window), box1);
label = label =
gtk_label_new gtk_label_new
("Click on the buttons to enable/disable features.\n\nFor basic understand ing: See basics :-)\n\n"); ("Click on the buttons to enable/disable features.\n\nFor basic understand ing: See basics :-)\n\n");
gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0);
separator = gtk_hseparator_new (); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, FALSE, 0);
enable_box = gtk_hbox_new (FALSE, 0); enable_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (box1), enable_box, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), enable_box, FALSE, FALSE, 0);
separator = gtk_hseparator_new (); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, FALSE, 0);
/* Create a GtkDatabox widget along with scrollbars and rulers */ /* Create a GtkDatabox widget along with scrollbars and rulers */
gtk_databox_create_box_with_scrollbars_and_rulers (&box, &table, gtk_databox_create_box_with_scrollbars_and_rulers (&box, &table,
TRUE, TRUE, TRUE, TRUE); TRUE, TRUE, TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (box1), table, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), table, TRUE, TRUE, 0);
X = g_new0 (gfloat, POINTS); X = g_new0 (gfloat, POINTS);
Y = g_new0 (gfloat, POINTS); Y = g_new0 (gfloat, POINTS);
for (i = 0; i < POINTS; i++) for (i = 0; i < POINTS; i++)
{ {
X[i] = i; X[i] = i;
Y[i] = 100. * sin (i * 2 * G_PI / POINTS); Y[i] = 100. * sin (i * 2 * G_PI / POINTS);
} }
color.red = 0; color.red = 0;
color.green = 0; color.green = 0;
color.blue = 65535; color.blue = 1;
color.alpha = 1;
graph = gtk_databox_bars_new (POINTS, X, Y, &color, 1); graph = gtk_databox_bars_new (POINTS, X, Y, &color, 1);
gtk_databox_graph_add (GTK_DATABOX (box), graph); gtk_databox_graph_add (GTK_DATABOX (box), graph);
gtk_databox_auto_rescale (GTK_DATABOX (box), 0.05); gtk_databox_auto_rescale (GTK_DATABOX (box), 0.05);
separator = gtk_hseparator_new (); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
box2 = gtk_vbox_new (FALSE, 10); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_end (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_box_pack_end (GTK_BOX (box1), box2, FALSE, TRUE, 0);
close_button = gtk_button_new_with_label ("close"); close_button = gtk_button_new_with_label ("close");
g_signal_connect_swapped (GTK_OBJECT (close_button), "clicked", g_signal_connect_swapped (G_OBJECT (close_button), "clicked",
G_CALLBACK (gtk_main_quit), GTK_OBJECT (box)); G_CALLBACK (gtk_main_quit), G_OBJECT (box));
gtk_box_pack_start (GTK_BOX (box2), close_button, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box2), close_button, TRUE, TRUE, 0);
gtk_widget_set_can_default(close_button, GTK_CAN_DEFAULT); gtk_widget_set_can_default(close_button, TRUE);
for (i = 0; i < noEnableSets; ++i) for (i = 0; i < noEnableSets; ++i)
{ {
GtkWidget *vbox = gtk_vbox_new (FALSE, 10); GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
GtkWidget *label = gtk_label_new (enableSets[i].title); GtkWidget *label = gtk_label_new (enableSets[i].title);
GtkWidget *entry = gtk_entry_new (); GtkWidget *entry = gtk_entry_new ();
GtkWidget *button = gtk_button_new_with_label ("Change"); GtkWidget *button = gtk_button_new_with_label ("Change");
gtk_box_pack_start (GTK_BOX (enable_box), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (enable_box), vbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE); gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
 End of changes. 13 change blocks. 
14 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)