[Glade-users] Problem With Spinbutton



Hi, Everyone.

I've been trying to get this to work, but having no luck.  All this is
supposed to do is take the spinbutton number and add one to it.  (I've got
some heftier computations in mind when I get this to work, but I want to
start simple.)  Here's the code in callbacks.c:

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gnome.h>
#include <gtk/gtk.h>

#include "callbacks.h"
#include "interface.h"
#include "support.h"


void on_button1_clicked(GtkButton *button, gpointer user_data){

int c;
int d;



GtkWidget * label = lookup_widget(GTK_WIDGET(button), "label1");
GtkWidget * spin = lookup_widget(GTK_WIDGET(button), "spinbutton1");

gchar output[50]="Hello ";
gtk_spin_button_get_value_as_int(c);


gtk_spin_button_set_value(spin, (c + 1));

}


void
on_button2_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{
exit(0);
}


Anyone have any ideas how to get this to work?  Right now, whenever I hit
button1, it sets the number to "100", regardless of what the original number
was.

Thanks!

-- 
bhartman33 at gmail.com
http://brianswebpagehome.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060724/04d4c2c0/attachment.html 




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