Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 39586e7
Showing
4 changed files
with
413 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.