Here is some code I have trouble with from the offical reference manual
http://developer.gnome.org/gtk3/stable/GtkSpinButton.htmlCode:
/* Provides a function to retrieve a floating point value from a
* GtkSpinButton, and creates a high precision spin button.
*/
gfloat
grab_float_value (GtkSpinButton *button,
gpointer user_data)
{
return gtk_spin_button_get_value (button);
}
void
create_floating_spin_button (void)
{
GtkWidget *window, *button;
GtkAdjustment *adjustment;
adjustment = gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.0);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
/* creates the spinbutton, with three decimal places */
button = gtk_spin_button_new (adjustment, 0.001, 3);
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show_all (window);
}
The error I get while building is:
Quote:
1>c:\users\arbeit\documents\visual studio 2010\projects\gtk_training2\gtk_training2\gtk_training2.cpp(11): warning C4244: 'return': Konvertierung von 'gdouble' in 'gfloat', möglicher Datenverlust
1>c:\users\arbeit\documents\visual studio 2010\projects\gtk_training2\gtk_training2\gtk_training2.cpp(20): error C2440: '=': 'GtkObject *' kann nicht in 'GtkAdjustment *' konvertiert werden
1> Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.