Non-editable float output widget



 To An Interested and Helpfull Person,
                                                                    I would like to show some floating point 
and integer numbers which are the results of various calculations on the top-level window alongside other 
widgets. These resultant numbers must be non-editable. I've tried this by first converting the numbers to 
strings:
 
char string_anumber[20]; /* As a global variable */
sprintf (string_anumber, "%f", anumber);
 
subsequent printf() statements show that this converts the number to a string successfully.
Then I try to show the string as a gtk_label (for want of an approprtiate method):
 
label_string_anumber = gtk_label_new (string_anumber);
gtk_grid_attach (GTK_GRID (grid), label_string_anumber, 0, 0, 1, 1);
 
This compiles but simply shows nothing at the given grid location. I've also tried:
 
label_string_anumber = g_print ("%s", string_anumber);
gtk_grid_attach (GTK_GRID (grid), label_string_anumber, 0, 0, 1, 1);
 
and:
 
gtk_grid_attach (GTK_GRID (grid), g_print ("%s", string_anumber), 0, 0, 1, 1);
 
Thanks for reading, considering and responding to this enquiry,
Roger Matthews.
                                          


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