Re: [Anjuta-list] How do I create this simple program in ajunta?



Hello

  You are probably looking for File->New->Project->C->GTK+ project under
anjuta.

On Fri, 2008-01-11 at 11:57 -0800, Brian Lavender wrote:
> I created a new project, but I am having a hard time getting a simple
> gtk application working. How do I create the following in ajunta? 
> 
> brian
> 
> 
> #include <gtk/gtk.h>
> 
> gint destroyapp (GtkWidget *widget, gpointer gdata)
> {
> 
> 	g_print ("Quitting...\n");
> 	gtk_main_quit();
> 
> 	return (TRUE);
> }
> 
> void button_was_clicked (GtkWidget *widget, gpointer gdata)
> {
> 	g_print("Saclug button pressed!!!!\n");
> }
> 
> int main( int argc, char *argv[] )
> {
> 	GtkWidget *window;
> 	GtkWidget *brianButton;
> 
> 	gtk_init(&argc, &argv);
> 
> 	window = gtk_window_new( GTK_WINDOW_TOPLEVEL);
> 	gtk_signal_connect(GTK_OBJECT(window), "delete_event",
> 			   GTK_SIGNAL_FUNC(destroyapp), NULL);
> 
> 	brianButton = gtk_button_new_with_label("Click SacLUG");
>  
> 	gtk_signal_connect(GTK_OBJECT(brianButton), "clicked",
> 			   GTK_SIGNAL_FUNC(button_was_clicked), NULL);
> 
> 	gtk_container_add(GTK_CONTAINER(window), brianButton);
> 
> 	gtk_widget_show(brianButton);
> 
> 	gtk_widget_show(window);
> 	
> 	gtk_main();
> 
> 	return 0;
> }
-- 
Ritesh Khadgaray
ॐ मणि पद्मे हूँ
Desktop LinuX N Stuff
Ph: +919970164885
Eat Right, Exercise, Die Anyway.
Fedora is the best of what works today.  Enterprise Linux is the best of
what will work consistently for the next seven years.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]