1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gtk.ScrolledWindow; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gobject.Signals; 30 private import gtk.Adjustment; 31 private import gtk.Bin; 32 private import gtk.Widget; 33 public import gtkc.gdktypes; 34 private import gtkc.gtk; 35 public import gtkc.gtktypes; 36 37 38 /** 39 * GtkScrolledWindow is a #GtkBin subclass: it’s a container 40 * the accepts a single child widget. GtkScrolledWindow adds scrollbars 41 * to the child widget and optionally draws a beveled frame around the 42 * child widget. 43 * 44 * The scrolled window can work in two ways. Some widgets have native 45 * scrolling support; these widgets implement the #GtkScrollable interface. 46 * Widgets with native scroll support include #GtkTreeView, #GtkTextView, 47 * and #GtkLayout. 48 * 49 * For widgets that lack native scrolling support, the #GtkViewport 50 * widget acts as an adaptor class, implementing scrollability for child 51 * widgets that lack their own scrolling capabilities. Use #GtkViewport 52 * to scroll child widgets such as #GtkGrid, #GtkBox, and so on. 53 * 54 * If a widget has native scrolling abilities, it can be added to the 55 * GtkScrolledWindow with gtk_container_add(). If a widget does not, you 56 * must first add the widget to a #GtkViewport, then add the #GtkViewport 57 * to the scrolled window. gtk_container_add() will do this for you for 58 * widgets that don’t implement #GtkScrollable natively, so you can 59 * ignore the presence of the viewport. 60 * 61 * The position of the scrollbars is controlled by the scroll adjustments. 62 * See #GtkAdjustment for the fields in an adjustment — for 63 * #GtkScrollbar, used by GtkScrolledWindow, the “value” field 64 * represents the position of the scrollbar, which must be between the 65 * “lower” field and “upper - page_size.” The “page_size” field 66 * represents the size of the visible scrollable area. The 67 * “step_increment” and “page_increment” fields are used when the user 68 * asks to step down (using the small stepper arrows) or page down (using 69 * for example the PageDown key). 70 * 71 * If a GtkScrolledWindow doesn’t behave quite as you would like, or 72 * doesn’t have exactly the right layout, it’s very possible to set up 73 * your own scrolling with #GtkScrollbar and for example a #GtkGrid. 74 * 75 * # Touch support 76 * 77 * GtkScrolledWindow has built-in support for touch devices. When a 78 * touchscreen is used, swiping will move the scrolled window, and will 79 * expose 'kinetic' behavior. This can be turned off with the 80 * #GtkScrolledWindow:kinetic-scrolling property if it is undesired. 81 * 82 * GtkScrolledWindow also displays visual 'overshoot' indication when 83 * the content is pulled beyond the end, and this situation can be 84 * captured with the #GtkScrolledWindow::edge-overshot signal. 85 * 86 * If no mouse device is present, the scrollbars will overlayed as 87 * narrow, auto-hiding indicators over the content. If traditional 88 * scrollbars are desired although no mouse is present, this behaviour 89 * can be turned off with the #GtkScrolledWindow:overlay-scrolling 90 * property. 91 */ 92 public class ScrolledWindow : Bin 93 { 94 /** the main Gtk struct */ 95 protected GtkScrolledWindow* gtkScrolledWindow; 96 97 /** Get the main Gtk struct */ 98 public GtkScrolledWindow* getScrolledWindowStruct() 99 { 100 return gtkScrolledWindow; 101 } 102 103 /** the main Gtk struct as a void* */ 104 protected override void* getStruct() 105 { 106 return cast(void*)gtkScrolledWindow; 107 } 108 109 protected override void setStruct(GObject* obj) 110 { 111 gtkScrolledWindow = cast(GtkScrolledWindow*)obj; 112 super.setStruct(obj); 113 } 114 115 /** 116 * Sets our main struct and passes it to the parent class. 117 */ 118 public this (GtkScrolledWindow* gtkScrolledWindow, bool ownedRef = false) 119 { 120 this.gtkScrolledWindow = gtkScrolledWindow; 121 super(cast(GtkBin*)gtkScrolledWindow, ownedRef); 122 } 123 124 /** */ 125 public this() 126 { 127 this(null, null); 128 } 129 130 /** */ 131 public this(Widget widget) 132 { 133 this(); 134 add(widget); 135 } 136 137 /** 138 * Creates a new Scrolled window and set the policy type 139 * Params: 140 * hPolicy = the horizontal policy 141 * vPolicy = the vertical policy 142 */ 143 this(PolicyType hPolicy, PolicyType vPolicy) 144 { 145 this(); 146 setPolicy(hPolicy, vPolicy); 147 } 148 149 /** 150 */ 151 152 public static GType getType() 153 { 154 return gtk_scrolled_window_get_type(); 155 } 156 157 /** 158 * Creates a new scrolled window. 159 * 160 * The two arguments are the scrolled window’s adjustments; these will be 161 * shared with the scrollbars and the child widget to keep the bars in sync 162 * with the child. Usually you want to pass %NULL for the adjustments, which 163 * will cause the scrolled window to create them for you. 164 * 165 * Params: 166 * hadjustment = horizontal adjustment 167 * vadjustment = vertical adjustment 168 * 169 * Return: a new scrolled window 170 * 171 * Throws: ConstructionException GTK+ fails to create the object. 172 */ 173 public this(Adjustment hadjustment, Adjustment vadjustment) 174 { 175 auto p = gtk_scrolled_window_new((hadjustment is null) ? null : hadjustment.getAdjustmentStruct(), (vadjustment is null) ? null : vadjustment.getAdjustmentStruct()); 176 177 if(p is null) 178 { 179 throw new ConstructionException("null returned by new"); 180 } 181 182 this(cast(GtkScrolledWindow*) p); 183 } 184 185 /** 186 * Used to add children without native scrolling capabilities. This 187 * is simply a convenience function; it is equivalent to adding the 188 * unscrollable child to a viewport, then adding the viewport to the 189 * scrolled window. If a child has native scrolling, use 190 * gtk_container_add() instead of this function. 191 * 192 * The viewport scrolls the child by moving its #GdkWindow, and takes 193 * the size of the child to be the size of its toplevel #GdkWindow. 194 * This will be very wrong for most widgets that support native scrolling; 195 * for example, if you add a widget such as #GtkTreeView with a viewport, 196 * the whole widget will scroll, including the column headings. Thus, 197 * widgets with native scrolling support should not be used with the 198 * #GtkViewport proxy. 199 * 200 * A widget supports scrolling natively if it implements the 201 * #GtkScrollable interface. 202 * 203 * Deprecated: gtk_container_add() will automatically add 204 * a #GtkViewport if the child doesn’t implement #GtkScrollable. 205 * 206 * Params: 207 * child = the widget you want to scroll 208 */ 209 public void addWithViewport(Widget child) 210 { 211 gtk_scrolled_window_add_with_viewport(gtkScrolledWindow, (child is null) ? null : child.getWidgetStruct()); 212 } 213 214 /** 215 * Return whether button presses are captured during kinetic 216 * scrolling. See gtk_scrolled_window_set_capture_button_press(). 217 * 218 * Return: %TRUE if button presses are captured during kinetic scrolling 219 * 220 * Since: 3.4 221 */ 222 public bool getCaptureButtonPress() 223 { 224 return gtk_scrolled_window_get_capture_button_press(gtkScrolledWindow) != 0; 225 } 226 227 /** 228 * Returns the horizontal scrollbar’s adjustment, used to connect the 229 * horizontal scrollbar to the child widget’s horizontal scroll 230 * functionality. 231 * 232 * Return: the horizontal #GtkAdjustment 233 */ 234 public Adjustment getHadjustment() 235 { 236 auto p = gtk_scrolled_window_get_hadjustment(gtkScrolledWindow); 237 238 if(p is null) 239 { 240 return null; 241 } 242 243 return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p); 244 } 245 246 /** 247 * Returns the horizontal scrollbar of @scrolled_window. 248 * 249 * Return: the horizontal scrollbar of the scrolled window. 250 * 251 * Since: 2.8 252 */ 253 public Widget getHscrollbar() 254 { 255 auto p = gtk_scrolled_window_get_hscrollbar(gtkScrolledWindow); 256 257 if(p is null) 258 { 259 return null; 260 } 261 262 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 263 } 264 265 /** 266 * Returns the specified kinetic scrolling behavior. 267 * 268 * Return: the scrolling behavior flags. 269 * 270 * Since: 3.4 271 */ 272 public bool getKineticScrolling() 273 { 274 return gtk_scrolled_window_get_kinetic_scrolling(gtkScrolledWindow) != 0; 275 } 276 277 /** 278 * Gets the minimal content height of @scrolled_window, or -1 if not set. 279 * 280 * Return: the minimal content height 281 * 282 * Since: 3.0 283 */ 284 public int getMinContentHeight() 285 { 286 return gtk_scrolled_window_get_min_content_height(gtkScrolledWindow); 287 } 288 289 /** 290 * Gets the minimum content width of @scrolled_window, or -1 if not set. 291 * 292 * Return: the minimum content width 293 * 294 * Since: 3.0 295 */ 296 public int getMinContentWidth() 297 { 298 return gtk_scrolled_window_get_min_content_width(gtkScrolledWindow); 299 } 300 301 /** 302 * Returns whether overlay scrolling is enabled for this scrolled window. 303 * 304 * Return: %TRUE if overlay scrolling is enabled 305 * 306 * Since: 3.16 307 */ 308 public bool getOverlayScrolling() 309 { 310 return gtk_scrolled_window_get_overlay_scrolling(gtkScrolledWindow) != 0; 311 } 312 313 /** 314 * Gets the placement of the contents with respect to the scrollbars 315 * for the scrolled window. See gtk_scrolled_window_set_placement(). 316 * 317 * Return: the current placement value. 318 * 319 * See also gtk_scrolled_window_set_placement() and 320 * gtk_scrolled_window_unset_placement(). 321 */ 322 public GtkCornerType getPlacement() 323 { 324 return gtk_scrolled_window_get_placement(gtkScrolledWindow); 325 } 326 327 /** 328 * Retrieves the current policy values for the horizontal and vertical 329 * scrollbars. See gtk_scrolled_window_set_policy(). 330 * 331 * Params: 332 * hscrollbarPolicy = location to store the policy 333 * for the horizontal scrollbar, or %NULL 334 * vscrollbarPolicy = location to store the policy 335 * for the vertical scrollbar, or %NULL 336 */ 337 public void getPolicy(out GtkPolicyType hscrollbarPolicy, out GtkPolicyType vscrollbarPolicy) 338 { 339 gtk_scrolled_window_get_policy(gtkScrolledWindow, &hscrollbarPolicy, &vscrollbarPolicy); 340 } 341 342 /** 343 * Gets the shadow type of the scrolled window. See 344 * gtk_scrolled_window_set_shadow_type(). 345 * 346 * Return: the current shadow type 347 */ 348 public GtkShadowType getShadowType() 349 { 350 return gtk_scrolled_window_get_shadow_type(gtkScrolledWindow); 351 } 352 353 /** 354 * Returns the vertical scrollbar’s adjustment, used to connect the 355 * vertical scrollbar to the child widget’s vertical scroll functionality. 356 * 357 * Return: the vertical #GtkAdjustment 358 */ 359 public Adjustment getVadjustment() 360 { 361 auto p = gtk_scrolled_window_get_vadjustment(gtkScrolledWindow); 362 363 if(p is null) 364 { 365 return null; 366 } 367 368 return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p); 369 } 370 371 /** 372 * Returns the vertical scrollbar of @scrolled_window. 373 * 374 * Return: the vertical scrollbar of the scrolled window. 375 * 376 * Since: 2.8 377 */ 378 public Widget getVscrollbar() 379 { 380 auto p = gtk_scrolled_window_get_vscrollbar(gtkScrolledWindow); 381 382 if(p is null) 383 { 384 return null; 385 } 386 387 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 388 } 389 390 /** 391 * Changes the behaviour of @scrolled_window wrt. to the initial 392 * event that possibly starts kinetic scrolling. When @capture_button_press 393 * is set to %TRUE, the event is captured by the scrolled window, and 394 * then later replayed if it is meant to go to the child widget. 395 * 396 * This should be enabled if any child widgets perform non-reversible 397 * actions on #GtkWidget::button-press-event. If they don't, and handle 398 * additionally handle #GtkWidget::grab-broken-event, it might be better 399 * to set @capture_button_press to %FALSE. 400 * 401 * This setting only has an effect if kinetic scrolling is enabled. 402 * 403 * Params: 404 * captureButtonPress = %TRUE to capture button presses 405 * 406 * Since: 3.4 407 */ 408 public void setCaptureButtonPress(bool captureButtonPress) 409 { 410 gtk_scrolled_window_set_capture_button_press(gtkScrolledWindow, captureButtonPress); 411 } 412 413 /** 414 * Sets the #GtkAdjustment for the horizontal scrollbar. 415 * 416 * Params: 417 * hadjustment = horizontal scroll adjustment 418 */ 419 public void setHadjustment(Adjustment hadjustment) 420 { 421 gtk_scrolled_window_set_hadjustment(gtkScrolledWindow, (hadjustment is null) ? null : hadjustment.getAdjustmentStruct()); 422 } 423 424 /** 425 * Turns kinetic scrolling on or off. 426 * Kinetic scrolling only applies to devices with source 427 * %GDK_SOURCE_TOUCHSCREEN. 428 * 429 * Params: 430 * kineticScrolling = %TRUE to enable kinetic scrolling 431 * 432 * Since: 3.4 433 */ 434 public void setKineticScrolling(bool kineticScrolling) 435 { 436 gtk_scrolled_window_set_kinetic_scrolling(gtkScrolledWindow, kineticScrolling); 437 } 438 439 /** 440 * Sets the minimum height that @scrolled_window should keep visible. 441 * Note that this can and (usually will) be smaller than the minimum 442 * size of the content. 443 * 444 * Params: 445 * height = the minimal content height 446 * 447 * Since: 3.0 448 */ 449 public void setMinContentHeight(int height) 450 { 451 gtk_scrolled_window_set_min_content_height(gtkScrolledWindow, height); 452 } 453 454 /** 455 * Sets the minimum width that @scrolled_window should keep visible. 456 * Note that this can and (usually will) be smaller than the minimum 457 * size of the content. 458 * 459 * Params: 460 * width = the minimal content width 461 * 462 * Since: 3.0 463 */ 464 public void setMinContentWidth(int width) 465 { 466 gtk_scrolled_window_set_min_content_width(gtkScrolledWindow, width); 467 } 468 469 /** 470 * Enables or disables overlay scrolling for this scrolled window. 471 * 472 * Params: 473 * overlayScrolling = whether to enable overlay scrolling 474 * 475 * Since: 3.16 476 */ 477 public void setOverlayScrolling(bool overlayScrolling) 478 { 479 gtk_scrolled_window_set_overlay_scrolling(gtkScrolledWindow, overlayScrolling); 480 } 481 482 /** 483 * Sets the placement of the contents with respect to the scrollbars 484 * for the scrolled window. 485 * 486 * The default is %GTK_CORNER_TOP_LEFT, meaning the child is 487 * in the top left, with the scrollbars underneath and to the right. 488 * Other values in #GtkCornerType are %GTK_CORNER_TOP_RIGHT, 489 * %GTK_CORNER_BOTTOM_LEFT, and %GTK_CORNER_BOTTOM_RIGHT. 490 * 491 * See also gtk_scrolled_window_get_placement() and 492 * gtk_scrolled_window_unset_placement(). 493 * 494 * Params: 495 * windowPlacement = position of the child window 496 */ 497 public void setPlacement(GtkCornerType windowPlacement) 498 { 499 gtk_scrolled_window_set_placement(gtkScrolledWindow, windowPlacement); 500 } 501 502 /** 503 * Sets the scrollbar policy for the horizontal and vertical scrollbars. 504 * 505 * The policy determines when the scrollbar should appear; it is a value 506 * from the #GtkPolicyType enumeration. If %GTK_POLICY_ALWAYS, the 507 * scrollbar is always present; if %GTK_POLICY_NEVER, the scrollbar is 508 * never present; if %GTK_POLICY_AUTOMATIC, the scrollbar is present only 509 * if needed (that is, if the slider part of the bar would be smaller 510 * than the trough — the display is larger than the page size). 511 * 512 * Params: 513 * hscrollbarPolicy = policy for horizontal bar 514 * vscrollbarPolicy = policy for vertical bar 515 */ 516 public void setPolicy(GtkPolicyType hscrollbarPolicy, GtkPolicyType vscrollbarPolicy) 517 { 518 gtk_scrolled_window_set_policy(gtkScrolledWindow, hscrollbarPolicy, vscrollbarPolicy); 519 } 520 521 /** 522 * Changes the type of shadow drawn around the contents of 523 * @scrolled_window. 524 * 525 * Params: 526 * type = kind of shadow to draw around scrolled window contents 527 */ 528 public void setShadowType(GtkShadowType type) 529 { 530 gtk_scrolled_window_set_shadow_type(gtkScrolledWindow, type); 531 } 532 533 /** 534 * Sets the #GtkAdjustment for the vertical scrollbar. 535 * 536 * Params: 537 * vadjustment = vertical scroll adjustment 538 */ 539 public void setVadjustment(Adjustment vadjustment) 540 { 541 gtk_scrolled_window_set_vadjustment(gtkScrolledWindow, (vadjustment is null) ? null : vadjustment.getAdjustmentStruct()); 542 } 543 544 /** 545 * Unsets the placement of the contents with respect to the scrollbars 546 * for the scrolled window. If no window placement is set for a scrolled 547 * window, it defaults to %GTK_CORNER_TOP_LEFT. 548 * 549 * See also gtk_scrolled_window_set_placement() and 550 * gtk_scrolled_window_get_placement(). 551 * 552 * Since: 2.10 553 */ 554 public void unsetPlacement() 555 { 556 gtk_scrolled_window_unset_placement(gtkScrolledWindow); 557 } 558 559 int[string] connectedSignals; 560 561 void delegate(GtkPositionType, ScrolledWindow)[] onEdgeOvershotListeners; 562 /** 563 * The ::edge-overshot signal is emitted whenever user initiated scrolling 564 * makes the scrolledwindow firmly surpass (ie. with some edge resistance) 565 * the lower or upper limits defined by the adjustment in that orientation. 566 * 567 * A similar behavior without edge resistance is provided by the 568 * #GtkScrolledWindow::edge-reached signal. 569 * 570 * Note: The @pos argument is LTR/RTL aware, so callers should be aware too 571 * if intending to provide behavior on horizontal edges. 572 * 573 * Params: 574 * pos = edge side that was hit 575 * 576 * Since: 3.16 577 */ 578 void addOnEdgeOvershot(void delegate(GtkPositionType, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 579 { 580 if ( "edge-overshot" !in connectedSignals ) 581 { 582 Signals.connectData( 583 this, 584 "edge-overshot", 585 cast(GCallback)&callBackEdgeOvershot, 586 cast(void*)this, 587 null, 588 connectFlags); 589 connectedSignals["edge-overshot"] = 1; 590 } 591 onEdgeOvershotListeners ~= dlg; 592 } 593 extern(C) static void callBackEdgeOvershot(GtkScrolledWindow* scrolledwindowStruct, GtkPositionType pos, ScrolledWindow _scrolledwindow) 594 { 595 foreach ( void delegate(GtkPositionType, ScrolledWindow) dlg; _scrolledwindow.onEdgeOvershotListeners ) 596 { 597 dlg(pos, _scrolledwindow); 598 } 599 } 600 601 void delegate(GtkPositionType, ScrolledWindow)[] onEdgeReachedListeners; 602 /** 603 * The ::edge-reached signal is emitted whenever user-initiated scrolling 604 * makes the scrolledwindow exactly reaches the lower or upper limits 605 * defined by the adjustment in that orientation. 606 * 607 * A similar behavior with edge resistance is provided by the 608 * #GtkScrolledWindow::edge-overshot signal. 609 * 610 * Note: The @pos argument is LTR/RTL aware, so callers should be aware too 611 * if intending to provide behavior on horizontal edges. 612 * 613 * Params: 614 * pos = edge side that was reached 615 * 616 * Since: 3.16 617 */ 618 void addOnEdgeReached(void delegate(GtkPositionType, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 619 { 620 if ( "edge-reached" !in connectedSignals ) 621 { 622 Signals.connectData( 623 this, 624 "edge-reached", 625 cast(GCallback)&callBackEdgeReached, 626 cast(void*)this, 627 null, 628 connectFlags); 629 connectedSignals["edge-reached"] = 1; 630 } 631 onEdgeReachedListeners ~= dlg; 632 } 633 extern(C) static void callBackEdgeReached(GtkScrolledWindow* scrolledwindowStruct, GtkPositionType pos, ScrolledWindow _scrolledwindow) 634 { 635 foreach ( void delegate(GtkPositionType, ScrolledWindow) dlg; _scrolledwindow.onEdgeReachedListeners ) 636 { 637 dlg(pos, _scrolledwindow); 638 } 639 } 640 641 void delegate(GtkDirectionType, ScrolledWindow)[] onMoveFocusOutListeners; 642 /** 643 * The ::move-focus-out signal is a 644 * [keybinding signal][GtkBindingSignal] which gets 645 * emitted when focus is moved away from the scrolled window by a 646 * keybinding. The #GtkWidget::move-focus signal is emitted with 647 * @direction_type on this scrolled windows toplevel parent in the 648 * container hierarchy. The default bindings for this signal are 649 * `Tab + Ctrl` and `Tab + Ctrl + Shift`. 650 * 651 * Params: 652 * directionType = either %GTK_DIR_TAB_FORWARD or 653 * %GTK_DIR_TAB_BACKWARD 654 */ 655 void addOnMoveFocusOut(void delegate(GtkDirectionType, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 656 { 657 if ( "move-focus-out" !in connectedSignals ) 658 { 659 Signals.connectData( 660 this, 661 "move-focus-out", 662 cast(GCallback)&callBackMoveFocusOut, 663 cast(void*)this, 664 null, 665 connectFlags); 666 connectedSignals["move-focus-out"] = 1; 667 } 668 onMoveFocusOutListeners ~= dlg; 669 } 670 extern(C) static void callBackMoveFocusOut(GtkScrolledWindow* scrolledwindowStruct, GtkDirectionType directionType, ScrolledWindow _scrolledwindow) 671 { 672 foreach ( void delegate(GtkDirectionType, ScrolledWindow) dlg; _scrolledwindow.onMoveFocusOutListeners ) 673 { 674 dlg(directionType, _scrolledwindow); 675 } 676 } 677 678 bool delegate(GtkScrollType, bool, ScrolledWindow)[] onScrollChildListeners; 679 /** 680 * The ::scroll-child signal is a 681 * [keybinding signal][GtkBindingSignal] 682 * which gets emitted when a keybinding that scrolls is pressed. 683 * The horizontal or vertical adjustment is updated which triggers a 684 * signal that the scrolled windows child may listen to and scroll itself. 685 * 686 * Params: 687 * scroll = a #GtkScrollType describing how much to scroll 688 * horizontal = whether the keybinding scrolls the child 689 * horizontally or not 690 */ 691 void addOnScrollChild(bool delegate(GtkScrollType, bool, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 692 { 693 if ( "scroll-child" !in connectedSignals ) 694 { 695 Signals.connectData( 696 this, 697 "scroll-child", 698 cast(GCallback)&callBackScrollChild, 699 cast(void*)this, 700 null, 701 connectFlags); 702 connectedSignals["scroll-child"] = 1; 703 } 704 onScrollChildListeners ~= dlg; 705 } 706 extern(C) static int callBackScrollChild(GtkScrolledWindow* scrolledwindowStruct, GtkScrollType scroll, bool horizontal, ScrolledWindow _scrolledwindow) 707 { 708 foreach ( bool delegate(GtkScrollType, bool, ScrolledWindow) dlg; _scrolledwindow.onScrollChildListeners ) 709 { 710 if ( dlg(scroll, horizontal, _scrolledwindow) ) 711 { 712 return 1; 713 } 714 } 715 716 return 0; 717 } 718 }