eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GTK2.Viewport; inherit GTK2.Bin; //! This is a container that can be scrolled around, but it has no scrollbars. //! You can connect scrollbars to it using the adjustment objects. //! IMG: GTK2.Viewport(GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100) //! IMG: GTK2.Viewport(GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)->set_shadow_type(GTK2.SHADOW_ETCHED_IN) //! IMG: GTK2.Viewport(GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)->add(GTK2.Label("A label with a very long text on it, it will not fit"))->set_shadow_type(GTK2.SHADOW_ETCHED_IN) //! IMG: lambda(){ object a1;object v = GTK2.Viewport(a1=GTK2.Adjustment(),GTK2.Adjustment())->set_size_request(100,100)->add(GTK2.Label("A label with a very long text on it, it will not fit"))->set_shadow_type(GTK2.SHADOW_ETCHED_IN);call_out(a1->set_value,0,100.0);return v;}() //! Properties: //! GTK2.Adjustment hadjustment //! int shadow-type //! GTK2.Adjustment vadjustment signal set_scroll_adjustments;
3d76632005-11-03Lance Dillon void create(GTK2.Adjustment|mapping(string:mixed)|void xscroll_or_props, ?GTK2.Adjustment yscroll)
1a05542005-07-28Martin Nilsson //! Create a new viewport. The adjustments are used to select what //! part of the viewport to view to the user. They are normally //! connected to a scrollbar or something similar.
3d76632005-11-03Lance Dillon {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
3d76632005-11-03Lance Dillon  if (args) {
017b572011-10-28Henrik Grubbström (Grubba)  if (TYPEOF(Pike_sp[-args]) == PIKE_T_OBJECT) {
3d76632005-11-03Lance Dillon  struct object *o1,*o2=NULL; GtkWidget *gv;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%o.%o",&o1,&o2);
3d76632005-11-03Lance Dillon  gv=gtk_viewport_new(GTK_ADJUSTMENT(get_gobject(o1)), GTK_ADJUSTMENT(get_gobject(o2))); THIS->obj=G_OBJECT(gv); } else { INIT_WITH_PROPS(GTK_TYPE_VIEWPORT); }
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
3d76632005-11-03Lance Dillon  } else { GtkWidget *gv; gv=gtk_viewport_new(NULL,NULL); THIS->obj=G_OBJECT(gv); }
ba9e802006-02-27Martin Stjernholm  pgtk2__init_this_object();
3d76632005-11-03Lance Dillon }
1a05542005-07-28Martin Nilsson 
f284492006-08-03Lance Dillon +GTK2.Adjustment get_hadjustment();
1a05542005-07-28Martin Nilsson //! Return the current horizontal adjustment object
f284492006-08-03Lance Dillon +GTK2.Adjustment get_vadjustment();
1a05542005-07-28Martin Nilsson //! Return the current vertical adjustment object int get_shadow_type(); //! Get the shadow type. One Of CONST(GTK_SHADOW_) void set_hadjustment(GTK2.Adjustment xscroll); //! Set a new horizontal adjustment object. void set_vadjustment(GTK2.Adjustment yscroll); //! Set a new vertical adjustment object. void set_shadow_type(int type); //! Set the shadow style. One of CONST(GTK_SHADOW)