{"size": 1412, "ext": "js", "max_stars_repo_path": "src/runtime/Gtk3/elements/scrolled-window.js", "max_stars_repo_name": "subjectdenied/vuido", "max_stars_repo_stars_event_min_datetime": "2019-09-25T16:33:56.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-28T21:29:30.000Z", "max_issues_repo_path": "src/runtime/Gtk3/elements/scrolled-window.js", "max_issues_repo_name": "subjectdenied/vuido", "max_issues_repo_issues_event_min_datetime": "2019-05-31T12:25:08.000Z", "max_issues_repo_issues_event_max_datetime": "2019-06-02T17:03:44.000Z", "max_forks_repo_path": "src/runtime/Gtk3/elements/scrolled-window.js", "max_forks_repo_name": "subjectdenied/vue-gnome", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": 14, "max_forks_count": null, "avg_line_length": 24.3448275862, "max_line_length": 52, "alphanum_fraction": 0.6614730878}
import Gtk from '../../gtk';

import { Widget } from './widget'

export class ScrolledWindow extends Widget {
  _getDefaultAttributes() {
    return {
      //hadjustment: null,
      hscrollbarPolicy: Gtk.PolicyType.AUTOMATIC,
      kineticScrolling: true,
      maxContentHeight: -1,
      maxContentWidth: -1,
      minContentHeight: -1,
      minContentWidth: -1,
      overlayScrolling: true,
      propagateNaturalHeight: false,
      propagateNaturalWidth: false,
      //shadowType: Gtk.ShadowType.NONE,
      //vadjustment: null,
      vscrollbarPolicy: Gtk.PolicyType.AUTOMATIC,
      windowPlacement: Gtk.PositionType.TOP_LEFT
    }
  }

  _createWidget() {
    this.widget = new Gtk.ScrolledWindow(null, null)
    this.widget.show()
  }

  _initializeWidgetAttributes() {
    super._initializeWidgetAttributes();
    this.widget.show()
  }

  _appendWidget( childNode ) {
    if (super._appendWidget(childNode)) return
    this.widget.add(childNode.widget);
  }

  _removeWidget( childNode ) {
    this.widget.remove(childNode.widget);
  }

  _setWidgetAttribute( key, value ) {
    if (this.widget === null) return
    if (typeof this.widget[key] !== 'undefined') {
      console.log(this.tagName, key, value)
      this.widget[key] = value
    } else {
      super._setWidgetAttribute(key, value)
    }
  }

  _setWidgetHandler( event, handler ) {
    super._setWidgetHandler(event, handler)
  }
}
