eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GTK2.ScrolledWindow; inherit GTK2.Bin; //! Scrolled windows are used to create a scrollable area with another
2ef39e2014-09-25Chris Angelico //! widget inside it. You may insert any type of widget into a scrolled //! window, and it will be accessible regardless of its size by using
1a05542005-07-28Martin Nilsson //! the scrollbars. //!<p> //! IMG: GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("A small label"))->set_policy(GTK2.POLICY_AUTOMATIC,GTK2.POLICY_AUTOMATIC) //! IMG: GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("A small label"))->set_policy(GTK2.POLICY_AUTOMATIC,GTK2.POLICY_AUTOMATIC) //! IMG: GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("A small label"))
2ef39e2014-09-25Chris Angelico //! IMG: GTK2.ScrolledWindow(GTK2.Adjustment(),GTK2.Adjustment())->add(GTK2.Label("a very huge label"))
1a05542005-07-28Martin Nilsson //! </p> //! Properties: //! GTK2.Adjustment hadjustment //! int hscrollbar-policy //! int shadow-type //! GTK2.Adjustment vadjustment //! int vscrollbar-policy //! int window-placement //! <p> //! Style properties: //! int scrollbar-spacing
6fe0562007-10-14Lance Dillon //! int scrollbars-within-bevel
1a05542005-07-28Martin Nilsson  signal move_focus_out; signal scroll_child;
3d76632005-11-03Lance Dillon void create(?GTK2.Adjustment|mapping(string:mixed)|void hadjustment_or_props, ?GTK2.Adjustment vadjustments)
1a05542005-07-28Martin Nilsson //! The two adjustments are most commonly set to 0.
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 *gs;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%o.%o",&o1,&o2);
3d76632005-11-03Lance Dillon  gs=gtk_scrolled_window_new( GTK_ADJUSTMENT(get_gobject(o1)), GTK_ADJUSTMENT(get_gobject(o2))); THIS->obj=G_OBJECT(gs); } else { INIT_WITH_PROPS(GTK_TYPE_SCROLLED_WINDOW); }
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
3d76632005-11-03Lance Dillon  } else { GtkWidget *gs; gs=gtk_scrolled_window_new(NULL,NULL); THIS->obj=G_OBJECT(gs); }
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 //! Get the horizontal adjustment.
f284492006-08-03Lance Dillon +GTK2.Adjustment get_vadjustment();
1a05542005-07-28Martin Nilsson //! Get the vertical adjustment.
3d76632005-11-03Lance Dillon require gtk28;
f284492006-08-03Lance Dillon +GTK2.HScrollbar get_hscrollbar();
3d76632005-11-03Lance Dillon //! Returns the horizontal scrollbar.
f284492006-08-03Lance Dillon +GTK2.VScrollbar get_vscrollbar();
3d76632005-11-03Lance Dillon //! Returns the vertical scrollbar. endrequire;
1a05542005-07-28Martin Nilsson void set_policy(int xpolicy, int ypolicy); //! Vertical and horizontal policy. Both are one of CONST(GTK_POLICY_) void add(GTK2.Widget victim) //! Add a widget to this container. //! This is equivalent to the //! C-GTK function gtk_scrolled_window_add_with_viewport or //! gtk_container_add, depending on whether or not the child supports //! the set_scroll_adjustments signal. //! <p> //! What this means in practice is that you do not have to care about //! this at all, it's all handled automatically. //! </p> { GtkWidget *victim; struct object *o;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%o",&o);
1a05542005-07-28Martin Nilsson  victim=GTK_WIDGET(get_gobject(o)); if (!(GTK_WIDGET_GET_CLASS(victim)->set_scroll_adjustments_signal)) gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(THIS->obj), victim); else gtk_container_add(GTK_CONTAINER(THIS->obj),victim); RETURN_THIS(); } void set_placement(int window_placement); //! The location of the window relative to the scrollbars. //! One of CONST(GTK_CORNER_)
f284492006-08-03Lance Dillon require gtk10; void unset_placement(); //! Unsets the placement of the contents with respect to the scrollbars for //! the scrolled window. endrequire;
1a05542005-07-28Martin Nilsson void set_shadow_type(int type); //! Changes the type of shadow drawn around the contents. //! One of CONST(GTK_SHADOW_) void set_hadjustment(GTK2.Adjustment hadjustment); //! Set the horizontal adjustment object. void set_vadjustment(GTK2.Adjustment vadjustment); //! Set the vertical adjustment object. int get_placement(); //! Gets the placement of the scrollbars. mapping(string:int) get_policy() //! Returns the current policy values for the horizontal and vertical //! scrollbars. //! ([ "h-policy": horizontal policy, //! "v-policy": vertical policy //! ]); {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited(); pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  { GtkPolicyType hpol,vpol; gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(THIS->obj), &hpol,&vpol);
9fb5032006-01-14Martin Nilsson  ref_push_string(_STR("h-policy")); push_int(hpol); ref_push_string(_STR("v-policy")); push_int(vpol);
1a05542005-07-28Martin Nilsson  f_aggregate_mapping(4); } } int get_shadow_type(); //! Gets the shadow type.