Re: [gtk-list] Request for Range Control Widget Example



Jeffrey Larsen wrote:
> 
> Can anyone supply me with code for a range control widget declaration
> and basic functions?
> 
> Thanks! Anne
> 
 
 Here is a very simple example that I used to test it out. May be it
 is of some help.

  GtkObject *Adjustment = gtk_adjustment_new(0, -10, 10, 0.1, 0.5, 0);
  GtkWidget *Scale = gtk_hscale_new((GtkAdjustment *)Adjustment);

  gtk_container_add(GTK_CONTAINER(window), Scale);
  gtk_widget_show(Scale);

  gtk_widget_show(window);

  ...

  g_print("Current scale value is: %g", (GtkAdjustment *)Adjustment->value);

Regards

Saadat.
saadat@east.la.asu.edu



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