eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GTK2.Hscale; inherit GTK2.Scale; //! The GTK2.HScale widget is used to allow the user to select a value //! using a horizontal slider. A GTK2.Adjustment is used to set the //! initial value, the lower and upper bounds, and the step and page //! increments. //! <p> //! See W(Scale) for details //! </p><p> //! The position to show the current value, and the number of decimal //! places shown can be set using the parent W(Scale) class's //! functions. //! </p>
27a6df2006-01-05Marcus Comstedt //! IMG: GTK2.Hscale(GTK2.Adjustment())->set_size_request(300,30)
1a05542005-07-28Martin Nilsson 
3d76632005-11-03Lance Dillon void create(GTK2.Adjustment|float|mapping(string:mixed) settings_or_min_props, ?float max, ?float step)
1a05542005-07-28Martin Nilsson //! Used to create a new hscale widget. //! Either pass an W(Adjustment), or three floats representing min, max, and //! step values. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
1a05542005-07-28Martin Nilsson  if (args==1) {
017b572011-10-28Henrik Grubbström (Grubba)  if (TYPEOF(Pike_sp[-args]) == PIKE_T_OBJECT) {
3d76632005-11-03Lance Dillon  struct object *o1; GtkWidget *gh; get_all_args("create",args,"%o",&o1); gh=gtk_hscale_new(GTK_ADJUSTMENT(get_gobject(o1))); THIS->obj=G_OBJECT(gh); } else { INIT_WITH_PROPS(GTK_TYPE_HSCALE); }
1a05542005-07-28Martin Nilsson  } else { FLOAT_TYPE min,max,step;
3d76632005-11-03Lance Dillon  GtkWidget *gh;
1a05542005-07-28Martin Nilsson  get_all_args("create",args,"%f%f%f",&min,&max,&step);
3d76632005-11-03Lance Dillon  gh=gtk_hscale_new_with_range(min,max,step); THIS->obj=G_OBJECT(gh);
1a05542005-07-28Martin Nilsson  }
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args); pgtk2__init_this_object();
1a05542005-07-28Martin Nilsson }