Skip to content
Browse files

Major update since last commit

Makefile - used to make the project
todo.c - The core of the project, written in C.
todo.glade - GTK glade specification (not used actively)
todo2.glade - GTK glade specification (actively used - at present)
  • Loading branch information...
1 parent 801838d commit 39586e7ba37358dd75d87e6124f53266f81ae9ad @mrerrormessage committed
Showing with 413 additions and 4 deletions.
  1. +7 −0 Makefile
  2. +66 −0 todo.c
  3. +30 −4 todo.glade
  4. +310 −0 todo2.glade
View
7 Makefile
@@ -0,0 +1,7 @@
+CC=gcc
+CFLAGS=-Wall -g
+GTKFLAGS=$(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0)
+
+
+all:
+ $(CC) `pkg-config --cflags --libs gtk+-2.0` $(CFLAGS) -o todo todo.c
View
66 todo.c
@@ -0,0 +1,66 @@
+//code by Robert Grider
+//Mar 11, 2010
+
+#include <gtk/gtk.h>
+#include <stdlib.h>
+
+
+struct todo_item{
+ GtkCheckButton * button;
+ char * description;
+ struct todo_item * next;
+};
+
+struct todo_state{
+ GtkTextBuffer * buf;
+ GtkButton * addButton;
+ struct todo_item * first;
+};
+
+
+void on_add_item( GtkWidget * addbutton, gpointer data);
+void on_item_complete( GtkWidget * checkbutton, gpointer data);
+void add_new_task( struct todo_state * ts, char * description);
+struct todo_state* init_todo_state();
+struct todo_item * init_todo_item( char * desc );
+
+
+int main( int argc, char ** argv){
+
+ GtkBuilder * builder;
+ GtkWidget * window;
+ GtkWidget * button;
+ GtkTextBuffer * buf;
+
+ GError * error = NULL;
+
+ //initializations
+ gtk_init( &argc, &argv);
+ builder = gtk_builder_new();
+
+ if( ! gtk_builder_add_from_file(builder, "todo2.glade", &error) ){
+ g_warning( "%s", error->message);
+ g_free( error );
+ return(1);
+ }
+
+
+ //get objects here and put them in the todo structure
+ window = GTK_WIDGET ( gtk_builder_get_object(builder, "window1" ) );
+
+ //connect the signals here
+
+
+
+ //after signals connected
+ gtk_builder_connect_signals( builder, NULL );
+
+ //destroy builder
+ g_object_unref( G_OBJECT( builder ) );
+
+ //show and run
+ gtk_widget_show( window );
+ gtk_main();
+
+ return( 0 );
+}
View
34 todo.glade
@@ -3,6 +3,8 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="window1">
+ <property name="width_request">500</property>
+ <property name="height_request">300</property>
<child>
<object class="GtkVPaned" id="vpaned1">
<property name="visible">True</property>
@@ -151,7 +153,7 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkVBox" id="vbox2">
- <property name="height_request">30</property>
+ <property name="height_request">73</property>
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
@@ -160,24 +162,29 @@
<property name="label" translatable="yes">To-Do:</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry1">
+ <property name="height_request">26</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="caps_lock_warning">False</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="xalign">0.9100000262260437</property>
+ <property name="xalign">0.89999997615814209</property>
<property name="xscale">0.5</property>
<child>
<object class="GtkButton" id="button1">
@@ -195,6 +202,7 @@
</child>
</object>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
@@ -210,11 +218,12 @@
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
- <property name="yscale">0</property>
+ <property name="bottom_padding">40</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
+ <property name="homogeneous">True</property>
<child>
<object class="GtkCheckButton" id="checkbutton1">
<property name="label" translatable="yes">checkbutton</property>
@@ -226,11 +235,28 @@
<property name="draw_indicator">True</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkCheckButton" id="checkbutton2">
+ <property name="label" translatable="yes">checkbutton</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="image_position">right</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
<placeholder/>
View
310 todo2.glade
@@ -0,0 +1,310 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkWindow" id="window1">
+ <property name="width_request">500</property>
+ <property name="height_request">300</property>
+ <child>
+ <object class="GtkVPaned" id="vpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkMenuItem" id="menuitem1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem1">
+ <property name="label">gtk-new</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem2">
+ <property name="label">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem3">
+ <property name="label">gtk-save</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem4">
+ <property name="label">gtk-save-as</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem5">
+ <property name="label">gtk-quit</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem6">
+ <property name="label">gtk-cut</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem7">
+ <property name="label">gtk-copy</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem8">
+ <property name="label">gtk-paste</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem9">
+ <property name="label">gtk-delete</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_View</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu3">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem10">
+ <property name="label">gtk-about</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="height_request">73</property>
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">To-Do:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkEntry" id="entry1">
+ <property name="width_request">360</property>
+ <property name="height_request">26</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <property name="caps_lock_warning">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label" translatable="yes">Add</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <child>
+ <object class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="resize_mode">queue</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="bottom_padding">40</property>
+ <child>
+ <object class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton1">
+ <property name="label" translatable="yes">checkbutton</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="image_position">right</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton2">
+ <property name="label" translatable="yes">checkbutton</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="image_position">right</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkTextBuffer" id="textbuffer1"/>
+</interface>

0 comments on commit 39586e7

Please sign in to comment.
Something went wrong with that request. Please try again.