RE: [gtk-list] Re: GtkRange??




On 07-Apr-98 Owen Taylor wrote:
> 
> Orlando Andico <orly@mozcom.com> writes:
>
>> This is one of the things I hate about GTK+ !!!
>> You DON'T extract values from a scale widget (what I assume you mean the
>> range is) in fact you can't even attach a callback to a ^%^*$%@# scale..
>> you attach the callback to the associated ADJUSTMENT widget, and extract
>> values like so..
>> 
>>  value = GTK_ADJUSTMENT(mywidget)->value;
> 
> If this is the biggest complaint you have about GTK. Then, well,
> I'm happy. ;-)
> 
>   GtkWidget *range;
>   GtkAdjustment *adj;
> 
>   adj = gtk_adjustment_new (value, upper, lower, step_increment,
>                             page_increment, page_size);

     ^^^^^^
(GtkAdjustment *)

>   range = gtk_hscale_new (adj);
> 
>   gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC
>                       (callback), NULL);
> 
> void
> callback (GtkAdjustment *adj, gpointer data)
> {
>   g_print ("New value is %f\n", adj->value);
> }

Sorry, I should have made it a bit clearer that I'm using gtk--.  Is there an
interface for this operation, or do I have to use gtk functions? TP?

C-YA
Jon

http://www.dookie.demon.co.uk



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