Correct widget to report results to the user



Hello,

I've been working my way through the GTK+ 2.2 tutorial, and I have
written a small program, which can be found at:

http://www.whinlatter.uklinux.net/gtk/ogcalc.c


My question is basically about style.  I've used three GtkSpinButtons
to enter values in.  A calculation is done using these values, and the
two result values are displayed in two GtkEntry widgets, which are set
non-editable with gtk_editable_set_editable().

Would the results be better put in a GtkLabel, made selectable with
gtk_label_set_selectable()?  Both do what I want (the result can be
selected and copied), but I'm not sure which is most appropriate for
the task.


Also, I was forced to use global variables due to needing to pass
several widgets to the calculation function.  Is there any way to
avoid this cleanly (i.e. pass them somehow through the callback)?


Many thanks,
Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848 available on public keyservers



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