ctk

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 23 Imported by: 10

README

Go-Curses

Made with Go Go documentation

CTK - Curses Tool Kit

Golang package to provide an advanced terminal user interface with a GTK inspired API, built upon CDK.

Notice

This project should not be used for any purpose other than intellectual curiosity. This status is reflected in the tagged versioning of this trunk branch, v0.1.x, ie: entirely experimental and unfinished in any sense of the word "done".

Getting Started

CTK is a Go module and as such can be used in any of the typical Golang ways.

Prerequisites

Go v1.16 (or later) is required in order to build and use the package. Beyond that, there aren't any other dependencies. Visit: https://golang.org/doc/install for installation instructions.

Installing

CTK uses the Go mod system and is installed in any of the usual ways.

$ go get -u github.com/go-curses/ctk/...
Programming Hello World in CTK

The following application will display a window with "Hello World" as the title, containing a button centered nicely that when pressed will exit the application nicely.

package main

import (
  "os"

  "github.com/go-curses/cdk"
  "github.com/go-curses/cdk/lib/enums"
  "github.com/go-curses/cdk/log"
  "github.com/go-curses/ctk"
)

func main() {
  // Construct a new CDK application
  app := cdk.NewApp(
    // program binary name
    "hello-world",
    // usage summary
    "Simple Hello World example for CTK",
    // description
    "A simple terminal program written using the Curses Tool Kit",
    // because versioning is important
    "0.0.1",
    // used in logs, internal debugging, etc
    "helloWorld",
    // used where human-readable titles are necessary
    "Hello World",
    // the TTY device to use, /dev/tty is the default
    "/dev/tty",
    // initialize the user-interface
    func(d cdk.Display) error {
      // tell the display to listen for CTRL+C and interrupt gracefully
      d.CaptureCtrlC()
      // create a new window, give it a human-readable title
      w := ctk.NewWindowWithTitle("Hello World")
      // get the vertical box for the content area of the window
      vbox := w.GetVBox()
      // here is where we add other widgets and such to implement the
      // desired user interface elements, in this case we want a nice
      // button in the middle of the window. One way to do this is to
      // use an Alignment widget to place the button neatly for us.
      align := ctk.MakeAlignment()
      // the alignment scales are from 0 (left) to 1 (right) with the 0.5
      // being centered
      align.Set(0.5, 0.5, 0.0, 0.0)
      // a nice button for us to press
      button := ctk.NewButtonWithLabel("Curses<u><i>!</i></u>")
      button.SetUseMarkup(true)    // enable markup in the label
      button.SetSizeRequest(11, 3) // request a certain size
      // make the button quit the application when activated by connecting
      // a handler to the button's activate signal
      button.Connect(
        ctk.SignalActivate,
        "hello-button-handle",
        func(data []interface{}, argv ...interface{}) enums.EventFlag {
          d.RequestQuit() // ask the display to exit nicely
          return enums.EVENT_STOP
        },
      )
      align.Add(button) // add the button to the alignment
      // finally adding the alignment to the window's content area by
      // packing them into the window's vertical box
      vbox.PackStart(align, true /*expand*/, true /*fill*/, 0 /*padding*/)
      // tell CTK that the window and its contents are to be drawn upon
      // the terminal display, this effectively calls Show() on the vbox,
      // alignment and button
      w.ShowAll()
      // tell CDK that this window is the foreground window
      d.SetActiveWindow(w)
      // add a quit handler to say goodbye when the program exits
      d.AddQuitHandler(
        "hello-world-quit-handler",
        func() {
          // Note that the Display and other CTK things are no longer
          // functional at this point.
          fmt.Println("Hello World says Goodbye!")
          // Logging however still works.
          log.InfoF("Hello World logging goodbye!")
        },
      )
      // no errors to report, nil to proceed
      return nil
    },
  )
  // run the application, handing over the command-line arguments received
  if err := app.Run(os.Args); err != nil {
    // doesn't have to be a Fatal exit
    log.Fatal(err)
  }
  // end of program
}

Compile the hello-world.go source file.

$ go build examples/hello-world/hello-world.go

View the command-line help:

$ ./hello-world -h
NAME:
   hello-world - hello-world

USAGE:
   hello-world [global options] command [command options] [arguments...]

VERSION:
   0.0.1

DESCRIPTION:
   the most basic CTK application

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h, --usage  display command-line usage information (default: false)
   --version            display the version (default: false)

Run the program:

$ ./hello-world

hello-world screenshot

Pressing the Curses! button will exit the program and print the quit message to the terminal, which should have cleanly cleared the screen and restored the terminal to shell control again.

Commands

CTK includes a number of command programs for the purpose of enabling a better developer experience or as a means of having a necessity in creating new widgets and features.

go-dialog

go-dialog is a dialog replacement, fully implemented in CTK and takes advantage of Glade interface files for implementing the user interface.

Installation
$ go install github.com/go-curses/ctk/cmd/go-dialog
Usage
$ ./go-dialog --help
NAME:
   go-dialog - display dialog boxes from shell scripts

USAGE:
   go-dialog [global options] command [command options] [arguments...]

VERSION:
   0.0.1

COMMANDS:
   msgbox   display a message with an OK button, each string following msgbox is a new line and concatenated into the message
   yesno    display a yes/no prompt with a message (see msgbox)
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --title value                     specify the dialog title text
   --print-maxsize                   print the width and height on stdout and exit (default: false)
   --back-title value                specify the window title text
   --help, -h, --usage               display command-line usage information (default: false)
   --version                         display the version (default: false)
Example

Display a message-box dialog (with the title of "Hello Dialog"), centered on top of a full-screen window (with the title "Hello Window"), displaying a message of "This is the message" and presenting a single button labelled "OK".

$ ./go-dialog \
   --back-title "Hello Window" \
   --title "Hello Dialog" \
   msgbox \
   "This is the message."

go-dialog screenshot

go-charmap

This is a simple character-set viewer called go-charmap.

Installation
$ go install github.com/go-curses/ctk/cmd/go-charmap
Usage
$ ./go-charmap --help
NAME:
   go-charmap - View the details of a character

USAGE:
   go-charmap [integer]

VERSION:
   0.0.1

DESCRIPTION:
   Get informational details for a specific character given in integer form.

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h, --usage  display command-line usage information (default: false)
   --version            display the version (default: false)

Example

Display information on the current terminal settings.

$ go-charmap

go-charmap screenshot

Display information on the lowercase sigma character.

$ go-charmap 1010

go-charmap 1010 screenshot

go-ctk

This is a weird one. go-ctk can do a number of things related to working on the CTK project, some useful for normal developers. Particularly the glade option, so that's the one we're going to talk about here.

The glade option for go-ctk enables the developer to test their Glade interface files outside of their normal codebase, as a means of validating whether their problems are in their code or with how CTK is handling the Glade files.

For those not aware, Glade is the formal way to design user interfaces for actual GTK applications. Given that CTK is a curses implementation of GTK, it supports loading widgets and such from Glade interface files.

There are of course all sorts of undocumented and unknown caveats to the support of Glade and all it's configurable features at this time. It is an objective of CTK to formally support Glade as much as sensibly possible.

Usage
$ ./go-ctk help glade
NAME:
   go-ctk glade - preview glade interfaces

USAGE:
   go-ctk glade [command options] [arguments...]

DESCRIPTION:
   load the given .glade file and preview in CTK

OPTIONS:
   --window value, -W value   specify a named (glade "id" attribute) window to preview (default: main-window)
   --dialog value, -D value   specify a named (glade "id" attribute) dialog to preview (default: main-dialog)
   --no-dialog-transient, -n  when rendering ctk.Dialog types, do not set the transient-for to a default window and use the dialog itself as a top-level window (default: false)
Example

There are two example glade files in the examples directory. This example command will load the builder-dialog.glade file and if all is working as it should, display a window with a dialog containing some lorem ipsum text and two buttons, a yes and a no.

For this to work however, it's important to note that within glade we need to set the id on the window and dialog objects. go-ctk defaults to "main-window" and "main-dialog", which the example files use. That's the purpose to the --window and --dialog command-line options.

$ ./go-ctk glade ./examples/builder-dialog.glade

go-ctk glade screenshot

Pressing either of the buttons will exit the viewer and print out which button was pressed.

button pressed: ctk-button-2194440b-86b2-4386-a5a1-984bfec916e6 "Yes"

Running the unit tests

Normal go testing mechanics work.

$ go test -v
=== RUN   TestAdjustment

  ... (per-test output, trimmed for brevity) ...

--- PASS: TestWidget (0.00s)
PASS
ok  	github.com/go-curses/ctk	(0.018s)

Makefile

Included is a Makefile that has a number of useful build targets, as shown in the usage help text.

$ make help
usage: make [target]

qa targets:
  vet         - run go vet command
  test        - perform all available tests
  cover       - perform all available tests with coverage report

cleanup targets:
  clean       - cleans package and built files
  clean-logs  - cleans *.log from the project

go.mod helpers:
  local       - add go.mod local CDK package replacements
  unlocal     - remove go.mod local CDK package replacements

build targets:
  examples    - builds all examples
  build       - build the go-ctk command
  build-all   - build all commands
  dev         - build demo-app with profiling

run targets:
  run         - run the dev build (sanely handle crashes)
  profile.cpu - run the dev build and profile CPU
  profile.mem - run the dev build and profile memory

Versioning

The current API is unstable and subject to change dramatically.

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details.

Acknowledgments

  • Thanks to TCell for providing a solid and robust platform to build upon
  • Thanks to the GTK Team for developing and maintaining the GTK API that CTK is modeled after

Documentation

Overview

Package ctk is a curses-based graphical user interface library modeled after the GTK API.

The purpose of this project is to provide a similar API to the actual GTK project and instead of interacting with an X11 server, the Curses Tool Kit interacts with a terminal display, managed by the Curses Development Kit.

CTK Type Hierarchy

Object
  |- Adjustment
  `- Widget
     |- Container
     |  |- Bin
     |  |  |- Button
     |  |  |- EventBox
     |  |  |- Frame
     |  |  |- Viewport
     |  |  |  `- ScrolledViewport
     |  |  `- Window
     |  |     `- Dialog
     |  `- Box
     |     |- HBox
     |     |- VBox
     |     `- ButtonBox
     |        |- HButtonBox
     |        `- VButtonBox
     |- Misc
     |  |- Arrow
     |  `- Label
     |- Range
     |  |- Scale
     |  |  |- HScale
     |  |  `- VScale
     |  `- Scrollbar
     |     |- HScrollbar
     |     `- VScrollbar
     `- Sensitive

Index

Constants

View Source
const (
	ANCHOR_CENTER AnchorType = iota
	ANCHOR_NORTH
	ANCHOR_NORTH_WEST
	ANCHOR_NORTH_EAST
	ANCHOR_SOUTH
	ANCHOR_SOUTH_WEST
	ANCHOR_SOUTH_EAST
	ANCHOR_WEST
	ANCHOR_EAST
	ANCHOR_N  = ANCHOR_NORTH
	ANCHOR_NW = ANCHOR_NORTH_WEST
	ANCHOR_NE = ANCHOR_NORTH_EAST
	ANCHOR_S  = ANCHOR_SOUTH
	ANCHOR_SW = ANCHOR_SOUTH_WEST
	ANCHOR_SE = ANCHOR_SOUTH_EAST
	ANCHOR_W  = ANCHOR_WEST
	ANCHOR_E  = ANCHOR_EAST
)
View Source
const (
	SignalAllocation        cdk.Signal = "allocation"
	SignalCancelEvent       cdk.Signal = "cancel-event"
	SignalCdkEvent          cdk.Signal = "cdk-event"
	SignalDraw              cdk.Signal = cdk.SignalDraw
	SignalError             cdk.Signal = "error"
	SignalEventKey          cdk.Signal = "key-event"
	SignalEventMouse        cdk.Signal = "mouse-event"
	SignalGainedEventFocus  cdk.Signal = "gained-event-focus"
	SignalGainedFocus       cdk.Signal = "gained-focus"
	SignalGrabEventFocus    cdk.Signal = "grab-event-focus"
	SignalHomogeneous       cdk.Signal = "homogeneous"
	SignalInvalidate        cdk.Signal = "invalidate"
	SignalLostEventFocus    cdk.Signal = "lost-event-focus"
	SignalLostFocus         cdk.Signal = "lost-focus"
	SignalName              cdk.Signal = "name"
	SignalOrigin            cdk.Signal = "origin"
	SignalPackEnd           cdk.Signal = "pack-end"
	SignalPackStart         cdk.Signal = "pack-start"
	SignalReleaseEventFocus cdk.Signal = "set-event-focus"
	SignalReorderChild      cdk.Signal = "reorder-child"
	SignalReparent          cdk.Signal = "reparent"
	SignalResize            cdk.Signal = "resize"
	SignalSetEventFocus     cdk.Signal = "set-event-focus"
	SignalSetFlags          cdk.Signal = "set-flags"
	SignalSetParent         cdk.Signal = "set-parent"
	SignalSetProperty       cdk.Signal = cdk.SignalSetProperty
	SignalSetSensitive      cdk.Signal = "set-sensitive"
	SignalSetSizeRequest    cdk.Signal = "set-size-request"
	SignalSetState          cdk.Signal = "set-state"
	SignalSetTheme          cdk.Signal = "set-theme"
	SignalSetThemeRequest   cdk.Signal = "set-theme-request"
	SignalSetWindow         cdk.Signal = "set-window"
	SignalShowAll           cdk.Signal = "show-all"
	SignalSpacing           cdk.Signal = "spacing"
	SignalTextDirection     cdk.Signal = "text-direction"
	SignalUnparent          cdk.Signal = "unparent"
	SignalUnsetFlags        cdk.Signal = "unset-flags"
	SignalUnsetState        cdk.Signal = "unset-state"
)
View Source
const AlignmentDrawHandle = "alignment-draw-handler"
View Source
const AlignmentEventResizeHandle = "alignment-event-resize-handler"
View Source
const AlignmentGainedFocusHandle = "alignment-gained-focus-handler"
View Source
const AlignmentInvalidateHandler = "alignment-invalidate-handler"
View Source
const AlignmentLostFocusHandle = "alignment-lost-focus-handler"
View Source
const ArrowDrawHandle = "arrow-draw-handler"
View Source
const BoxChildHideHandle = "box-child-hide-handler"
View Source
const BoxChildShowHandle = "box-child-show-handler"
View Source
const BoxDrawHandle = "box-draw-handler"
View Source
const BoxInvalidateHandle = "box-invalidate-handler"
View Source
const BoxResizeHandle = "box-resize-handler"
View Source
const ButtonBoxDrawHandle = "button-box-draw-handler"
View Source
const ButtonCdkEventHandle = "button-cdk-event-handler"
View Source
const ButtonDrawHandle = "button-draw-handler"
View Source
const ButtonInvalidateHandle = "button-invalidate-handler"
View Source
const ButtonResizeHandle = "button-resize-handler"
View Source
const ButtonSetPropertyHandle = "button-set-property-handler"
View Source
const ContainerGainedFocusHandle = "container-gained-focus-handler"
View Source
const ContainerLostFocusHandle = "container-lost-focus-handler"
View Source
const CssPropertyBackgroundColor cdk.Property = "background-color"
View Source
const CssPropertyBackgroundFillContent cdk.Property = "background-fill-content"
View Source
const CssPropertyBlink cdk.Property = "blink"
View Source
const CssPropertyBold cdk.Property = "bold"
View Source
const CssPropertyBorder cdk.Property = "border"
View Source
const CssPropertyBorderBackgroundColor cdk.Property = "border-background-color"
View Source
const CssPropertyBorderBottomContent cdk.Property = "border-bottom-content"
View Source
const CssPropertyBorderBottomLeftContent cdk.Property = "border-bottom-left-content"
View Source
const CssPropertyBorderBottomRightContent cdk.Property = "border-bottom-right-content"
View Source
const CssPropertyBorderColor cdk.Property = "border-color"
View Source
const CssPropertyBorderLeftContent cdk.Property = "border-left-content"
View Source
const CssPropertyBorderRightContent cdk.Property = "border-right-content"
View Source
const CssPropertyBorderTopContent cdk.Property = "border-top-content"
View Source
const CssPropertyBorderTopLeftContent cdk.Property = "border-top-left-content"
View Source
const CssPropertyBorderTopRightContent cdk.Property = "border-top-right-content"
View Source
const CssPropertyClass cdk.Property = "class"
View Source
const CssPropertyColor cdk.Property = "color"
View Source
const CssPropertyDim cdk.Property = "dim"
View Source
const CssPropertyHeight cdk.Property = "height"
View Source
const CssPropertyItalic cdk.Property = "italic"
View Source
const CssPropertyReverse cdk.Property = "reverse"
View Source
const CssPropertyStrike cdk.Property = "strike"
View Source
const CssPropertyUnderline cdk.Property = "underline"
View Source
const CssPropertyWidth cdk.Property = "width"
View Source
const DialogActivateHandle = "dialog-activate-handler"
View Source
const DialogDrawHandle = "dialog-draw-handler"
View Source
const DialogEventHandle = "dialog-event-handler"
View Source
const DialogInvalidateHandle = "dialog-invalidate-handler"
View Source
const DialogResizeHandle = "dialog-resize-handler"
View Source
const DialogResponseHandle = "dialog-response-handler"
View Source
const FrameChildGainedFocusHandle = "frame-child-gained-focus-handler"
View Source
const FrameChildLostFocusHandle = "frame-child-lost-focus-handler"
View Source
const FrameDrawHandle = "frame-draw-handler"
View Source
const FrameInvalidateHandle = "frame-invalidate-handler"
View Source
const FrameResizeHandle = "frame-resize-handler"
View Source
const LabelDrawHandle = "label-draw-handler"
View Source
const LabelInvalidateHandle = "label-invalidate-handler"
View Source
const LabelResizeHandle = "label-resize-handler"
View Source
const PropertyAboveChild cdk.Property = "above-child"

Whether the event-trapping window of the eventbox is above the window of the child widget as opposed to below it. Flags: Read / Write Default value: FALSE

View Source
const PropertyAcceptFocus cdk.Property = "accept-focus"

Whether the window should receive the input focus. Flags: Read / Write Default value: TRUE

View Source
const PropertyAdjustment cdk.Property = "adjustment"

The Adjustment that contains the current value of this range object. Flags: Read / Write / Construct

View Source
const PropertyAppPaintable cdk.Property = "app-paintable"

Whether the application will paint directly on the widget. Flags: Read / Write Default value: FALSE

View Source
const PropertyArrowShadowType cdk.Property = "shadow-type"

Appearance of the shadow surrounding the arrow. Flags: Read / Write Default value: GTK_SHADOW_OUT

View Source
const PropertyArrowType cdk.Property = "arrow-type"

The direction the arrow should point. Flags: Read / Write Default value: GTK_ARROW_RIGHT

View Source
const PropertyAttributes cdk.Property = "attributes"

A list of style attributes to apply to the text of the label. Flags: Read / Write

View Source
const PropertyBorderWidth cdk.Property = "border-width"

The width of the empty border outside the containers children. Flags: Read / Write Allowed values: <= 65535 Default value: 0

View Source
const PropertyBottomPadding cdk.Property = "bottom-padding"

The padding to insert at the bottom of the widget. Flags: Read / Write Allowed values: <= G_MAXINT Default value: 0

View Source
const PropertyBoxChildExpand cdk.Property = "box-child--expand"
View Source
const PropertyBoxChildFill cdk.Property = "box-child--fill"
View Source
const PropertyBoxChildPackType cdk.Property = "box-child--pack-type"
View Source
const PropertyBoxChildPadding cdk.Property = "box-child--padding"
View Source
const PropertyButtonLabel cdk.Property = "label"

Text of the label widget inside the button, if the button contains a label widget. Flags: Read / Write / Construct Default value: NULL

View Source
const PropertyCanDefault cdk.Property = "can-default"

Whether the widget can be the default widget. Flags: Read / Write Default value: FALSE

View Source
const PropertyCanFocus cdk.Property = "can-focus"

Whether the widget can accept the input focus. Flags: Read / Write Default value: FALSE

View Source
const PropertyChild cdk.Property = "child"

Can be used to add a new child to the container. Flags: Write

View Source
const PropertyCompositeChild cdk.Property = "composite-child"

Whether the widget is part of a composite widget. Flags: Read Default value: FALSE

View Source
const PropertyCursorPosition cdk.Property = "cursor-position"

The current position of the insertion cursor in chars. Flags: Read Allowed values: >= 0 Default value: 0

View Source
const PropertyDebug cdk.Property = cdk.PropertyDebug
View Source
const PropertyDebugChildren cdk.Property = "debug-children"
View Source
const PropertyDecorated cdk.Property = "decorated"

Whether the window should be decorated by the window manager. Flags: Read / Write Default value: TRUE

View Source
const PropertyDefaultHeight cdk.Property = "default-height"

The default height of the window, used when initially showing the window. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyDefaultWidth cdk.Property = "default-width"

The default width of the window, used when initially showing the window. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyDeletable cdk.Property = "deletable"

Whether the window frame should have a close button. Flags: Read / Write Default value: TRUE

View Source
const PropertyDestroyWithParent cdk.Property = "destroy-with-parent"

If this window should be destroyed when the parent is destroyed. Flags: Read / Write Default value: FALSE

View Source
const PropertyDoubleBuffered cdk.Property = "double-buffered"

Whether or not the widget is double buffered. Flags: Read / Write Default value: TRUE

View Source
const PropertyEllipsize cdk.Property = "ellipsize"

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string, specified as a bool. Flags: Read / Write Default value: false

View Source
const PropertyEvents cdk.Property = "events"

The event mask that decides what kind of Events this widget gets. Flags: Read / Write Default value: GDK_STRUCTURE_MASK

View Source
const PropertyExtensionEvents cdk.Property = "extension-events"

The mask that decides what kind of extension events this widget gets. Flags: Read / Write Default value: GDK_EXTENSION_EVENTS_NONE

View Source
const PropertyFillLevel cdk.Property = "fill-level"

The fill level (e.g. prebuffering of a network stream). See SetFillLevel. Flags: Read / Write Default value: 1.79769e+308

View Source
const PropertyFocusOnClick cdk.Property = "focus-on-click"

Whether the button grabs focus when it is clicked with the mouse. Flags: Read / Write Default value: TRUE

View Source
const PropertyFocusOnMap cdk.Property = "focus-on-map"

Whether the window should receive the input focus when mapped. Flags: Read / Write Default value: TRUE

View Source
const PropertyGravity cdk.Property = "gravity"

The window gravity of the window. See Move and Gravity for more details about window gravity. Flags: Read / Write Default value: GDK_GRAVITY_NORTH_WEST

View Source
const PropertyHAdjustment cdk.Property = "h-adjustment"

The Adjustment for the horizontal position. Flags: Read / Write / Construct

View Source
const PropertyHScrollbarPolicy cdk.Property = "h-scrollbar-policy"

When the horizontal scrollbar is displayed. Flags: Read / Write Default value: GTK_POLICY_ALWAYS

View Source
const PropertyHandler cdk.Property = "handler"
View Source
const PropertyHasDefault cdk.Property = "has-default"

Whether the widget is the default widget. Flags: Read / Write Default value: FALSE

View Source
const PropertyHasFocus cdk.Property = "has-focus"

Whether the widget has the input focus. Flags: Read / Write Default value: FALSE

View Source
const PropertyHasTooltip cdk.Property = "has-tooltip"

Enables or disables the emission of query-tooltip on widget . A value of TRUE indicates that widget can have a tooltip, in this case the widget will be queried using query-tooltip to determine whether it will provide a tooltip or not. Note that setting this property to TRUE for the first time will change the event masks of the Windows of this widget to include leave-notify and motion-notify events. This cannot and will not be undone when the property is set to FALSE again. Flags: Read / Write Default value: FALSE

View Source
const PropertyHasToplevelFocus cdk.Property = "has-toplevel-focus"

Whether the input focus is within this Window. Flags: Read Default value: FALSE

View Source
const PropertyHeightRequest cdk.Property = "height-request"

Override for height request of the widget, or -1 if natural request should be used. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyHomogeneous cdk.Property = "homogeneous"

Whether the children should all be the same size. Flags: Read / Write Default value: FALSE

View Source
const PropertyID cdk.Property = "id"
View Source
const PropertyIcon cdk.Property = "icon"

Icon for this window. Flags: Read / Write

View Source
const PropertyIconName cdk.Property = "icon-name"

The :icon-name property specifies the name of the themed icon to use as the window icon. See IconTheme for more details. Flags: Read / Write Default value: NULL

View Source
const PropertyImage cdk.Property = "image"

Child widget to appear next to the button text. Flags: Read / Write

View Source
const PropertyImagePosition cdk.Property = "image-position"

The position of the image relative to the text inside the button. Flags: Read / Write Default value: GTK_POS_LEFT

View Source
const PropertyInverted cdk.Property = "inverted"

Invert direction slider moves to increase range value. Flags: Read / Write Default value: FALSE

View Source
const PropertyIsActive cdk.Property = "is-active"

Whether the toplevel is the current active window. Flags: Read Default value: FALSE

View Source
const PropertyIsFocus cdk.Property = "is-focus"

Whether the widget is the focus widget within the toplevel. Flags: Read / Write Default value: FALSE

View Source
const PropertyIsLocked cdk.Property = "is-locked"

Is the accel group locked. Flags: Read Default value: FALSE

View Source
const PropertyJustify cdk.Property = "justify"

The alignment of the lines in the text of the label relative to each other. This does NOT affect the alignment of the label within its allocation. See Misc::xAlign for that. Flags: Read / Write Default value: enums.JUSTIFY_LEFT

View Source
const PropertyLabel cdk.Property = "label"

The text of the label. Flags: Read / Write Default value: ""

View Source
const PropertyLabelUseUnderline cdk.Property = "use-underline"

If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key. Flags: Read / Write Default value: FALSE

View Source
const PropertyLabelWidget cdk.Property = "label-widget"

A widget to display in place of the usual frame label. Flags: Read / Write

View Source
const PropertyLabelXAlign cdk.Property = "label-x-align"

The horizontal alignment of the label. Flags: Read / Write Allowed values: [0,1] Default value: 0

View Source
const PropertyLabelYAlign cdk.Property = "label-y-align"

The vertical alignment of the label. Flags: Read / Write Allowed values: [0,1] Default value: 0.5

View Source
const PropertyLayoutStyle cdk.Property = "layout-style"

How to lay out the buttons in the box. Possible values are: default, spread, edge, start and end. Flags: Read / Write Default value: GTK_BUTTONBOX_DEFAULT_STYLE

View Source
const PropertyLeftPadding cdk.Property = "left-padding"

The padding to insert at the left of the widget. Flags: Read / Write Allowed values: <= G_MAXINT Default value: 0

View Source
const PropertyLower cdk.Property = "lower"

The minimum value of the adjustment. Flags: Read / Write Default value: 0

View Source
const PropertyLowerStepperSensitivity cdk.Property = "lower-stepper-sensitivity"

The sensitivity policy for the stepper that points to the adjustment's lower side. Flags: Read / Write Default value: GTK_SENSITIVITY_AUTO

View Source
const PropertyMaxWidthChars cdk.Property = "max-width-chars"

The desired maximum width of the label, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the label will request space for no more than the requested number of characters. If the “width-chars” property is set to a positive value, then the "max-width-chars" property is ignored. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyMnemonicKeyVal cdk.Property = "mnemonic-key-val"

The mnemonic accelerator key for this label. Flags: Read Default value: 16777215

View Source
const PropertyMnemonicWidget cdk.Property = "mnemonic-widget"

The widget to be activated when the label's mnemonic key is pressed. Flags: Read / Write

View Source
const PropertyMnemonicsVisible cdk.Property = "mnemonics-visible"

Whether mnemonics are currently visible in this window. Flags: Read / Write Default value: TRUE

View Source
const PropertyModal cdk.Property = "modal"

If TRUE, the window is modal (other windows are not usable while this one is up). Flags: Read / Write Default value: FALSE

View Source
const PropertyModifierMask cdk.Property = "modifier-mask"

Modifier Mask. Flags: Read Default value: GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK

View Source
const PropertyName cdk.Property = "name"

The name of the widget. Flags: Read / Write Default value: NULL

View Source
const PropertyNoShowAll cdk.Property = "no-show-all"

Whether ShowAll should not affect this widget. Flags: Read / Write Default value: FALSE

View Source
const PropertyOpacity cdk.Property = "opacity"

The requested opacity of the window. See SetOpacity for more details about window opacity. Flags: Read / Write Allowed values: [0,1] Default value: 1

View Source
const PropertyOrientation cdk.Property = "orientation"

The orientation of the orientable. Flags: Read / Write Default value: ORIENTATION_HORIZONTAL

View Source
const PropertyPageIncrement cdk.Property = "page-increment"

The page increment of the adjustment. Flags: Read / Write Default value: 0

View Source
const PropertyPageSize cdk.Property = "page-size"

The page size of the adjustment. Note that the page-size is irrelevant and should be set to zero if the adjustment is used for a simple scalar value, e.g. in a SpinButton. Flags: Read / Write Default value: 0

View Source
const PropertyParent cdk.Property = "parent"

The parent widget of this widget. Must be a Container widget. Flags: Read / Write

View Source
const PropertyReceivesDefault cdk.Property = "receives-default"

If TRUE, the widget will receive the default action when it is focused. Flags: Read / Write Default value: FALSE

View Source
const PropertyRelatedAction cdk.Property = "related-action"

The action that this activatable will activate and receive updates from for various states and possibly appearance. Flags: Read / Write

View Source
const PropertyRelief cdk.Property = "relief"

The border relief style. Flags: Read / Write Default value: GTK_RELIEF_NORMAL

View Source
const PropertyResizable cdk.Property = "resizable"

If TRUE, users can resize the window. Flags: Read / Write Default value: TRUE

View Source
const PropertyResizeMode cdk.Property = "resize-mode"

Specify how resize events are handled. Flags: Read / Write Default value: GTK_RESIZE_PARENT

View Source
const PropertyRestrictToFillLevel cdk.Property = "restrict-to-fill-level"

The restrict-to-fill-level property controls whether slider movement is restricted to an upper boundary set by the fill level. See SetRestrictToFillLevel. Flags: Read / Write Default value: TRUE

View Source
const PropertyRightPadding cdk.Property = "right-padding"

The padding to insert at the right of the widget. Flags: Read / Write Allowed values: <= G_MAXINT Default value: 0

View Source
const PropertyRole cdk.Property = "role"

Unique identifier for the window to be used when restoring a session. Flags: Read / Write Default value: NULL

View Source
const PropertyRoundDigits cdk.Property = "round-digits"

The number of digits to round the value to when it changes, or -1. See “change-value”. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyScreen cdk.Property = "screen"

The screen where this window will be displayed. Flags: Read / Write

View Source
const PropertyScrolledViewportShadowType cdk.Property = "viewport-shadow-type"

Style of bevel around the contents. Flags: Read / Write Default value: GTK_SHADOW_NONE

View Source
const PropertySelectable cdk.Property = "selectable"

Whether the label text can be selected with the mouse. Flags: Read / Write Default value: FALSE

View Source
const PropertySelectionBound cdk.Property = "selection-bound"

The position of the opposite end of the selection from the cursor in chars. Flags: Read Allowed values: >= 0 Default value: 0

View Source
const PropertySensitive cdk.Property = "sensitive"

Whether the widget responds to input. Flags: Read / Write Default value: TRUE

View Source
const PropertyShadow cdk.Property = "shadow"

Deprecated property, use shadow_type instead. Flags: Read / Write Default value: GTK_SHADOW_ETCHED_IN

View Source
const PropertyShadowType cdk.Property = "shadow-type"

Appearance of the frame border. Flags: Read / Write Default value: GTK_SHADOW_ETCHED_IN

View Source
const PropertyShowFillLevel cdk.Property = "show-fill-level"

The show-fill-level property controls whether fill level indicator graphics are displayed on the trough. See SetShowFillLevel. Flags: Read / Write Default value: FALSE

View Source
const PropertySingleLineMode cdk.Property = "single-line-mode"

Whether the label is in single line mode. In single line mode, the height of the label does not depend on the actual text, it is always set to ascent + descent of the font. This can be an advantage in situations where resizing the label because of text changes would be distracting, e.g. in a statusbar. Flags: Read / Write Default value: FALSE

View Source
const PropertySkipPagerHint cdk.Property = "skip-pager-hint"

TRUE if the window should not be in the pager. Flags: Read / Write Default value: FALSE

View Source
const PropertySkipTaskbarHint cdk.Property = "skip-taskbar-hint"

TRUE if the window should not be in the task bar. Flags: Read / Write Default value: FALSE

View Source
const PropertySpacing cdk.Property = "spacing"

The amount of space between children. Flags: Read / Write Allowed values: >= 0 Default value: 0

View Source
const PropertyStartupId cdk.Property = "startup-id"

The :startup-id is a write-only property for setting window's startup notification identifier. See SetStartupId for more details. Flags: Write Default value: NULL

View Source
const PropertyStepIncrement cdk.Property = "step-increment"

The step increment of the adjustment. Flags: Read / Write Default value: 0

View Source
const PropertyStyle cdk.Property = "style"

The style of the widget, which contains information about how it will look (colors etc). Flags: Read / Write

View Source
const PropertySwapped cdk.Property = "swapped"
View Source
const PropertyTitle cdk.Property = "title"

The title of the window. Flags: Read / Write Default value: NULL

View Source
const PropertyTooltipMarkup cdk.Property = "tooltip-markup"

Sets the text of tooltip to be the given string, which is marked up with the Tango text markup language. Also see TooltipSetMarkup. This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL: has-tooltip will automatically be set to TRUE and there will be taken care of query-tooltip in the default signal handler. Flags: Read / Write Default value: NULL

View Source
const PropertyTooltipText cdk.Property = "tooltip-text"

Sets the text of tooltip to be the given string. Also see TooltipSetText. This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL: has-tooltip will automatically be set to TRUE and there will be taken care of query-tooltip in the default signal handler. Flags: Read / Write Default value: NULL

View Source
const PropertyTopPadding cdk.Property = "top-padding"

The padding to insert at the top of the widget. Flags: Read / Write Allowed values: <= G_MAXINT Default value: 0

View Source
const PropertyTrackVisitedLinks cdk.Property = "track-visited-links"

Set this property to TRUE to make the label track which links have been clicked. It will then apply the ::visited-link-color color, instead of ::link-color. Flags: Read / Write Default value: TRUE

View Source
const PropertyTransientFor cdk.Property = "transient-for"

The transient parent of the window. See SetTransientFor for more details about transient windows. Flags: Read / Write / Construct

View Source
const PropertyType cdk.Property = "type"

The type of the window. Flags: Read / Write / Construct Only Default value: GTK_WINDOW_TOPLEVEL

View Source
const PropertyTypeHint cdk.Property = "type-hint"

Hint to help the desktop environment understand what kind of window this is and how to treat it. Flags: Read / Write Default value: GDK_WINDOW_TYPE_HINT_NORMAL

View Source
const PropertyUpdatePolicy cdk.Property = "update-policy"

How the range should be updated on the screen. Flags: Read / Write Default value: GTK_UPDATE_CONTINUOUS

View Source
const PropertyUpper cdk.Property = "upper"

The maximum value of the adjustment. Note that values will be restricted by upper - page-size if the page-size property is nonzero. Flags: Read / Write Default value: 0

View Source
const PropertyUpperStepperSensitivity cdk.Property = "upper-stepper-sensitivity"

The sensitivity policy for the stepper that points to the adjustment's upper side. Flags: Read / Write Default value: GTK_SENSITIVITY_AUTO

View Source
const PropertyUrgencyHint cdk.Property = "urgency-hint"

TRUE if the window should be brought to the user's attention. Flags: Read / Write Default value: FALSE

View Source
const PropertyUseActionAppearance cdk.Property = "use-action-appearance"

Whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance. See the Action documentation directly to find which properties should be ignored by the Activatable when this property is FALSE. Flags: Read / Write Default value: TRUE

View Source
const PropertyUseMarkup cdk.Property = "use-markup"

The text of the label includes XML markup. See pango_parse_markup. Flags: Read / Write Default value: FALSE

View Source
const PropertyUseStock cdk.Property = "use-stock"

If set, the label is used to pick a stock item instead of being displayed. Flags: Read / Write / Construct Default value: FALSE

View Source
const PropertyUseUnderline cdk.Property = "use-underline"

If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key. Flags: Read / Write / Construct Default value: FALSE

View Source
const PropertyVAdjustment cdk.Property = "v-adjustment"

The Adjustment for the vertical position. Flags: Read / Write / Construct

View Source
const PropertyVScrollbarPolicy cdk.Property = "vscrollbar-policy"

When the vertical scrollbar is displayed. Flags: Read / Write Default value: GTK_POLICY_ALWAYS

View Source
const PropertyValue cdk.Property = "value"

The value of the adjustment. Flags: Read / Write Default value: 0

View Source
const PropertyViewportHAdjustment cdk.Property = "hadjustment"

The Adjustment that determines the values of the horizontal position for this viewport. Flags: Read / Write / Construct

View Source
const PropertyViewportShadowType cdk.Property = "shadow-type"

Determines how the shadowed box around the viewport is drawn. Flags: Read / Write Default value: GTK_SHADOW_IN

View Source
const PropertyViewportVAdjustment cdk.Property = "vadjustment"

The Adjustment that determines the values of the vertical position for this viewport. Flags: Read / Write / Construct

View Source
const PropertyVisible cdk.Property = "visible"

Whether the widget is visible. Flags: Read / Write Default value: FALSE

View Source
const PropertyVisibleWindow cdk.Property = "visible-window"

Whether the event box is visible, as opposed to invisible and only used to trap events. Flags: Read / Write Default value: TRUE

View Source
const PropertyWidthChars cdk.Property = "width-chars"

The desired width of the label, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the label will request either 3 characters or the property value, whichever is greater. If the "width-chars" property is set to a positive value, then the “max-width-chars” property is ignored. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyWidthRequest cdk.Property = "width-request"

Override for width request of the widget, or -1 if natural request should be used. Flags: Read / Write Allowed values: >= -1 Default value: -1

View Source
const PropertyWindow cdk.Property = "window"

The widget's window if it is realized, NULL otherwise. Flags: Read

View Source
const PropertyWindowPlacement cdk.Property = "window-placement"

Where the contents are located with respect to the scrollbars. This property only takes effect if "window-placement-set" is TRUE. Flags: Read / Write Default value: GTK_CORNER_TOP_LEFT

View Source
const PropertyWindowPlacementSet cdk.Property = "window-placement-set"

Whether "window-placement" should be used to determine the location of the contents with respect to the scrollbars. Otherwise, the "gtk-scrolled-window-placement" setting is used. Flags: Read / Write Default value: FALSE

View Source
const PropertyWindowPosition cdk.Property = "window-position"

The initial position of the window. Flags: Read / Write Default value: GTK_WIN_POS_NONE

View Source
const PropertyWrap cdk.Property = "wrap"

If set, wrap lines if the text becomes too wide. Flags: Read / Write Default value: FALSE

View Source
const PropertyWrapMode cdk.Property = "wrap-mode"

If line wrapping is on (see the “wrap” property) this controls how the line wrapping is done. The default is PANGO_WRAP_WORD, which means wrap on word boundaries. Flags: Read / Write Default value: PANGO_WRAP_WORD

View Source
const PropertyXAlign cdk.Property = "x-align"

Horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned. Flags: Read / Write Allowed values: [0,1] Default value: 0.5

View Source
const PropertyXPad cdk.Property = "x-pad"

The amount of space to add on the left and right of the widget, in pixels. Flags: Read / Write Allowed values: >= 0 Default value: 0

View Source
const PropertyXScale cdk.Property = "x-scale"

If available horizontal space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all. Flags: Read / Write Allowed values: [0,1] Default value: 1

View Source
const PropertyYAlign cdk.Property = "y-align"

Vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned. Flags: Read / Write Allowed values: [0,1] Default value: 0.5

View Source
const PropertyYPad cdk.Property = "y-pad"

The amount of space to add on the top and bottom of the widget, in pixels. Flags: Read / Write Allowed values: >= 0 Default value: 0

View Source
const PropertyYScale cdk.Property = "y-scale"

If available vertical space is bigger than needed for the child, how much of it to use for the child. 0.0 means none, 1.0 means all. Flags: Read / Write Allowed values: [0,1] Default value: 1

View Source
const ScrollbarDrawHandle = "scrollbar-draw-handler"
View Source
const ScrollbarEventHandle = "scrollbar-event-handler"
View Source
const ScrollbarInvalidateHandle = "scrollbar-invalidate-handler"
View Source
const ScrollbarResizeHandle = "scrollbar-resize-handler"
View Source
const ScrolledViewportDrawHandle = "scrolled-viewport-draw-handler"
View Source
const ScrolledViewportEventHandle = "scrolled-viewport-event-handler"
View Source
const ScrolledViewportGainedFocusHandle = "scrolled-viewport-gained-focus-handler"
View Source
const ScrolledViewportInvalidateHandle = "scrolled-viewport-invalidate-handler"
View Source
const ScrolledViewportLostFocusHandle = "scrolled-viewport-lost-focus-handler"
View Source
const ScrolledViewportResizeHandle = "scrolled-viewport-resize-handler"
View Source
const SignalAccelActivate cdk.Signal = "accel-activate"

The accel-activate signal is an implementation detail of AccelGroup and not meant to be used by applications.

View Source
const SignalAccelChanged cdk.Signal = "accel-changed"

The accel-changed signal is emitted when a AccelGroupEntry is added to or removed from the accel group. Widgets like AccelLabel which display an associated accelerator should connect to this signal, and rebuild their visual representation if the accel_closure is theirs. Listener function arguments:

keyval int	the accelerator keyval
modifier cdk.ModMask	the modifier combination of the accelerator
accelClosure GClosure	the GClosure of the accelerator
View Source
const SignalAccelClosuresChanged cdk.Signal = "accel-closures-changed"
View Source
const SignalActivate cdk.Signal = "activate"
View Source
const SignalActivateCurrentLink cdk.Signal = "activate-current-link"

A keybinding signal which gets emitted when the user activates a link in the label. Applications may also emit the signal with g_signal_emit_by_name if they need to control activation of URIs programmatically. The default bindings for this signal are all forms of the Enter key.

View Source
const SignalActivateDefault cdk.Signal = "activate-default"

The ::activate-default signal is a which gets emitted when the user activates the default widget of window .

View Source
const SignalActivateFocus cdk.Signal = "activate-focus"

The ::activate-focus signal is a which gets emitted when the user activates the currently focused widget of window .

View Source
const SignalActivateLink cdk.Signal = "activate-link"

The signal which gets emitted to activate a URI. Applications may connect to it to override the default behaviour, which is to call ShowUri.

View Source
const SignalAdd cdk.Signal = "add"

Listener function arguments:

widget Widget
View Source
const SignalAdjustBounds cdk.Signal = "adjust-bounds"

Listener function arguments:

arg1 float64
View Source
const SignalButtonPressEvent cdk.Signal = "button-press-event"

The ::button-press-event signal will be emitted when a button (typically from a mouse) is pressed. To receive this signal, the Window associated to the widget needs to enable the GDK_BUTTON_PRESS_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalButtonReleaseEvent cdk.Signal = "button-release-event"

The ::button-release-event signal will be emitted when a button (typically from a mouse) is released. To receive this signal, the Window associated to the widget needs to enable the GDK_BUTTON_RELEASE_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalCanActivateAccel cdk.Signal = "can-activate-accel"

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This signal is present to allow applications and derived widgets to override the default Widget handling for determining whether an accelerator can be activated.

View Source
const SignalChangeValue cdk.Signal = "change-value"

The ::change-value signal is emitted when a scroll action is performed on a range. It allows an application to determine the type of scroll event that occurred and the resultant new value. The application can handle the event itself and return TRUE to prevent further processing. Or, by returning FALSE, it can pass the event to other handlers until the default CTK handler is reached. The value parameter is unrounded. An application that overrides the ::change-value signal is responsible for clamping the value to the desired number of decimal digits; the default CTK handler clamps the value based on “round_digits”. It is not possible to use delayed update policies in an overridden ::change-value handler.

View Source
const SignalChanged cdk.Signal = "changed"
View Source
const SignalCheckResize cdk.Signal = "check-resize"
View Source
const SignalChildNotify cdk.Signal = "child-notify"

The ::child-notify signal is emitted for each changed on an object. The signal's detail holds the property name. Listener function arguments:

pspec GParamSpec        the GParamSpec of the changed child property
View Source
const SignalClampPage cdk.Signal = "clamp-page"
View Source
const SignalClicked cdk.Signal = "clicked"

Emitted when the button has been activated (pressed and released).

View Source
const SignalClientEvent cdk.Signal = "client-event"

The ::client-event will be emitted when the widget 's window receives a message (via a ClientMessage event) from another application.

View Source
const SignalClose cdk.Signal = "close"

The ::close signal is a which gets emitted when the user uses a keybinding to close the dialog. The default binding for this signal is the Escape key.

View Source
const SignalCompositedChanged cdk.Signal = "composited-changed"

The ::composited-changed signal is emitted when the composited status of widget s screen changes. See ScreenIsComposited.

View Source
const SignalConfigure cdk.Signal = "configure"
View Source
const SignalConfigureEvent cdk.Signal = "configure-event"

The ::configure-event signal will be emitted when the size, position or stacking of the widget 's window has changed. To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

View Source
const SignalCopyClipboard cdk.Signal = "copy-clipboard"

The ::copy-clipboard signal is a which gets emitted to copy the selection to the clipboard. The default binding for this signal is Ctrl-c.

View Source
const SignalDamageEvent cdk.Signal = "damage-event"

Emitted when a redirected window belonging to widget gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.

View Source
const SignalDeleteEvent cdk.Signal = "delete-event"

The ::delete-event signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connecting HideOnDelete to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.

View Source
const SignalDestroyEvent cdk.Signal = "destroy-event"

The ::destroy-event signal is emitted when a Window is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time. To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

View Source
const SignalDirectionChanged cdk.Signal = "direction-changed"

The ::direction-changed signal is emitted when the text direction of a widget changes. Listener function arguments:

previousDirection TextDirection the previous text direction of widget
View Source
const SignalDragBegin cdk.Signal = "drag-begin"

The ::drag-begin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with DragSourceSetIcon. Note that some widgets set up a drag icon in the default handler of this signal, so you may have to use g_signal_connect_after to override what the default handler did. Listener function arguments:

dragContext DragContext the drag context
View Source
const SignalDragDataDelete cdk.Signal = "drag-data-delete"

The ::drag-data-delete signal is emitted on the drag source when a drag with the action GDK_ACTION_MOVE is successfully completed. The signal handler is responsible for deleting the data that has been dropped. What "delete" means depends on the context of the drag operation. Listener function arguments:

dragContext DragContext the drag context
View Source
const SignalDragDataGet cdk.Signal = "drag-data-get"

The ::drag-data-get signal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to fill data with the data in the format which is indicated by info . See SelectionDataSet and SelectionDataSetText. Listener function arguments:

dragContext DragContext the drag context
data SelectionData      the GtkSelectionData to be filled with the dragged data
info int        the info that has been registered with the target in the GtkTargetList
time int        the timestamp at which the data was requested
View Source
const SignalDragDataReceived cdk.Signal = "drag-data-received"

The ::drag-data-received signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call DragStatus and not finish the drag. If the data was received in response to a drag-drop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call DragFinish, setting the success parameter depending on whether the data was processed successfully. The handler may inspect and modify drag_context->action before calling DragFinish, e.g. to implement GDK_ACTION_ASK as shown in the following example: Listener function arguments:

dragContext DragContext the drag context
x int   where the drop happened
y int   where the drop happened
data SelectionData      the received data
info int        the info that has been registered with the target in the GtkTargetList
time int        the timestamp at which the data was received
View Source
const SignalDragDrop cdk.Signal = "drag-drop"

The ::drag-drop signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns FALSE and no further processing is necessary. Otherwise, the handler returns TRUE. In this case, the handler must ensure that DragFinish is called to let the source know that the drop is done. The call to DragFinish can be done either directly or in a drag-data-received handler which gets triggered by calling DragGetData to receive the data for one or more of the supported targets.

View Source
const SignalDragEnd cdk.Signal = "drag-end"

The ::drag-end signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in drag-begin. Listener function arguments:

dragContext DragContext the drag context
View Source
const SignalDragFailed cdk.Signal = "drag-failed"

The ::drag-failed signal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DND operation based on the type of error, it returns TRUE is the failure has been already handled (not showing the default "drag operation failed" animation), otherwise it returns FALSE.

View Source
const SignalDragLeave cdk.Signal = "drag-leave"

The ::drag-leave signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in drag-motion, e.g. undo highlighting with DragUnhighlight Listener function arguments:

dragContext DragContext the drag context
time int        the timestamp of the motion event
View Source
const SignalDragMotion cdk.Signal = "drag-motion"

The drag-motion signal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns FALSE and no further processing is necessary. Otherwise, the handler returns TRUE. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling DragStatus. If the decision whether the drop will be accepted or rejected can't be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling DragGetData and defer the DragStatus call to the drag-data-received handler. Note that you cannot not pass GTK_DEST_DEFAULT_DROP, GTK_DEST_DEFAULT_MOTION or GTK_DEST_DEFAULT_ALL to DragDestSet when using the drag-motion signal that way. Also note that there is no drag-enter signal. The drag receiver has to keep track of whether he has received any drag-motion signals since the last drag-leave and if not, treat the drag-motion signal as an "enter" signal. Upon an "enter", the handler will typically highlight the drop site with DragHighlight.

View Source
const SignalEnter cdk.Signal = "enter"

Emitted when the pointer enters the button.

View Source
const SignalEnterNotifyEvent cdk.Signal = "enter-notify-event"

The ::enter-notify-event will be emitted when the pointer enters the widget 's window. To receive this signal, the Window associated to the widget needs to enable the GDK_ENTER_NOTIFY_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalEvent cdk.Signal = "event"

The CTK main loop will emit three signals for each GDK event delivered to a widget: one generic ::event signal, another, more specific, signal that matches the type of event delivered (e.g. key-press-event) and finally a generic event-after signal.

View Source
const SignalEventAfter cdk.Signal = "event-after"

After the emission of the event signal and (optionally) the second more specific signal, ::event-after will be emitted regardless of the previous two signals handlers return values. Listener function arguments:

event Event     the GdkEvent which triggered this signal
View Source
const SignalExposeEvent cdk.Signal = "expose-event"

The ::expose-event signal is emitted when an area of a previously obscured Window is made visible and needs to be redrawn. GTK_NO_WINDOW widgets will get a synthesized event from their parent widget. To receive this signal, the Window associated to the widget needs to enable the GDK_EXPOSURE_MASK mask. Note that the ::expose-event signal has been replaced by a ::draw signal in CTK 3. The CTK 3 migration guide for hints on how to port from ::expose-event to ::draw.

View Source
const SignalFocus cdk.Signal = "focus"
View Source
const SignalFocusInEvent cdk.Signal = "focus-in-event"

The ::focus-in-event signal will be emitted when the keyboard focus enters the widget 's window. To receive this signal, the Window associated to the widget needs to enable the GDK_FOCUS_CHANGE_MASK mask.

View Source
const SignalFocusOutEvent cdk.Signal = "focus-out-event"

The ::focus-out-event signal will be emitted when the keyboard focus leaves the widget 's window. To receive this signal, the Window associated to the widget needs to enable the GDK_FOCUS_CHANGE_MASK mask.

View Source
const SignalFrameEvent cdk.Signal = "frame-event"
View Source
const SignalGetThemeRequest = "get-theme-request"
View Source
const SignalGrabBrokenEvent cdk.Signal = "grab-broken-event"

Emitted when a pointer or keyboard grab on a window belonging to widget gets broken. On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again.

View Source
const SignalGrabFocus cdk.Signal = "grab-focus"
View Source
const SignalGrabNotify cdk.Signal = "grab-notify"

The ::grab-notify signal is emitted when a widget becomes shadowed by a CTK grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed. A widget is shadowed by a GrabAdd when the topmost grab widget in the grab stack of its window group is not its ancestor. Listener function arguments:

wasGrabbed bool FALSE if the widget becomes shadowed, TRUE if it becomes unshadowed
View Source
const SignalHide cdk.Signal = "hide"
View Source
const SignalHierarchyChanged cdk.Signal = "hierarchy-changed"

The ::hierarchy-changed signal is emitted when the anchored state of a widget changes. A widget is anchored when its toplevel ancestor is a Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.

View Source
const SignalKeyPressEvent cdk.Signal = "key-press-event"

The ::key-press-event signal is emitted when a key is pressed. To receive this signal, the Window associated to the widget needs to enable the GDK_KEY_PRESS_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalKeyReleaseEvent cdk.Signal = "key-release-event"

The ::key-release-event signal is emitted when a key is pressed. To receive this signal, the Window associated to the widget needs to enable the GDK_KEY_RELEASE_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalKeynavFailed cdk.Signal = "keynav-failed"

Gets emitted if keyboard navigation fails. See KeynavFailed for details.

View Source
const SignalKeysChanged cdk.Signal = "keys-changed"

The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes.

View Source
const SignalLeave cdk.Signal = "leave"

Emitted when the pointer leaves the button.

View Source
const SignalLeaveNotifyEvent cdk.Signal = "leave-notify-event"

The ::leave-notify-event will be emitted when the pointer leaves the widget 's window. To receive this signal, the Window associated to the widget needs to enable the GDK_LEAVE_NOTIFY_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalMap cdk.Signal = "map"
View Source
const SignalMapEvent cdk.Signal = "map-event"

The ::map-event signal will be emitted when the widget 's window is mapped. A window is mapped when it becomes visible on the screen. To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

View Source
const SignalMnemonicActivate cdk.Signal = "mnemonic-activate"
View Source
const SignalMotionNotifyEvent cdk.Signal = "motion-notify-event"

The ::motion-notify-event signal is emitted when the pointer moves over the widget's Window. To receive this signal, the Window associated to the widget needs to enable the GDK_POINTER_MOTION_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalMoveCursor cdk.Signal = "move-cursor"

The ::move-cursor signal is a which gets emitted when the user initiates a cursor movement. If the cursor is not visible in entry , this signal causes the viewport to be moved instead. Applications should not connect to it, but may emit it with g_signal_emit_by_name if they need to control the cursor programmatically. The default bindings for this signal come in two variants, the variant with the Shift modifier extends the selection, the variant without the Shift modifer does not. There are too many key combinations to list them all here. Listener function arguments:

step MovementStep	the granularity of the move, as a GtkMovementStep
count int	the number of step units to move
extendSelection bool	TRUE if the move should extend the selection
View Source
const SignalMoveFocus cdk.Signal = "move-focus"

Listener function arguments:

direction DirectionType
View Source
const SignalMoveFocusOut cdk.Signal = "move-focus-out"

Listener function arguments:

arg1 DirectionType
View Source
const SignalMoveSlider cdk.Signal = "move-slider"

Virtual function that moves the slider. Used for keybindings. Listener function arguments:

step ScrollType	how to move the slider
View Source
const SignalNoExposeEvent cdk.Signal = "no-expose-event"

The ::no-expose-event will be emitted when the widget 's window is drawn as a copy of another Drawable (with DrawDrawable or WindowCopyArea) which was completely unobscured. If the source window was partially obscured EventExpose events will be generated for those areas.

View Source
const SignalParentSet cdk.Signal = "parent-set"

The ::parent-set signal is emitted when a new parent has been set on a widget.

View Source
const SignalPopulatePopup cdk.Signal = "populate-popup"

The ::populate-popup signal gets emitted before showing the context menu of the label. Note that only selectable labels have context menus. If you need to add items to the context menu, connect to this signal and append your menuitems to the menu . Listener function arguments:

menu Menu	the menu that is being populated
View Source
const SignalPopupMenu cdk.Signal = "popup-menu"

This signal gets emitted whenever a widget should pop up a context menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the Entry widget creates a menu with clipboard commands. See the section called Implement Widget::popup_menu for an example of how to use this signal.

View Source
const SignalPressed cdk.Signal = "pressed"

Emitted when the button is pressed.

View Source
const SignalPropertyNotifyEvent cdk.Signal = "property-notify-event"

The ::property-notify-event signal will be emitted when a property on the widget 's window has been changed or deleted. To receive this signal, the Window associated to the widget needs to enable the GDK_PROPERTY_CHANGE_MASK mask.

View Source
const SignalProximityInEvent cdk.Signal = "proximity-in-event"

To receive this signal the Window associated to the widget needs to enable the GDK_PROXIMITY_IN_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalProximityOutEvent cdk.Signal = "proximity-out-event"

To receive this signal the Window associated to the widget needs to enable the GDK_PROXIMITY_OUT_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalQueryTooltip cdk.Signal = "query-tooltip"

Emitted when has-tooltip is TRUE and the gtk-tooltip-timeout has expired with the cursor hovering "above" widget ; or emitted when widget got focus in keyboard mode. Using the given coordinates, the signal handler should determine whether a tooltip should be shown for widget . If this is the case TRUE should be returned, FALSE otherwise. Note that if keyboard_mode is TRUE, the values of x and y are undefined and should not be used. The signal handler is free to manipulate tooltip with the therefore destined function calls.

View Source
const SignalRangeValueChanged cdk.Signal = "value-changed"

Emitted when the range value changes.

View Source
const SignalRealize cdk.Signal = "realize"
View Source
const SignalReleased cdk.Signal = "released"

Emitted when the button is released.

View Source
const SignalRemove cdk.Signal = "remove"

Listener function arguments:

widget Widget
View Source
const SignalResponse cdk.Signal = "response"

Emitted when an action widget is clicked, the dialog receives a delete event, or the application programmer calls Response. On a delete event, the response ID is GTK_RESPONSE_DELETE_EVENT. Otherwise, it depends on which action widget was clicked. Listener function arguments:

responseId int	the response ID
View Source
const SignalScreenChanged cdk.Signal = "screen-changed"

The ::screen-changed signal gets emitted when the screen of a widget has changed. Listener function arguments:

previousScreen Screen   the previous screen, or NULL if the widget was not associated with a screen before.
View Source
const SignalScrollChild cdk.Signal = "scroll-child"

The ::scroll-child signal is a which gets emitted when a keybinding that scrolls is pressed. The horizontal or vertical adjustment is updated which triggers a signal that the scrolled windows child may listen to and scroll itself.

View Source
const SignalScrollEvent cdk.Signal = "scroll-event"

The ::scroll-event signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned. To receive this signal, the Window associated to the widget needs to enable the GDK_BUTTON_PRESS_MASK mask. This signal will be sent to the grab widget if there is one.

View Source
const SignalSelectionClearEvent cdk.Signal = "selection-clear-event"

The ::selection-clear-event signal will be emitted when the the widget 's window has lost ownership of a selection.

View Source
const SignalSelectionGet cdk.Signal = "selection-get"

Listener function arguments:

data SelectionData
info int
time int
View Source
const SignalSelectionNotifyEvent cdk.Signal = "selection-notify-event"
View Source
const SignalSelectionReceived cdk.Signal = "selection-received"

Listener function arguments:

data SelectionData
time int
View Source
const SignalSelectionRequestEvent cdk.Signal = "selection-request-event"

The ::selection-request-event signal will be emitted when another client requests ownership of the selection owned by the widget 's window.

View Source
const SignalSetFocus cdk.Signal = "set-focus"

Listener function arguments:

widget Widget
View Source
const SignalSetFocusChild cdk.Signal = "set-focus-child"

Listener function arguments:

widget Widget
View Source
const SignalSetLower cdk.Signal = "set-lower"
View Source
const SignalSetPageIncrement cdk.Signal = "set-page-increment"
View Source
const SignalSetPageSize cdk.Signal = "set-page-size"
View Source
const SignalSetScrollAdjustments cdk.Signal = "set-scroll-adjustments"

Set the scroll adjustments for the viewport. Usually scrolled containers like ScrolledWindow will emit this signal to connect two instances of Scrollbar to the scroll directions of the Viewport. Listener function arguments:

vertical Adjustment	the vertical GtkAdjustment
arg2 Adjustment
View Source
const SignalSetStepIncrement cdk.Signal = "set-step-increment"
View Source
const SignalSetUpper cdk.Signal = "set-upper"
View Source
const SignalSetValue cdk.Signal = "set-value"
View Source
const SignalShow cdk.Signal = "show"
View Source
const SignalShowHelp cdk.Signal = "show-help"
View Source
const SignalSizeAllocate cdk.Signal = "size-allocate"

Listener function arguments:

allocation Rectangle
View Source
const SignalSizeRequest cdk.Signal = "size-request"

Listener function arguments:

requisition Requisition
View Source
const SignalStateChanged cdk.Signal = "state-changed"

The ::state-changed signal is emitted when the widget state changes. See GetState. Listener function arguments:

state StateType the previous state
View Source
const SignalStyleSet cdk.Signal = "style-set"

The ::style-set signal is emitted when a new style has been set on a widget. Note that style-modifying functions like ModifyBase also cause this signal to be emitted. Listener function arguments:

previousStyle Style     the previous style, or NULL if the widget just got its initial style.
View Source
const SignalUnmap cdk.Signal = "unmap"
View Source
const SignalUnmapEvent cdk.Signal = "unmap-event"

The ::unmap-event signal will be emitted when the widget 's window is unmapped. A window is unmapped when it becomes invisible on the screen. To receive this signal, the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

View Source
const SignalUnrealize cdk.Signal = "unrealize"
View Source
const SignalValueChanged cdk.Signal = "value-changed"
View Source
const SignalVisibilityNotifyEvent cdk.Signal = "visibility-notify-event"

The ::visibility-notify-event will be emitted when the widget 's window is obscured or unobscured. To receive this signal the Window associated to the widget needs to enable the GDK_VISIBILITY_NOTIFY_MASK mask.

View Source
const SignalWindowStateEvent cdk.Signal = "window-state-event"

The ::window-state-event will be emitted when the state of the toplevel window associated to the widget changes. To receive this signal the Window associated to the widget needs to enable the GDK_STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

View Source
const TypeAccelGroup cdk.CTypeTag = "ctk-accel-group"

CDK type-tag for AccelGroup objects

View Source
const TypeAdjustment cdk.CTypeTag = "ctk-adjustment"
View Source
const TypeAlignment cdk.CTypeTag = "ctk-alignment"
View Source
const TypeArrow cdk.CTypeTag = "ctk-arrow"
View Source
const TypeBin cdk.CTypeTag = "ctk-bin"
View Source
const TypeBox cdk.CTypeTag = "ctk-box"
View Source
const TypeBuilder cdk.CTypeTag = "ctk-builder"
View Source
const TypeButton cdk.CTypeTag = "ctk-button"
View Source
const TypeButtonBox cdk.CTypeTag = "ctk-button-box"
View Source
const TypeContainer cdk.CTypeTag = "ctk-container"
View Source
const TypeDialog cdk.CTypeTag = "ctk-dialog"
View Source
const TypeEventBox cdk.CTypeTag = "ctk-event-box"
View Source
const TypeFakeWindow cdk.CTypeTag = "ctk-fake-window"
View Source
const TypeFrame cdk.CTypeTag = "ctk-frame"
View Source
const (
	TypeHBox cdk.CTypeTag = "ctk-h-box"
)
View Source
const TypeHButtonBox cdk.CTypeTag = "ctk-h-button-box"
View Source
const (
	TypeHScrollbar cdk.CTypeTag = "ctk-h-scrollbar"
)
View Source
const TypeLabel cdk.CTypeTag = "ctk-label"
View Source
const TypeMisc cdk.CTypeTag = "ctk-misc"
View Source
const TypeObject cdk.CTypeTag = "ctk-object"
View Source
const TypeRange cdk.CTypeTag = "ctk-range"
View Source
const TypeScrollbar cdk.CTypeTag = "ctk-scrollbar"
View Source
const (
	TypeScrolledViewport cdk.CTypeTag = "ctk-scrolled-viewport"
)
View Source
const TypeStyle cdk.CTypeTag = "ctk-style"
View Source
const (
	TypeVBox cdk.CTypeTag = "ctk-v-box"
)
View Source
const TypeVButtonBox cdk.CTypeTag = "ctk-v-button-box"
View Source
const (
	TypeVScrollbar cdk.CTypeTag = "ctk-v-scrollbar"
)
View Source
const TypeViewport cdk.CTypeTag = "ctk-viewport"

CDK type-tag for Viewport objects

View Source
const TypeWidget cdk.CTypeTag = "ctk-widget"
View Source
const TypeWindow cdk.CTypeTag = "ctk-window"
View Source
const ViewportDrawHandle = "viewport-draw-handler"
View Source
const ViewportInvalidateHandle = "viewport-invalidate-handler"
View Source
const ViewportResizeHandle = "viewport-resize-handler"
View Source
const WidgetActivateHandle = "widget-activate-handler"
View Source
const WidgetEnterHandle = "widget-enter-handler"
View Source
const WidgetGainedFocusHandle = "widget-gained-focus-handler"
View Source
const WidgetLeaveHandle = "widget-leave-handler"
View Source
const WidgetLostFocusHandle = "widget-lost-focus-handler"
View Source
const WindowDrawHandle = "window-draw-handler"
View Source
const WindowEventHandle = "window-event-handler"
View Source
const WindowInvalidateHandle = "window-invalidate-handler"
View Source
const WindowResizeHandle = "window-resize-handler"

Variables

View Source
var (
	// DefaultButtonTheme enables customized theming of default stock buttons.
	DefaultButtonTheme = paint.Theme{
		Content: paint.ThemeAspect{
			Normal:      paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorFireBrick).Dim(true).Bold(false),
			Selected:    paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkRed).Dim(false).Bold(true),
			Active:      paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkRed).Dim(false).Bold(true).Reverse(true),
			Prelight:    paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkRed).Dim(false),
			Insensitive: paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorRosyBrown).Dim(true),
			FillRune:    paint.DefaultFillRune,
			BorderRunes: paint.DefaultBorderRune,
			ArrowRunes:  paint.DefaultArrowRune,
			Overlay:     false,
		},
		Border: paint.ThemeAspect{
			Normal:      paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorFireBrick).Dim(true).Bold(false),
			Selected:    paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkRed).Dim(false).Bold(true),
			Active:      paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkRed).Dim(false).Bold(true).Reverse(true),
			Prelight:    paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkRed).Dim(false),
			Insensitive: paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorRosyBrown).Dim(true),
			FillRune:    paint.DefaultFillRune,
			BorderRunes: paint.DefaultBorderRune,
			ArrowRunes:  paint.DefaultArrowRune,
			Overlay:     false,
		},
	}
)
View Source
var (
	DefaultScrollbarTheme = paint.Theme{

		Content: paint.ThemeAspect{
			Normal:      paint.DefaultColorStyle.Foreground(paint.ColorDarkGray).Background(paint.ColorSilver).Dim(true).Bold(false),
			Selected:    paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorWhite).Dim(false).Bold(true),
			Active:      paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorWhite).Dim(false).Bold(true),
			Prelight:    paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorGray).Dim(false),
			Insensitive: paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorGray).Dim(true),
			FillRune:    paint.DefaultFillRune,
			BorderRunes: paint.DefaultBorderRune,
			ArrowRunes:  paint.DefaultArrowRune,
			Overlay:     false,
		},

		Border: paint.ThemeAspect{
			Normal:      paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorGray).Dim(true).Bold(false),
			Selected:    paint.DefaultColorStyle.Foreground(paint.ColorWhite).Background(paint.ColorDarkGray).Dim(false).Bold(true),
			Active:      paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorSilver).Dim(false).Bold(true),
			Prelight:    paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorDarkGray).Dim(false),
			Insensitive: paint.DefaultColorStyle.Foreground(paint.ColorBlack).Background(paint.ColorDarkGray).Dim(true),
			FillRune:    paint.DefaultFillRune,
			BorderRunes: paint.DefaultBorderRune,
			ArrowRunes:  paint.DefaultArrowRune,
			Overlay:     false,
		},
	}
)
View Source
var DefaultStyles string
View Source
var ErrFallthrough = fmt.Errorf("fallthrough")

Functions

func AddStockItems

func AddStockItems(items ...*StockItem)

Registers each of the stock items in items. If an item already exists with the same stock ID as one of the items, the old item gets replaced.

func BuilderRegisterConstructor

func BuilderRegisterConstructor(tag cdk.TypeTag, fn BuilderTranslationFn)

func TestingWithCtkWindow

func TestingWithCtkWindow(d cdk.Display) error

func WithFakeWindow

func WithFakeWindow(fn WithFakeWindowFn) func()

func WithFakeWindowOptions

func WithFakeWindowOptions(w, h int, theme paint.Theme, fn WithFakeWindowFn) func()

Types

type AccelFlags

type AccelFlags uint64

Accel flags

const (
	ACCEL_VISIBLE AccelFlags = 1 << 0
	ACCEL_LOCKED  AccelFlags = 1 << iota
	ACCEL_MASK    AccelFlags = 0
)

type AccelGroup

type AccelGroup interface {
	Object

	Init() (already bool)
	AccelConnect(accelKey cdk.Key, accelMods cdk.ModMask, accelFlags AccelFlags, closure GClosure) (id int)
	ConnectByPath(accelPath string, closure GClosure)
	AccelGroupActivate(acceleratable Object, keyval cdk.Key, modifier cdk.ModMask) (activated bool)
	AccelDisconnect(id int) (removed bool)
	DisconnectKey(accelKey cdk.Key, accelMods cdk.ModMask) (removed bool)
	Query(accelKey cdk.Key, accelMods cdk.ModMask) (entries []*AccelGroupEntry)
	Activate(accelQuark ptypes.QuarkID, acceleratable Object, accelKey cdk.Key, accelMods cdk.ModMask) (value bool)
	Lock()
	Unlock()
	GetIsLocked() (locked bool)
	FromAccelClosure(closure GClosure) (value AccelGroup)
	GetModifierMask() (value cdk.ModMask)
	Find(findFunc AccelGroupFindFunc, data interface{}) (key *AccelKey)
	AcceleratorValid(keyval cdk.Key, modifiers cdk.ModMask) (valid bool)
	AcceleratorParse(accelerator string) (acceleratorKey cdk.Key, acceleratorMods cdk.ModMask)
	AcceleratorName(acceleratorKey cdk.Key, acceleratorMods cdk.ModMask) (value string)
	AcceleratorGetLabel(acceleratorKey cdk.Key, acceleratorMods cdk.ModMask) (value string)
	AcceleratorSetDefaultModMask(defaultModMask cdk.ModMask)
	AcceleratorGetDefaultModMask() (value int)
}

AccelGroup Hierarchy:

Object
  +- AccelGroup

An AccelGroup represents a group of keyboard accelerators, typically attached to a toplevel Window (with Window.AddAccelGroup). Usually you won't need to create a AccelGroup directly; instead, when using ItemFactory, CTK automatically sets up the accelerators for your menus in the item factory's AccelGroup. Note that accelerators are different from mnemonics. Accelerators are shortcuts for activating a menu item; they appear alongside the menu item they're a shortcut for. For example "Ctrl+Q" might appear alongside the "Quit" menu item. Mnemonics are shortcuts for GUI elements such as text entries or buttons; they appear as underlined characters. See Label.NewWithMnemonic. Menu items can have both accelerators and mnemonics, of course.

Note that usage of within CTK is unimplemented at this time

type AccelGroupEntry

type AccelGroupEntry struct {
	Accelerator AccelKey
	Closure     GClosure
	Quark       ptypes.QuarkID
}

func NewAccelGroupEntry

func NewAccelGroupEntry(key AccelKey, closure GClosure, quark ptypes.QuarkID) (age *AccelGroupEntry)

type AccelGroupFindFunc

type AccelGroupFindFunc = func(key AccelKey, closure GClosure, data []interface{}) bool

type AccelKey

type AccelKey struct {
	Key   cdk.Key
	Mods  cdk.ModMask
	Flags AccelFlags
}

func MakeAccelKey

func MakeAccelKey(key cdk.Key, mods cdk.ModMask, flags AccelFlags) (accelKey AccelKey)

func (AccelKey) String

func (a AccelKey) String() (key string)

type Activatable

type Activatable interface {
	Activate() (value bool)
	Clicked() enums.EventFlag
	GrabFocus()
}

Activatable Hierarchy:

CInterface
  +- Activatable

type Adjustment

type Adjustment interface {
	Object

	Init() bool
	GetValue() (value int)
	SetValue(value int)
	ClampPage(upper, lower int)
	Changed() enums.EventFlag
	ValueChanged() enums.EventFlag
	Settings() (value, lower, upper, stepIncrement, pageIncrement, pageSize int)
	Configure(value, lower, upper, stepIncrement, pageIncrement, pageSize int)
	GetLower() (value int)
	SetLower(lower int)
	GetUpper() (upper int)
	SetUpper(upper int)
	GetStepIncrement() (stepIncrement int)
	SetStepIncrement(stepIncrement int)
	GetPageIncrement() (pageIncrement int)
	SetPageIncrement(pageIncrement int)
	GetPageSize() (pageSize int)
	SetPageSize(pageSize int)
	Moot() bool
	ShowByPolicy(policy PolicyType) bool
}

Adjustment Hierarchy:

Object
  +- Adjustment

The Adjustment CTK object is a means of managing the state of multiple widgets concurrently. By sharing the same Adjustment instance, one or more widgets can ensure that all related User Interface elements are reflecting the same values and constraints. The Adjustment consists of an integer value, with an upper and lower bounds, and pagination rendering features

type Alignable

type Alignable interface {
	SetAlignment(xAlign float64, yAlign float64)
	GetAlignment() (xAlign float64, yAlign float64)
}

An Alignable Widget is one that implements the SetAlignment and GetAlignment methods for adjusting the positioning of the Widget. The Misc and Alignment types are the primary ones implementing this interface.

type Alignment

type Alignment interface {
	Bin
	Buildable

	Init() (already bool)
	Get() (xAlign, yAlign, xScale, yScale float64)
	Set(xAlign, yAlign, xScale, yScale float64)
	GetPadding() (paddingTop, paddingBottom, paddingLeft, paddingRight int)
	SetPadding(paddingTop, paddingBottom, paddingLeft, paddingRight int)
	Add(w Widget)
	Remove(w Widget)
}

Alignment Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Alignment

The Alignment widget controls the alignment and size of its child widget. It has four settings: xScale, yScale, xAlign, and yAlign. The scale settings are used to specify how much the child widget should expand to fill the space allocated to the Alignment. The values can range from 0 (meaning the child doesn't expand at all) to 1 (meaning the child expands to fill all of the available space). The alignment settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect. New Alignment instances can be created using NewAlignment.

type AnchorType

type AnchorType uint64

Anchor type

type ArgFlags

type ArgFlags uint64

Arg flags

const (
	ARC_READABLE       ArgFlags = ArgFlags(PARAM_READABLE)
	ARC_WRITABLE       ArgFlags = ArgFlags(PARAM_WRITABLE)
	ARC_CONSTRUCT      ArgFlags = ArgFlags(PARAM_CONSTRUCT)
	ARC_CONSTRUCT_ONLY ArgFlags = ArgFlags(PARAM_CONSTRUCT_ONLY)
	ARC_CHILD_ARG      ArgFlags = 1 << 4
)

type Arrow

type Arrow interface {
	Misc
	Buildable

	Init() bool
	GetArrowType() (arrow ArrowType)
	SetArrowType(arrow ArrowType)
	GetArrowRune() (r rune, width int)
	GetSizeRequest() (width, height int)
}

Arrow Hierarchy:

Object
  +- Widget
    +- Misc
      +- Arrow

The Arrow Widget should be used to draw simple arrows that need to point in one of the four cardinal directions (up, down, left, or right). The style of the arrow can be one of shadow in, shadow out, etched in, or etched out. Note that these directions and style types may be amended in versions of CTK to come. Arrow will fill any space allotted to it, but since it is inherited from Misc, it can be padded and/or aligned, to fill exactly the space the programmer desires. Arrows are created with a call to NewArrow. The direction or style of an arrow can be changed after creation by using Set.

type ArrowPlacement

type ArrowPlacement uint64

Arrow placement

const (
	ARROWS_BOTH ArrowPlacement = iota
	ARROWS_START
	ARROWS_END
)

type ArrowType

type ArrowType uint64

Arrow type

const (
	ArrowUp ArrowType = iota
	ArrowDown
	ArrowLeft
	ArrowRight
	ArrowNone
)

type AssistantPageType

type AssistantPageType uint64

Assistant page type

const (
	ASSISTANT_PAGE_CONTENT AssistantPageType = iota
	ASSISTANT_PAGE_INTRO
	ASSISTANT_PAGE_CONFIRM
	ASSISTANT_PAGE_SUMMARY
	ASSISTANT_PAGE_PROGRESS
)

type AttachOptions

type AttachOptions uint64

Attach options

const (
	EXPAND AttachOptions = 1 << 0
	SHRINK AttachOptions = 1 << iota
	FILL
)

type Bin

type Bin interface {
	Container
	Buildable

	Init() (already bool)
	GetChild() (value Widget)
	Add(w Widget)
}

Bin Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Window
        +- Alignment
        +- Frame
        +- Button
        +- Item
        +- ComboBox
        +- EventBox
        +- Expander
        +- HandleBox
        +- ToolItem
        +- ScrolledWindow
        +- Viewport

The Bin Widget is a Container with just one child. It is not very useful itself, but it is useful for deriving subclasses, since it provides common code needed for handling a single child widget. Many CTK widgets are subclasses of Bin, including Window, Button, Frame or ScrolledWindow.

type Box

type Box interface {
	Container
	Buildable
	Orientable

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	GetOrientation() (orientation enums.Orientation)
	SetOrientation(orientation enums.Orientation)
	GetHomogeneous() (value bool)
	SetHomogeneous(homogeneous bool)
	GetSpacing() (value int)
	SetSpacing(spacing int)
	Add(child Widget)
	Remove(w Widget)
	PackStart(child Widget, expand, fill bool, padding int)
	PackEnd(child Widget, expand, fill bool, padding int)
	ReorderChild(child Widget, position int)
	QueryChildPacking(child Widget) (expand bool, fill bool, padding int, packType PackType)
	SetChildPacking(child Widget, expand bool, fill bool, padding int, packType PackType)
	GetFocusChain() (focusableWidgets []interface{}, explicitlySet bool)
	GetSizeRequest() (width, height int)
}

Box Hierarchy:

Object
  +- Widget
    +- Container
      +- Box
        +- ButtonBox
        +- VBox
        +- HBox

The Box Widget is a Container for organizing one or more child Widgets. A Box displays either a horizontal row or vertical column of the visible children contained within.

type Buildable

type Buildable interface {
	ListProperties() (known []cdk.Property)
	InitWithProperties(properties map[cdk.Property]string) (already bool, err error)
	Build(builder Builder, element *CBuilderElement) error
	SetProperties(properties map[cdk.Property]string) (err error)
	SetPropertyFromString(property cdk.Property, value string) (err error)
	SetSensitive(sensitive bool)
	SetFlags(widgetFlags WidgetFlags)
	UnsetFlags(widgetFlags WidgetFlags)
	Connect(signal cdk.Signal, handle string, c cdk.SignalListenerFn, data ...interface{})
	LogErr(err error)
	Show()
	GrabFocus()
}

type Builder

type Builder interface {
	cdk.Object

	Init() (already bool)
	BuildableTypeTags() map[string]cdk.TypeTag
	LookupNamedSignalHandler(name string) (fn cdk.SignalListenerFn)
	AddNamedSignalHandler(name string, fn cdk.SignalListenerFn)
	GetWidget(name string) (w interface{})
	GetWidgetsBuiltByType(tag cdk.CTypeTag) (widgets []interface{})
	ParsePacking(packing *CBuilderElement) (expand, fill bool, padding int, packType PackType)
	LoadFromString(raw string) (topElement *CBuilderElement, err error)
	Build(element *CBuilderElement) (newObject interface{})
}

func NewBuilder

func NewBuilder() (builder Builder)

type BuilderElement

type BuilderElement interface {
	String() string
	ApplyProperties()
	ApplyProperty(k, v string) (set bool)
}

type BuilderError

type BuilderError uint64

Builder error

const (
	BUILDER_ERROR_INVALID_TYPE_FUNCTION BuilderError = iota
	BUILDER_ERROR_UNHANDLED_TAG
	BUILDER_ERROR_MISSINC_ATTRIBUTE
	BUILDER_ERROR_INVALID_ATTRIBUTE
	BUILDER_ERROR_INVALID_TAG
	BUILDER_ERROR_MISSINC_PROPERTY_VALUE
	BUILDER_ERROR_INVALID_VALUE
	BUILDER_ERROR_VERSION_MISMATCH
	BUILDER_ERROR_DUPLICATE_ID
)

type BuilderNode

type BuilderNode struct {
	XMLName xml.Name
	Attrs   []xml.Attr    `xml:"-"`
	Content []byte        `xml:",innerxml"`
	Nodes   []BuilderNode `xml:",any"`
}

func (*BuilderNode) UnmarshalXML

func (n *BuilderNode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type BuilderTranslationFn

type BuilderTranslationFn = func(builder Builder, widget Widget, name, value string) error

type Button

type Button interface {
	Bin
	Activatable
	Alignable
	Buildable

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	Activate() (value bool)
	Clicked() enums.EventFlag
	GetRelief() (value ReliefStyle)
	SetRelief(newStyle ReliefStyle)
	GetLabel() (value string)
	SetLabel(label string)
	GetUseStock() (value bool)
	SetUseStock(useStock bool)
	GetUseUnderline() (enabled bool)
	SetUseUnderline(enabled bool)
	GetUseMarkup() (enabled bool)
	SetUseMarkup(enabled bool)
	GetFocusOnClick() (value bool)
	SetFocusOnClick(focusOnClick bool)
	GetAlignment() (xAlign float64, yAlign float64)
	SetAlignment(xAlign float64, yAlign float64)
	GetImage() (value Widget, ok bool)
	SetImage(image Widget)
	GetImagePosition() (value PositionType)
	SetImagePosition(position PositionType)
	GetPressed() bool
	SetPressed(pressed bool)
	GetFocusChain() (focusableWidgets []interface{}, explicitlySet bool)
	CancelEvent()
	GetWidgetAt(p *ptypes.Point2I) Widget
	GetSizeRequest() (width, height int)
	GrabFocus()
	GrabEventFocus()
}

Button Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Button
          +- ToggleButton
          +- ColorButton
          +- FontButton
          +- LinkButton
          +- OptionMenu
          +- ScaleButton

The Button Widget is a Bin Container that represents a focusable Drawable Widget that is Sensitive to event interactions.

type ButtonAction

type ButtonAction uint64

Button action

const (
	BUTTON_IGNORED ButtonAction = 0
	BUTTON_SELECTS ButtonAction = 1 << 0
	BUTTON_DRAGS   ButtonAction = 1 << iota
	BUTTON_EXPANDS
)

type ButtonBox

type ButtonBox interface {
	Box
	Buildable
	Orientable

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	GetLayout() (value ButtonBoxStyle)
	SetLayout(layoutStyle ButtonBoxStyle)
	Add(w Widget)
	Remove(w Widget)
	PackStart(w Widget, expand, fill bool, padding int)
	PackEnd(w Widget, expand, fill bool, padding int)
	GetChildPrimary(w Widget) (isPrimary bool)
	GetChildSecondary(w Widget) (isSecondary bool)
	SetChildSecondary(child Widget, isSecondary bool)
	SetChildPacking(child Widget, expand bool, fill bool, padding int, packType PackType)
}

ButtonBox Hierarchy:

Object
  +- Widget
    +- Container
      +- Box
        +- ButtonBox
          +- HButtonBox
          +- VButtonBox

The ButtonBox Widget is a Box Container that has a primary and a secondary grouping of its Widget children. These are typically used by the Dialog Widget to implement the action buttons.

type ButtonBoxStyle

type ButtonBoxStyle uint64

Button box style

const (
	BUTTONBOX_DEFAULT_STYLE ButtonBoxStyle = iota
	// Spread the buttons evenly and centered away from the edges
	BUTTONBOX_SPREAD
	// Spread the buttons evenly and centered from edge to edge
	BUTTONBOX_EDGE
	// Group buttons at the start
	BUTTONBOX_START
	// Group buttons at the end
	BUTTONBOX_END
	// Group buttons at the center
	BUTTONBOX_CENTER
	// Buttons are expanded to evenly consume all space available
	BUTTONBOX_EXPAND
)

type ButtonsType

type ButtonsType uint64

Buttons type

const (
	BUTTONS_NONE ButtonsType = iota
	BUTTONS_OK
	BUTTONS_CLOSE
	BUTTONS_CANCEL
	BUTTONS_YES_NO
	BUTTONS_OK_CANCEL
)

type CAccelGroup

type CAccelGroup struct {
	CObject
	// contains filtered or unexported fields
}

The CAccelGroup structure implements the AccelGroup interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with AccelGroup objects

func MakeAccelGroup

func MakeAccelGroup() *CAccelGroup

MakeAccelGroup is used by the Buildable system to construct a new AccelGroup.

func NewAccelGroup

func NewAccelGroup() (value *CAccelGroup)

NewAccelGroup is the constructor for new AccelGroup instances.

func (*CAccelGroup) AccelConnect

func (a *CAccelGroup) AccelConnect(accelKey cdk.Key, accelMods cdk.ModMask, accelFlags AccelFlags, closure GClosure) (id int)

AccelConnect installs an accelerator in this group. When accel_group is being activated in response to a call to AccelGroupsActivate, closure will be invoked if the accel_key and accel_mods from AccelGroupsActivate match those of this connection. The signature used for the closure is that of AccelGroupActivate. Note that, due to implementation details, a single closure can only be connected to one accelerator group.

Parameters:

accelGroup	the accelerator group to install an accelerator in
accelKey	key value of the accelerator
accelMods	modifier combination of the accelerator
accelFlags	a flag mask to configure this accelerator
closure	code to be executed upon accelerator activation

func (*CAccelGroup) AccelDisconnect

func (a *CAccelGroup) AccelDisconnect(id int) (removed bool)

AccelDisconnect removes an accelerator previously installed through Connect.

Parameters:

accelGroup	the accelerator group to remove an accelerator from
closure	handle for the closure code to remove

func (*CAccelGroup) AccelGroupActivate

func (a *CAccelGroup) AccelGroupActivate(acceleratable Object, keyval cdk.Key, modifier cdk.ModMask) (activated bool)

func (*CAccelGroup) AcceleratorGetDefaultModMask

func (a *CAccelGroup) AcceleratorGetDefaultModMask() (value int)

AcceleratorGetDefaultModMask returns the value set by AcceleratorSetDefaultModMask.

Parameters:

returns	the default accelerator modifier mask

func (*CAccelGroup) AcceleratorGetLabel

func (a *CAccelGroup) AcceleratorGetLabel(acceleratorKey cdk.Key, acceleratorMods cdk.ModMask) (value string)

AcceleratorGetLable converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.

Parameters:

acceleratorKey	accelerator keyval
acceleratorMods	accelerator modifier mask

func (*CAccelGroup) AcceleratorName

func (a *CAccelGroup) AcceleratorName(acceleratorKey cdk.Key, acceleratorMods cdk.ModMask) (value string)

AcceleratorName converts an accelerator keyval and modifier mask into a string parseable by AcceleratorParse. For example, if you pass in cdk.KeySmallQ and CONTROL_MASK, this function returns "<Control>q". If you need to display accelerators in the user interface, see AcceleratorGetLabel.

Parameters:

acceleratorKey	accelerator keyval
acceleratorMods	accelerator modifier mask

func (*CAccelGroup) AcceleratorParse

func (a *CAccelGroup) AcceleratorParse(accelerator string) (acceleratorKey cdk.Key, acceleratorMods cdk.ModMask)

AcceleratorParse parses a string representing an accelerator. The format looks like "<Control>a" or "<Shift><Alt>F1" or "<Release>z" (the last one is for key release). The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". Key names are parsed using KeyvalFromName. For character keys the name is not the symbol, but the lowercase name, e.g. one would use "<Ctrl>minus" instead of "<Ctrl>-". If the parse fails, accelerator_key and accelerator_mods will be set to 0 (zero).

Parameters:

accelerator	string representing an accelerator

func (*CAccelGroup) AcceleratorSetDefaultModMask

func (a *CAccelGroup) AcceleratorSetDefaultModMask(defaultModMask cdk.ModMask)

AcceleratorSetDefaultMask updates the modifiers that will be considered significant for keyboard accelerators. The default mod mask is CONTROL_MASK | SHIFT_MASK | MOD1_MASK | SUPER_MASK | HYPER_MASK | META_MASK, that is, Control, Shift, Alt, Super, Hyper and Meta. Other modifiers will by default be ignored by AccelGroup. You must include at least the three modifiers Control, Shift and Alt in any value you pass to this function. The default mod mask should be changed on application startup, before using any accelerator groups.

Parameters:

defaultModMask	accelerator modifier mask

func (*CAccelGroup) AcceleratorValid

func (a *CAccelGroup) AcceleratorValid(keyval cdk.Key, modifiers cdk.ModMask) (valid bool)

AcceleratorValid determines whether a given keyval and modifier mask constitute a valid keyboard accelerator.

Parameters:

keyval	a GDK keyval
modifiers	modifier mask

func (*CAccelGroup) Activate

func (a *CAccelGroup) Activate(accelQuark ptypes.QuarkID, acceleratable Object, accelKey cdk.Key, accelMods cdk.ModMask) (value bool)

Activate finds the first accelerator in accel_group that matches accel_key and accel_mods, and activates it.

Parameters:

accelQuark	the quark for the accelerator name
acceleratable	the CObject, usually a Window, on which to activate the accelerator.
accelKey	accelerator keyval from a key event
accelMods	keyboard state mask from a key event

func (*CAccelGroup) ConnectByPath

func (a *CAccelGroup) ConnectByPath(accelPath string, closure GClosure)

ConnectByPath installs an accelerator in this group, using an accelerator path to look up the appropriate key and modifiers (see AccelMapAddEntry). When accel_group is being activated in response to a call to AccelGroupsActivate, closure will be invoked if the accel_key and accel_mods from AccelGroupsActivate match the key and modifiers for the path. The signature used for the closure is that of AccelGroupActivate. Note that accel_path string will be stored in a cdk.Quark.

Parameters:

accelGroup	the accelerator group to install an accelerator in
accelPath	path used for determining key and modifiers.
closure	code to be executed upon accelerator activation

func (*CAccelGroup) DisconnectKey

func (a *CAccelGroup) DisconnectKey(accelKey cdk.Key, accelMods cdk.ModMask) (removed bool)

DisconnectKey removes an accelerator previously installed through Connect.

Parameters:

accelGroup	the accelerator group to install an accelerator in
accelKey	key value of the accelerator
accelMods	modifier combination of the accelerator

func (*CAccelGroup) Find

func (a *CAccelGroup) Find(findFunc AccelGroupFindFunc, data interface{}) (key *AccelKey)

Find finds the first entry in an accelerator group for which find_func returns TRUE and returns its AccelKey.

Parameters:

findFunc	a function to filter the entries of accel_group
data	arbitrary data to pass to find_func

func (*CAccelGroup) FromAccelClosure

func (a *CAccelGroup) FromAccelClosure(closure GClosure) (value AccelGroup)

FromAccelClosure finds the AccelGroup to which closure is connected. See: Connect()

Parameters:

closure	a GClosure handle

func (*CAccelGroup) GetIsLocked

func (a *CAccelGroup) GetIsLocked() (locked bool)

GetIsLocked checks if the group is locked or not. Locks are added and removed using Lock and Unlock.

func (*CAccelGroup) GetModifierMask

func (a *CAccelGroup) GetModifierMask() (value cdk.ModMask)

GetModifierMask returns a cdk.ModMask representing the mask for this accel_group. For example, CONTROL_MASK, SHIFT_MASK, etc.

func (*CAccelGroup) Init

func (a *CAccelGroup) Init() (already bool)

Init initializes an AccelGroup object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the AccelGroup instance. Init is used in the NewAccelGroup constructor and only necessary when implementing a derivative AccelGroup type.

func (*CAccelGroup) Lock

func (a *CAccelGroup) Lock()

Lock locks the given accelerator group. Locking an accelerator group prevents the accelerators contained within it to be changed during runtime. Refer to AccelMapChangeEntry about runtime accelerator changes. If called more than once, accel_group remains locked until Unlock has been called an equivalent number of times.

func (*CAccelGroup) Query

func (a *CAccelGroup) Query(accelKey cdk.Key, accelMods cdk.ModMask) (entries []*AccelGroupEntry)

Query searches an accelerator group for all entries matching accel_key and accel_mods.

Parameters:

accelGroup	the accelerator group to query
accelKey	key value of the accelerator
accelMods	modifier combination of the accelerator

func (*CAccelGroup) Unlock

func (a *CAccelGroup) Unlock()

Unlock releases the last call to Lock on this accel_group.

type CAdjustment

type CAdjustment struct {
	CObject
}

The CAdjustment structure implements the Adjustment interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Adjustment objects.

func MakeAdjustment

func MakeAdjustment() *CAdjustment

MakeAdjustment is used by the Buildable system to construct a new Adjustment.

func NewAdjustment

func NewAdjustment(value, lower, upper, stepIncrement, pageIncrement, pageSize int) *CAdjustment

NewAdjustment is the constructor for new Adjustment instances.

func (*CAdjustment) Changed

func (a *CAdjustment) Changed() enums.EventFlag

Changed emits a changed signal. The changed signal reflects that one or more of the configurable aspects have changed, excluding the actual value of the Adjustment. See: ValueChanged()

func (*CAdjustment) ClampPage

func (a *CAdjustment) ClampPage(upper, lower int)

ClampPage is a convenience method to set both the upper and lower bounds without emitting multiple changed signals. This method emits a clamp-page signal initially and if the listeners return an EVENT_PASS then the new upper and lower bounds are applied and a call to Changed() is made.

func (*CAdjustment) Configure

func (a *CAdjustment) Configure(value, lower, upper, stepIncrement, pageIncrement, pageSize int)

Configure updates all the configurable aspects of an Adjustment while emitting only a single changed and/or value-changed signal. The method emits a configure signal initially and if the listeners return an EVENT_PASS then applies all the changes and calls Changed() and/or ValueChanged() accordingly. The same effect of this method can be achieved by passing the changed and value-changed signal emissions for the Adjustment instance, making all the individual calls to the setter methods, resuming the changed and value-changed signals and finally calling the Changed() and/or ValueChanged() methods accordingly.

Parameters:

value	the new value
lower	the new minimum value
upper	the new maximum value
stepIncrement	the new step increment
pageIncrement	the new page increment
pageSize	the new page size

func (*CAdjustment) GetLower

func (a *CAdjustment) GetLower() (value int)

GetLower returns the current lower bounds of the Adjustment.

func (*CAdjustment) GetPageIncrement

func (a *CAdjustment) GetPageIncrement() (pageIncrement int)

GetPageIncrement returns the current page increment of the Adjustment. Adjustment values are intended to be increased or decreased by either a step or page amount. The page increment is the longer movement such as moving up or down half a page of text.

func (*CAdjustment) GetPageSize

func (a *CAdjustment) GetPageSize() (pageSize int)

GetPageSize returns the page size of the Adjustment. Adjustment values are intended to be increased or decreased by either a step or page amount and having a separate Adjustment variable to track the end-user facing page size is beneficial. This value does not have to be the same as the page increment, however the page increment is in effect clamped to the page size of the Adjustment.

func (*CAdjustment) GetStepIncrement

func (a *CAdjustment) GetStepIncrement() (stepIncrement int)

GetStepIncrement returns the current step increment of the Adjustment. Adjustment values are intended to be increased or decreased by either a step or page amount. The step increment is the shorter movement such as moving up or down a line of text.

func (*CAdjustment) GetUpper

func (a *CAdjustment) GetUpper() (upper int)

GetUpper returns the current lower bounds of the Adjustment.

func (*CAdjustment) GetValue

func (a *CAdjustment) GetValue() (value int)

GetValue returns the current value of the adjustment. See: SetValue()

func (*CAdjustment) Init

func (a *CAdjustment) Init() bool

Init initializes an Adjustment object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Adjustment instance. Init is used in the NewAdjustment constructor and only necessary when implementing a derivative Adjustment type.

func (*CAdjustment) Moot

func (a *CAdjustment) Moot() bool

Moot is a convenience method to return TRUE if the Adjustment object is in a "moot" state in which the values are irrelevant because the upper bounds is set to zero. Given an upper bounds of zero, the value and lower bounds are also clamped to zero and so on. Thus, this convenience method enables a Human readable understanding of why the upper bounds is being checked for a zero value (eliminates a useful magic value).

func (*CAdjustment) SetLower

func (a *CAdjustment) SetLower(lower int)

SetLower updates the lower bounds of the Adjustment. This method emits a set-lower signal initially and if the listeners return an EVENT_PASS then the value is applied and a call to Changed() is made.

func (*CAdjustment) SetPageIncrement

func (a *CAdjustment) SetPageIncrement(pageIncrement int)

SetPageIncrement updates the page increment of the Adjustment. This method emits a set-page-increment signal initially and if the listeners return an EVENT_PASS then the value is applied and a call to Changed() is made.

func (*CAdjustment) SetPageSize

func (a *CAdjustment) SetPageSize(pageSize int)

SetPageSize updates the page size of the Adjustment. This method emits a set-page-size signal initially and if the listeners return an EVENT_PASS then the value is applied and a call to Changed() is made.

func (*CAdjustment) SetStepIncrement

func (a *CAdjustment) SetStepIncrement(stepIncrement int)

SetStepIncrement updates the step increment of the Adjustment. This method emits a set-step-increment signal initially and if the listeners return an EVENT_PASS then the value is applied and a call to Changed() is made.

func (*CAdjustment) SetUpper

func (a *CAdjustment) SetUpper(upper int)

SetUpper updates the upper bounds of the Adjustment. This method emits a set-upper signal initially and if the listeners return an EVENT_PASS then the value is applied and a call to Changed() is made.

func (*CAdjustment) SetValue

func (a *CAdjustment) SetValue(value int)

SetValue updates the current value of the Adjustment. This method emits a set-value signal initially and if the listeners return an EVENT_PASS then the new value is applied and a call to ValueChanged() is made.

func (*CAdjustment) Settings

func (a *CAdjustment) Settings() (value, lower, upper, stepIncrement, pageIncrement, pageSize int)

Settings is a convenience method to retrieve all the configurable Adjustment values in one statement.

func (*CAdjustment) ShowByPolicy

func (a *CAdjustment) ShowByPolicy(policy PolicyType) bool

ShowByPolicy is a convenience method that given a PolicyType, determines if the Widget using the Adjustment should be rendered or otherwise used to an end-user-facing effect. This method is primarily used by other Widgets as a convenient way to determine if they should show or hide their presence.

func (*CAdjustment) ValueChanged

func (a *CAdjustment) ValueChanged() enums.EventFlag

ValueChanged emits a value-changed signal. The value-changed signal reflects that the actual value of the Adjustment has changed.

type CAlignment

type CAlignment struct {
	CBin
}

The CAlignment structure implements the Alignment interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Alignment objects.

func MakeAlignment

func MakeAlignment() *CAlignment

MakeAlignment is used by the Buildable system to construct a new Alignment with default settings of: xAlign=0.5, yAlign=1.0, xScale=0.5, yScale=1.0

func NewAlignment

func NewAlignment(xAlign float64, yAlign float64, xScale float64, yScale float64) *CAlignment

NewAlignment is the constructor for new Alignment instances.

Parameters:

xAlign	the horizontal alignment of the child widget, from 0 (left) to 1 (right)
yAlign	the vertical alignment of the child widget, from 0 (top) to 1 (bottom)
xScale	the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Alignment
yScale	the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xScale

func (*CAlignment) Add

func (a *CAlignment) Add(w Widget)

Add will set the current child to the Widget instance given, connect two signal handlers for losing and gaining focus and finally resize the Alignment instance to accommodate the new child Widget.

func (*CAlignment) Get

func (a *CAlignment) Get() (xAlign, yAlign, xScale, yScale float64)

Get is a convenience method to return the four main Alignment property values See: Set()

func (*CAlignment) GetPadding

func (a *CAlignment) GetPadding() (paddingTop, paddingBottom, paddingLeft, paddingRight int)

GetPadding is a convenience method to return the four padding property values See: SetPadding()

func (*CAlignment) Init

func (a *CAlignment) Init() (already bool)

Init initializes an Alignment object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Alignment instance. Init is used in the NewAlignment constructor and only necessary when implementing a derivative Alignment type.

func (*CAlignment) Remove

func (a *CAlignment) Remove(w Widget)

Remove will remove the given Widget from the Alignment instance, disconnecting any connected focus signal handlers and finally resize the Alignment instance to accommodate the lack of content.

func (*CAlignment) Set

func (a *CAlignment) Set(xAlign, yAlign, xScale, yScale float64)

Set is a convenience method to update the four main Alignment property values

Parameters:

xAlign	the horizontal alignment of the child widget, from 0 (left) to 1 (right)
yAlign	the vertical alignment of the child widget, from 0 (top) to 1 (bottom)
xScale	the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Alignment
yScale	the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xScale

func (*CAlignment) SetPadding

func (a *CAlignment) SetPadding(paddingTop, paddingBottom, paddingLeft, paddingRight int)

SetPadding is a convenience method to update the padding for the different sides of the widget. The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left.

Parameters:

paddingTop	    the padding at the top of the widget
paddingBottom	the padding at the bottom of the widget
paddingLeft	    the padding at the left of the widget
paddingRight	the padding at the right of the widget.

type CArrow

type CArrow struct {
	CMisc
}

The CArrow structure implements the Arrow interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Arrow objects.

func MakeArrow

func MakeArrow() *CArrow

MakeArrow is used by the Buildable system to construct a new Arrow with a default ArrowType setting of ArrowRight.

func NewArrow

func NewArrow(arrow ArrowType) *CArrow

NewArrow is the constructor for new Arrow instances.

func (*CArrow) GetArrowRune

func (a *CArrow) GetArrowRune() (r rune, width int)

GetArrowRune is a Curses-specific method for returning the go `rune` character and its byte width.

func (*CArrow) GetArrowType

func (a *CArrow) GetArrowType() (arrow ArrowType)

GetArrowType is a convenience method for returning the ArrowType property

func (*CArrow) GetSizeRequest

func (a *CArrow) GetSizeRequest() (width, height int)

GetSizeRequest returns the requested size of the Drawable Widget. This method is used by Container Widgets to resolve the surface space allocated for their child Widget instances.

func (*CArrow) Init

func (a *CArrow) Init() bool

Init initializes an Arrow object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Arrow instance. Init is used in the NewArrow constructor and only necessary when implementing a derivative Arrow type.

func (*CArrow) SetArrowType

func (a *CArrow) SetArrowType(arrow ArrowType)

SetArrowType is a convenience method for updating the ArrowType property

Parameters:

arrowType	a valid ArrowType.

type CBin

type CBin struct {
	CContainer
}

The CBin structure implements the Bin interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Bin objects.

func MakeBin added in v0.1.2

func MakeBin() *CBin

MakeBin is used by the Buildable system to construct a new Bin.

func NewBin added in v0.1.2

func NewBin() *CBin

NewBin is the constructor for new Bin instances.

func (*CBin) Add

func (b *CBin) Add(w Widget)

Add the given widget to the Bin, if the Bin is full (has one child already) the given Widget replaces the existing Widget.

func (*CBin) GetChild

func (b *CBin) GetChild() (value Widget)

GetChild is a convenience method to return the first child in the Bin Container. Returns the Widget or `nil` if the Bin contains no child widget.

func (*CBin) Init

func (b *CBin) Init() (already bool)

Init initializes a Bin object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Bin instance. Init is used in the NewBin constructor and only necessary when implementing a derivative Bin type.

type CBox

type CBox struct {
	CContainer
}

The CBox structure implements the Box interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Box objects.

func MakeBox

func MakeBox() (box *CBox)

MakeBox is used by the Buildable system to construct a new Box with default settings of: horizontal orientation, dynamically sized (not homogeneous) and no extra spacing.

func NewBox

func NewBox(orientation enums.Orientation, homogeneous bool, spacing int) *CBox

NewBox is the constructor for new Box instances.

Parameters:

orientation  the orientation of the Box vertically or horizontally
homogeneous  whether each child receives an equal size allocation or not
spacing      extra spacing to include between children

func (*CBox) Add

func (b *CBox) Add(child Widget)

Add the given Widget to the Box using PackStart() with default settings of: expand=false, fill=true and padding=0

func (*CBox) Build

func (b *CBox) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Box Widgets.

func (*CBox) GetFocusChain

func (b *CBox) GetFocusChain() (focusableWidgets []interface{}, explicitlySet bool)

GetFocusChain retrieves the focus chain of the Box, if one has been set explicitly. If no focus chain has been explicitly set, CTK computes the focus chain based on the positions of the children, taking into account the child packing configuration.

Returns:

focusableWidgets	widgets in the focus chain.
explicitlySet       TRUE if the focus chain has been set explicitly.

func (*CBox) GetHomogeneous

func (b *CBox) GetHomogeneous() (value bool)

GetHomogeneous is a convenience method for returning the homogeneous property value. See: SetHomogeneous()

func (*CBox) GetOrientation

func (b *CBox) GetOrientation() (orientation enums.Orientation)

GetOrientation is a convenience method for returning the orientation property value. See: SetOrientation()

func (*CBox) GetSizeRequest

func (b *CBox) GetSizeRequest() (width, height int)

GetSizeRequest returns the requested size of the Drawable Widget. This method is used by Container Widgets to resolve the surface space allocated for their child Widget instances.

func (*CBox) GetSpacing

func (b *CBox) GetSpacing() (value int)

GetSpacing is a convenience method for returning the spacing property value. See: SetSpacing()

func (*CBox) Init

func (b *CBox) Init() (already bool)

Init initializes a Box object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Box instance. Init is used in the NewBox constructor and only necessary when implementing a derivative Box type.

func (*CBox) PackEnd

func (b *CBox) PackEnd(child Widget, expand, fill bool, padding int)

PackEnd adds child to box, packed with reference to the end of box. The child is packed after (away from end of) any other child packed with reference to the end of box.

Parameters

child the Widget to be added to box expand TRUE if the new child is to be given extra space allocated to box.

The extra space will be divided evenly between all children of box
that use this option

fill TRUE if space given to child by the expand option is actually

allocated to child, rather than just padding it. This parameter
has no effect if expand is set to FALSE. A child is always
allocated the full height of an HBox and the full width of a VBox.
This option affects the other dimension

padding extra space in pixels to put between this child and its neighbors,

over and above the global amount specified by spacing property.
If child is a widget at one of the reference ends of box, then
padding pixels are also put between child and the reference edge of
box

func (*CBox) PackStart

func (b *CBox) PackStart(child Widget, expand, fill bool, padding int)

PackStart adds child to box, packed with reference to the start of box. The child is packed after any other child packed with reference to the start of box.

Parameters

child the Widget to be added to box expand TRUE if the new child is to be given extra space allocated to box.

The extra space will be divided evenly between all children of box
that use this option

fill TRUE if space given to child by the expand option is actually

allocated to child, rather than just padding it. This parameter has
no effect if expand is set to FALSE. A child is always allocated
the full height of an HBox and the full width of a VBox. This
option affects the other dimension

padding extra space in pixels to put between this child and its neighbors,

over and above the global amount specified by spacing property.
If child is a widget at one of the reference ends of box , then
padding pixels are also put between child and the reference edge of
box

func (*CBox) QueryChildPacking

func (b *CBox) QueryChildPacking(child Widget) (expand bool, fill bool, padding int, packType PackType)

QueryChildPacking obtains information about how the child is packed into the Box. If the given child Widget is not contained within the Box an error is logged and the return values will all be their `nil` equivalents.

Parameters:

child	the Widget of the child to query

func (*CBox) Remove

func (b *CBox) Remove(w Widget)

Remove the given Widget from the Box Container, disconnecting any signal handlers in the process.

func (*CBox) ReorderChild

func (b *CBox) ReorderChild(child Widget, position int)

ReorderChild moves the given child to a new position in the list of Box children. The list is the children field of Box, and contains both widgets packed PACK_START as well as widgets packed PACK_END, in the order that these widgets were added to the box. A widget's position in the Box children list determines where the widget is packed into box. A child widget at some position in the list will be packed just after all other widgets of the same packing type that appear earlier in the list. The children field is not exported and only the interface methods are able to manipulate the field.

Parameters:

child	    the Widget to move
position	the new position for child in the list of children of box starting from 0. If negative, indicates the end of the list

func (*CBox) SetChildPacking

func (b *CBox) SetChildPacking(child Widget, expand bool, fill bool, padding int, packType PackType)

SetChildPacking updates the information about how the child is packed into the Box. If the given child Widget is not contained within the Box an error is logged and no action is taken.

Parameters:

child	the Widget of the child to set
expand	the new value of the “expand” child property
fill	the new value of the “fill” child property
padding	the new value of the “padding” child property
packType	the new value of the “pack-type” child property

func (*CBox) SetHomogeneous

func (b *CBox) SetHomogeneous(homogeneous bool)

SetHomogeneous is a convenience method for updating the homogeneous property of the Box instance, controlling whether or not all children of box are given equal space in the box.

Parameters:

homogeneous	 TRUE to create equal allotments, FALSE for variable allotments

func (*CBox) SetOrientation

func (b *CBox) SetOrientation(orientation enums.Orientation)

SetOrientation is a convenience method for updating the orientation property value.

Parameters:

orientation  the desired enums.Orientation to use

func (*CBox) SetSpacing

func (b *CBox) SetSpacing(spacing int)

SetSpacing is a convenience method to update the spacing property value.

Parameters:

spacing	 the number of characters to put between children

type CBuilder

type CBuilder struct {
	cdk.CObject
	// contains filtered or unexported fields
}

func (*CBuilder) AddNamedSignalHandler

func (b *CBuilder) AddNamedSignalHandler(name string, fn cdk.SignalListenerFn)

func (*CBuilder) Build

func (b *CBuilder) Build(element *CBuilderElement) (newObject interface{})

func (*CBuilder) BuildableTypeTags

func (b *CBuilder) BuildableTypeTags() map[string]cdk.TypeTag

func (*CBuilder) GetWidget

func (b *CBuilder) GetWidget(name string) (w interface{})

func (*CBuilder) GetWidgetsBuiltByType

func (b *CBuilder) GetWidgetsBuiltByType(tag cdk.CTypeTag) (widgets []interface{})

func (*CBuilder) Init

func (b *CBuilder) Init() (already bool)

func (*CBuilder) LoadFromString

func (b *CBuilder) LoadFromString(raw string) (topElement *CBuilderElement, err error)

func (*CBuilder) LookupNamedSignalHandler

func (b *CBuilder) LookupNamedSignalHandler(name string) (fn cdk.SignalListenerFn)

func (*CBuilder) ParsePacking

func (b *CBuilder) ParsePacking(packing *CBuilderElement) (expand, fill bool, padding int, packType PackType)

type CBuilderElement

type CBuilderElement struct {
	TagName    string
	Content    string
	Builder    Builder
	Instance   interface{}
	Attributes map[string]string
	Properties map[string]string
	Signals    map[string]string
	Packing    map[string]string
	Children   []*CBuilderElement
}

func (*CBuilderElement) ApplyProperties

func (b *CBuilderElement) ApplyProperties()

func (*CBuilderElement) ApplyProperty

func (b *CBuilderElement) ApplyProperty(k, v string) (set bool)

func (*CBuilderElement) ApplySignal

func (b *CBuilderElement) ApplySignal(k, v string)

func (*CBuilderElement) ApplySignals

func (b *CBuilderElement) ApplySignals()

func (*CBuilderElement) String

func (b *CBuilderElement) String() string

type CButton

type CButton struct {
	CBin
	// contains filtered or unexported fields
}

The CButton structure implements the Button interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Button objects.

func MakeButton

func MakeButton() *CButton

MakeButton is used by the Buildable system to construct a new Button with a default label that is empty.

func NewButton

func NewButton() *CButton

NewButton is a constructor for new Button instances without a label Widget.

func NewButtonFromStock

func NewButtonFromStock(stockId StockID) (value *CButton)

NewButtonFromStock creates a NewButtonWithLabel containing the text from a stock item. If stock_id is unknown, it will be treated as a mnemonic label (as for NewWithMnemonic).

Parameters:

stockId	the name of the stock item

func NewButtonWithLabel

func NewButtonWithLabel(text string) (b *CButton)

NewButtonWithLabel will construct a NewButton with a NewLabel, pre-configured for a centered placement within the new Button instance, taking care to avoid focus complications and default event handling.

Parameters:

label	the text of the button

func NewButtonWithMnemonic

func NewButtonWithMnemonic(text string) (b *CButton)

NewButtonWithMnemonic creates a NewButtonWithLabel. If the characters in the label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.

Parameters:

label	the text of the button

func NewButtonWithWidget

func NewButtonWithWidget(w Widget) *CButton

NewButtonWithWidget creates a NewButton with the given Widget as the Button's child.

func (*CButton) Activate

func (b *CButton) Activate() (value bool)

Activate emits a SignalActivate, returning TRUE if the event was handled

func (*CButton) Build

func (b *CButton) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Button Widgets.

func (*CButton) CancelEvent

func (b *CButton) CancelEvent()

CancelEvent emits a cancel-event signal and if the signal handlers all return enums.EVENT_PASS, then set the button as not pressed and release any event focus.

func (*CButton) Clicked

func (b *CButton) Clicked() enums.EventFlag

Clicked emits a SignalClicked

func (*CButton) GetAlignment

func (b *CButton) GetAlignment() (xAlign float64, yAlign float64)

GetAlignment is a convenience method for returning both the x and y alignment property values.

Parameters:

xAlign	horizontal alignment
yAlign	vertical alignment

func (*CButton) GetFocusChain

func (b *CButton) GetFocusChain() (focusableWidgets []interface{}, explicitlySet bool)

GetFocusChain overloads the Container.GetFocusChain to always return the Button instance as the only item in the focus chain.

func (*CButton) GetFocusOnClick

func (b *CButton) GetFocusOnClick() (value bool)

GetFocusOnClick is a convenience method to return the focus-on-click property value. This is whether the button grabs focus when it is clicked with the mouse. See: SetFocusOnClick()

func (*CButton) GetImage

func (b *CButton) GetImage() (value Widget, ok bool)

GetImage is a convenience method to return the image property value. See: SetImage()

func (*CButton) GetImagePosition

func (b *CButton) GetImagePosition() (value PositionType)

GetImagePosition is a convenience method to return the image-position property value. See: SetImagePosition()

Note that usage of this within CTK is unimplemented at this time

func (*CButton) GetLabel

func (b *CButton) GetLabel() (value string)

GetLabel returns the text from the label of the button, as set by SetLabel. If the child Widget is not a Label, the value of the button label property will be returned instead. See: SetLabel()

func (*CButton) GetPressed

func (b *CButton) GetPressed() bool

GetPressed returns TRUE if the Button is currently pressed, FALSE otherwise.

func (*CButton) GetRelief

func (b *CButton) GetRelief() (value ReliefStyle)

GetRelief is a convenience method for returning the relief property value See: SetRelief()

func (*CButton) GetSizeRequest

func (b *CButton) GetSizeRequest() (width, height int)

GetSizeRequest returns the requested size of the Drawable Widget. This method is used by Container Widgets to resolve the surface space allocated for their child Widget instances.

func (*CButton) GetUseMarkup

func (b *CButton) GetUseMarkup() (enabled bool)

GetUseMarkup is a convenience method to return the use-markup property value. This is whether markup in the label text is rendered. See: SetUseMarkup()

func (*CButton) GetUseStock

func (b *CButton) GetUseStock() (value bool)

GetUseStock is a convenience method to return the use-stock property value. See: SetUseStock()

func (*CButton) GetUseUnderline

func (b *CButton) GetUseUnderline() (enabled bool)

GetUseUnderline is a convenience method to return the use-underline property value. This is whether an embedded underline in the button label indicates a mnemonic. See: SetUseUnderline()

func (*CButton) GetWidgetAt

func (b *CButton) GetWidgetAt(p *ptypes.Point2I) Widget

GetWidgetAt returns the Button instance if the position given is within the allocated size at the origin point of the Button. If the position given is not contained within the Button space, `nil` is returned.

func (*CButton) GrabEventFocus

func (b *CButton) GrabEventFocus()

GrabEventFocus will emit a grab-event-focus signal and if all signal handlers return enums.EVENT_PASS will set the Button instance as the Window event focus handler.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CButton) GrabFocus

func (b *CButton) GrabFocus()

GrabFocus will take the focus of the associated Window if the Widget instance CanFocus(). Any previously focused Widget will emit a lost-focus signal and the newly focused Widget will emit a gained-focus signal. This method emits a grab-focus signal initially and if the listeners return EVENT_PASS, the changes are applied.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CButton) Init

func (b *CButton) Init() (already bool)

Init initializes a Button object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Button instance. Init is used in the NewButton constructor and only necessary when implementing a derivative Button type.

func (*CButton) SetAlignment

func (b *CButton) SetAlignment(xAlign float64, yAlign float64)

SetAlignment is a convenience method for updating both the x and y alignment values. This property has no effect unless the child Widget implements the Alignable interface (ie: Misc based or Alignment Widget types).

Parameters:

xAlign	the horizontal position of the child, 0.0 is left aligned, 1.0 is right aligned
yAlign	the vertical position of the child, 0.0 is top aligned, 1.0 is bottom aligned

func (*CButton) SetFocusOnClick

func (b *CButton) SetFocusOnClick(focusOnClick bool)

SetFocusOnClick is a convenience method for updating the focus-on-click property value. This is whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application.

Parameters:

focusOnClick	whether the button grabs focus when clicked with the mouse

func (*CButton) SetImage

func (b *CButton) SetImage(image Widget)

SetImage is a convenience method to update the image property value.

Parameters:

image	a widget to set as the image for the button

Note that usage of this within CTK is unimplemented at this time

func (*CButton) SetImagePosition

func (b *CButton) SetImagePosition(position PositionType)

SetImagePosition is a convenience method to update the image-position property value. This sets the position of the image relative to the text inside the button.

Parameters:

position	the position

Note that usage of this within CTK is unimplemented at this time

func (*CButton) SetLabel

func (b *CButton) SetLabel(label string)

SetLabel will update the text of the child Label of the button to the given text. This text is also used to select the stock item if SetUseStock is used. This will also clear any previously set labels.

Parameters:

label	the Label text to apply

func (*CButton) SetPressed

func (b *CButton) SetPressed(pressed bool)

SetPressed is used to change the pressed state of the Button. If TRUE, the Button is flagged as pressed and a SignalPressed is emitted. If FALSE, the Button is flagged as not being pressed and a SignalReleased is emitted.

func (*CButton) SetRelief

func (b *CButton) SetRelief(newStyle ReliefStyle)

SetRelief is a convenience method for updating the relief property value

Note that usage of this within CTK is unimplemented at this time

func (*CButton) SetUseMarkup

func (b *CButton) SetUseMarkup(enabled bool)

SetUseMarkup is a convenience method to update the use-markup property value. If true, any Tango markup in the text of the button label will be rendered.

Parameters:

enabled	TRUE if markup is rendered

func (*CButton) SetUseStock

func (b *CButton) SetUseStock(useStock bool)

SetUseStock is a convenience method to update the use-stock property value. If TRUE, the label set on the button is used as a stock id to select the stock item for the button.

Parameters:

useStock	TRUE if the button should use a stock item

func (*CButton) SetUseUnderline

func (b *CButton) SetUseUnderline(enabled bool)

SetUseUnderline is a convenience method to update the use-underline property value and update the child Label settings. If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.

Parameters:

useUnderline	TRUE if underlines in the text indicate mnemonics

type CButtonBox

type CButtonBox struct {
	CBox
}

The CButtonBox structure implements the ButtonBox interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with ButtonBox objects.

func MakeButtonBox

func MakeButtonBox() *CButtonBox

MakeButtonBox is used by the Buildable system to construct a new horizontal homogeneous ButtonBox with no spacing between the Widget children.

func NewButtonBox

func NewButtonBox(orientation enums.Orientation, homogeneous bool, spacing int) *CButtonBox

NewButtonBox is a constructor for new Box instances.

func (*CButtonBox) Add

func (b *CButtonBox) Add(w Widget)

Add is a convenience method for adding the given Widget to the primary group with default PackStart configuration of: expand=true, fill=true and padding=0

func (*CButtonBox) Build

func (b *CButtonBox) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for ButtonBox Widgets.

func (*CButtonBox) GetChildPrimary

func (b *CButtonBox) GetChildPrimary(w Widget) (isPrimary bool)

GetChildPrimary is a convenience method that returns TRUE if the given Widget is in the primary grouping and returns FALSE otherwise.

Parameters:

child	a child of widget

func (*CButtonBox) GetChildSecondary

func (b *CButtonBox) GetChildSecondary(w Widget) (isSecondary bool)

GetChildSecondary is a convenience method that returns TRUE if the given Widget is in the primary grouping and returns FALSE otherwise.

Parameters:

child	a child of widget

func (*CButtonBox) GetLayout

func (b *CButtonBox) GetLayout() (value ButtonBoxStyle)

GetLayout is a convenience method for returning the layout-style property value as the ButtonBoxStyle type. See: SetLayout()

func (*CButtonBox) Init

func (b *CButtonBox) Init() (already bool)

Init initializes a ButtonBox object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the ButtonBox instance. Init is used in the NewButtonBox constructor and only necessary when implementing a derivative ButtonBox type.

func (*CButtonBox) PackEnd

func (b *CButtonBox) PackEnd(w Widget, expand, fill bool, padding int)

PackEnd will add the given Widget to the secondary group with the given Box packing configuration.

func (*CButtonBox) PackStart

func (b *CButtonBox) PackStart(w Widget, expand, fill bool, padding int)

PackStart will add the given Widget to the primary group with the given Box packing configuration.

func (*CButtonBox) Remove

func (b *CButtonBox) Remove(w Widget)

Remove the given Widget from the ButtonBox

func (*CButtonBox) SetChildPacking

func (b *CButtonBox) SetChildPacking(child Widget, expand bool, fill bool, padding int, packType PackType)

SetChildPacking is a convenience method to set the packing configuration for the given child Widget of the ButtonBox, regardless of which grouping the Widget is in.

Parameters:

child	the Widget of the child to set
expand	the new value of the expand child property
fill	the new value of the fill child property
padding	the new value of the padding child property
packType	the new value of the pack-type child property

func (*CButtonBox) SetChildSecondary

func (b *CButtonBox) SetChildSecondary(child Widget, isSecondary bool)

SetChildSecondary will ensure the given Widget is in the secondary grouping if the isSecondary argument is TRUE. If isSecondary is FALSE, this will ensure that the Widget is in the primary grouping.

Parameters:

child	a child of widget
secondary	TRUE, if the child appears in a secondary group

func (*CButtonBox) SetLayout

func (b *CButtonBox) SetLayout(layoutStyle ButtonBoxStyle)

SetLayout is a convenience method for updating the layout-style property for the ButtonBox. The normal expand and fill packing options are ignored in the context of a ButtonBox. The layout style instead defines the visual placement of the child widgets. The size request for each child determines it's allocation in the ButtonBox with the exception of the "expand" layout style in which the children are evenly allocated to consume all available space in the ButtonBox.

The different styles are as follows:

"start"      group Widgets from the starting edge
"end"        group Widgets from the ending edge
"center"     group Widgets together in the center, away from edges
"spread"     spread Widgets evenly and centered, away form edges
"edge"       spread Widgets evenly and centered, flush with edges
"expand"     expand all Widgets to evenly consume all available space

Note that usage of this within CTK is unimplemented at this time

type CContainer

type CContainer struct {
	CWidget
	// contains filtered or unexported fields
}

The CContainer structure implements the Container interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Container objects.

func MakeContainer added in v0.1.2

func MakeContainer() *CContainer

MakeContainer is used by the Buildable system to construct a new Container.

func NewContainer added in v0.1.2

func NewContainer() *CContainer

NewContainer is the constructor for new Container instances.

func (*CContainer) Add

func (c *CContainer) Add(w Widget)

Add the given Widget to the container. Typically this is used for simple containers such as Window, Frame, or Button; for more complicated layout containers such as Box or Table, this function will pick default packing parameters that may not be correct. So consider functions such as Box.PackStart() and Table.Attach() as an alternative to Container.Add() in those cases. A Widget may be added to only one container at a time; you can't place the same widget inside two different containers. This method emits an add signal initially and if the listeners return enums.EVENT_PASS then the change is applied.

Parameters:

widget	a widget to be placed inside container

func (*CContainer) AddWithProperties

func (c *CContainer) AddWithProperties(widget Widget, argv ...interface{})

AddWithProperties the given Widget to the Container, setting any given child properties at the same time. See: Add() and ChildSet()

Parameters:

widget	widget to be placed inside container
argv    list of property names and values

func (*CContainer) Build

func (c *CContainer) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Container Widgets.

func (*CContainer) ChildGet

func (c *CContainer) ChildGet(child Widget, properties ...cdk.Property) (values []interface{})

ChildGet returns the values of one or more child properties for the given child.

Parameters:

child          a widget which is a child of container
properties...  one or more property names

Returns:

an array of property values, in the order of the property names given, and
if the property named is not found, a Go error is returned for that
position of property names given

func (*CContainer) ChildSet

func (c *CContainer) ChildSet(child Widget, argv ...interface{})

ChildSet updates one or more child properties for the given child in the container.

Parameters:

	child	a widget which is a child of container
 argv    a list of property name and value pairs

func (*CContainer) ChildType

func (c *CContainer) ChildType() (value cdk.CTypeTag)

ChildType returns the type of the children supported by the container. Note that this may return TYPE_NONE to indicate that no more children can be added, e.g. for a Paned which already has two children.

Returns:

tag	a cdk.CTypeTag

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) FindChildProperty

func (c *CContainer) FindChildProperty(property cdk.Property) (value *cdk.CProperty)

FindChildProperty searches for a child property of a container by name.

Parameters:

property		the name of the child property to find

Returns:

value  the cdk.CProperty of the child property or nil if there is no child property with that name.

func (*CContainer) GetBorderWidth

func (c *CContainer) GetBorderWidth() (value int)

GetBorderWidth retrieves the border width of the Container. See: SetBorderWidth()

Returns:

the current border width

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) GetChildProperty

func (c *CContainer) GetChildProperty(child Widget, propertyName cdk.Property) (value interface{})

GetChildProperty returns the value of a child property for the given child. Parameters:

child	a widget which is a child of container
propertyName	the name of the property to get

Returns:

the value stored in the given property, or nil if the property

func (*CContainer) GetChildren

func (c *CContainer) GetChildren() (children []Widget)

GetChildren returns the container's non-internal children.

Returns:

children	list of Widget children

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) GetFocusChain

func (c *CContainer) GetFocusChain() (focusableWidgets []interface{}, explicitlySet bool)

GetFocusChain retrieves the focus chain of the container, if one has been set explicitly. If no focus chain has been explicitly set, CTK computes the focus chain based on the positions of the children.

Returns:

focusableWidgets	widgets in the focus chain.
explicitlySet       TRUE if the focus chain has been set explicitly.

func (*CContainer) GetFocusChild

func (c *CContainer) GetFocusChild() (value Widget)

GetFocusChild returns the current focus child widget inside container. This is not the currently focused widget. That can be obtained by calling Window.GetFocus().

Returns:

widget	child which will receive the focus inside container when the container is focussed, or NULL if none is set

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) GetFocusHAdjustment

func (c *CContainer) GetFocusHAdjustment() (value Adjustment)

GetFocusHAdjustment retrieves the horizontal focus adjustment for the container. See: SetFocusHAdjustment()

Returns:

adjustment	the horizontal focus adjustment, or NULL if none has been set

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) GetFocusVAdjustment

func (c *CContainer) GetFocusVAdjustment() (value Adjustment)

GetFocusVAdjustment retrieves the vertical focus adjustment for the container. See: SetFocusVAdjustment()

Returns:

adjustment	the vertical focus adjustment, or NULL if none has been set

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) GetWidgetAt

func (c *CContainer) GetWidgetAt(p *ptypes.Point2I) Widget

GetWidgetAt is a wrapper around the Widget.GetWidgetAt() method that if the Container has the given Point2I within it's bounds, will return itself, or if there is a child Widget at the given Point2I will return the child Widget. If the Container does not have the given point within it's bounds, will return nil

func (*CContainer) Init

func (c *CContainer) Init() (already bool)

Init initializes a Container object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Container instance. Init is used in the NewContainer constructor and only necessary when implementing a derivative Container type.

func (*CContainer) InstallChildProperty

func (c *CContainer) InstallChildProperty(name cdk.Property, kind cdk.PropertyType, write bool, def interface{}) error

InstallChildProperty adds a child property on a container.

func (*CContainer) ListChildProperties

func (c *CContainer) ListChildProperties() (properties []*cdk.CProperty)

ListChildProperties returns all child properties of a Container.

Parameters:

properties	list of *cdk.Property instances

func (*CContainer) Remove

func (c *CContainer) Remove(w Widget)

Remove the given Widget from the Container. Widget must be inside Container. This method emits a remove signal initially and if the listeners return enums.EVENT_PASS, the change is applied.

Parameters:

widget	a current child of container

func (*CContainer) ResizeChildren added in v0.1.2

func (c *CContainer) ResizeChildren()

ResizeChildren will call Resize on each child Widget.

func (*CContainer) SetBorderWidth

func (c *CContainer) SetBorderWidth(borderWidth int)

SetBorderWidth updates the border width of the Container. The border width of a container is the amount of space to leave around the outside of the container. The only exception to this is Window; because toplevel windows can't leave space outside, they leave the space inside. The border is added on all sides of the container. To add space to only one side, one approach is to create a Alignment widget, call Widget.SetSizeRequest to give it a size and place it on the side of the container as a spacer.

Parameters:

borderWidth	amount of blank space to leave outside the container

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) SetChildProperty

func (c *CContainer) SetChildProperty(child Widget, propertyName cdk.Property, value interface{})

SetChildProperty updates a child property for the given child.

Parameters:

child	a widget which is a child of container
propertyName	the name of the property to set
value	the value to set the property to

func (*CContainer) SetFocusChain

func (c *CContainer) SetFocusChain(focusableWidgets []interface{})

SetFocusChain updates a focus chain, overriding the one computed automatically by CTK. In principle each widget in the chain should be a descendant of the container, but this is not enforced by this method, since it's allowed to set the focus chain before you pack the widgets, or have a widget in the chain that isn't always packed. The necessary checks are done when the focus chain is actually traversed.

Parameters:

focusableWidgets	the new focus chain.

func (*CContainer) SetFocusChild

func (c *CContainer) SetFocusChild(child Widget)

SetFocusChild updates the focus child for the Container.

Parameters:

child	a Widget, or `nil`

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) SetFocusHAdjustment

func (c *CContainer) SetFocusHAdjustment(adjustment Adjustment)

SetFocusHAdjustment hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the horizontal alignment. See ScrolledWindow.GetHadjustment for a typical way of obtaining the adjustment and SetFocusVadjustment for setting the vertical adjustment.

Parameters:

adjustment	an adjustment which should be adjusted when the focus is moved among the descendents of container

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) SetFocusVAdjustment

func (c *CContainer) SetFocusVAdjustment(adjustment Adjustment)

SetFocusVAdjustment hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the vertical alignment. See ScrolledWindow.GetVAdjustment for a typical way of obtaining the adjustment and SetFocusHAdjustment for setting the horizontal adjustment.

Parameters:

adjustment	an adjustment which should be adjusted when the focus is moved among the descendents of container

Note that usage of this within CTK is unimplemented at this time

func (*CContainer) SetOrigin

func (c *CContainer) SetOrigin(x, y int)

SetOrigin emits an origin signal and if all signal handlers return enums.EVENT_PASS, updates the Container origin field while also setting all children to the same origin.

Note that this method's behaviour may change.

func (*CContainer) SetWindow

func (c *CContainer) SetWindow(w Window)

SetWindow sets the Container window field to the given Window and then does the same for each of the Widget children.

func (*CContainer) ShowAll

func (c *CContainer) ShowAll()

ShowAll is a convenience method to call Show on the Container itself and then call ShowAll for all Widget children.

func (*CContainer) UnsetFocusChain

func (c *CContainer) UnsetFocusChain()

UnsetFocusChain removes a focus chain explicitly set with SetFocusChain.

type CDialog

type CDialog struct {
	CWindow
	// contains filtered or unexported fields
}

The CDialog structure implements the Dialog interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Dialog objects.

func MakeDialog

func MakeDialog() *CDialog

MakeDialog is used by the Buildable system to construct a new Dialog.

func NewDialog

func NewDialog() (value *CDialog)

NewDialog is the constructor for new Dialog instances.

func NewDialogWithButtons

func NewDialogWithButtons(title string, parent Window, flags DialogFlags, argv ...interface{}) (value *CDialog)

NewDialogWithButtons creates a new Dialog with title, transient parent, a bitmask of DialogFlags and a variadic list of paired items. The items are the button ResponseType paired with a Button label string (which can be a ctk.StockID for access to the stock Buttons in CTK).

The `flags` argument can be used to make the dialog modal (ctk.DialogModal) and/or to have it destroyed along with its transient parent (ctk.DialogDestroyWithParent).

If the user clicks one of these Dialog Buttons, the Dialog will emit the response signal with the corresponding response ID. Buttons are from left to right, so the first button in the list will be the leftmost button in the Dialog.

Parameters:

title	label for the dialog
parent	Transient parent of the dialog, or `nil`
flags	from DialogFlags
argv	response ID with label pairs

func (*CDialog) AddActionWidget

func (d *CDialog) AddActionWidget(child Widget, responseId ResponseType)

AddActionWidget adds the given activatable widget to the action area of a Dialog, connecting a signal handler that will emit the response signal on the Dialog when the widget is activated. The widget is appended to the end of the Dialog's action area. If you want to add a non-activatable widget, simply pack it into the action_area field of the Dialog struct.

Parameters:

child	an activatable widget
responseId	response ID for child

func (*CDialog) AddButton

func (d *CDialog) AddButton(buttonText string, responseId ResponseType) (button Button)

AddButton is a convenience method for AddActionWidget to create a Button with the given text (or a stock button, if button_text is a StockID) and set things up so that clicking the button will emit the response signal with the given ResponseType. The Button is appended to the end of the dialog's action area. The button widget is returned, but usually you don't need it.

Parameters:

buttonText	text of button, or stock ID
responseId	response ID for the button

func (*CDialog) AddButtons

func (d *CDialog) AddButtons(argv ...interface{})

AddButtons is a convenience method for AddButton to create many buttons, in the same way as calling AddButton repeatedly. Each Button must have both ResponseType and label text provided.

Parameters:

argv	response ID with label pairs

func (*CDialog) AddSecondaryActionWidget

func (d *CDialog) AddSecondaryActionWidget(child Widget, responseId ResponseType)

AddSecondaryActionWidget is the same as AddActionWidget with the exception of adding the given Widget to the secondary action Button grouping instead of the primary grouping as with AddActionWidget.

func (*CDialog) Build

func (d *CDialog) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Dialog Widgets.

func (*CDialog) Destroy

func (d *CDialog) Destroy()

Destroy hides the Dialog, removes it from any transient Window associations, removes the Dialog from the Display and finally emits the destroy-event signal.

func (*CDialog) GetActionArea

func (d *CDialog) GetActionArea() (value ButtonBox)

GetActionArea returns the action area ButtonBox of a Dialog instance.

func (*CDialog) GetContentArea

func (d *CDialog) GetContentArea() (value VBox)

GetContentArea returns the content area VBox of a Dialog instance.

func (*CDialog) GetResponseForWidget

func (d *CDialog) GetResponseForWidget(widget Widget) (value ResponseType)

GetResponseForWidget is a convenience method for looking up the ResponseType associated with the given Widget in the Dialog action area. Returns ResponseNone if the Widget is not found in the action area of the Dialog.

Parameters:

widget	a widget in the action area of dialog

func (*CDialog) GetWidgetForResponse

func (d *CDialog) GetWidgetForResponse(responseId ResponseType) (value Widget)

GetWidgetForResponse returns the last Widget Button that uses the given ResponseType in the action area of a Dialog.

Parameters:

responseId	the response ID used by the dialog widget

func (*CDialog) Init

func (d *CDialog) Init() (already bool)

Init initializes a Dialog object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Dialog instance. Init is used in the NewDialog constructor and only necessary when implementing a derivative Dialog type.

func (*CDialog) Response

func (d *CDialog) Response(responseId ResponseType)

Response emits the response signal with the given response ID. Used to indicate that the user has responded to the dialog in some way; typically either you or Run will be monitoring the ::response signal and take appropriate action.

Parameters:

responseId	ResponseType identifier

func (*CDialog) Run

func (d *CDialog) Run() (response chan ResponseType)

Run in CTK, unlike the GTK equivalent, does not block the main thread. Run maintains its own internal main-loop process and returns a ResponseType channel so that once the user presses one of the action-buttons or closes the Dialog with ESC for example, the response channel can deliver the user-input to the Dialog calling code.

Before entering the recursive main loop, Run calls Show on the Dialog for you. Note that you still need to Show any children of the Dialog yourself. You can force Run to return at any time by calling Response to emit the ::response signal directly. Destroying the dialog during Run is a very bad idea, because your post-run code won't know whether the dialog was destroyed or not and there would likely be a closed-chan issue with the ResponseType channel.

After Run returns, you are responsible for hiding or destroying the dialog if you wish to do so.

func (*CDialog) SetDefaultResponse

func (d *CDialog) SetDefaultResponse(responseId ResponseType)

SetDefaultResponse updates which action Widget is activated when the user presses the ENTER key without changing the focused Widget first. The last Widget in the Dialog's action area with the given ResponseType as the default widget for the dialog.

Parameters:

responseId	a response ID

func (*CDialog) SetResponseSensitive

func (d *CDialog) SetResponseSensitive(responseId ResponseType, sensitive bool)

SetResponseSensitive calls Widget.SetSensitive for each widget in the Dialog's action area with the given Responsetype. A convenient way to sensitize/desensitize Dialog Buttons.

Parameters:

responseId	a response ID
setting	TRUE for sensitive

func (*CDialog) Show

func (d *CDialog) Show()

Show ensures that the Dialog, content and action areas are all set to VISIBLE

func (*CDialog) ShowAll

func (d *CDialog) ShowAll()

ShowAll calls ShowAll upon the Dialog, content area, action area and all the action Widget children.

type CEventBox

type CEventBox struct {
	CBin
}

The CEventBox structure implements the EventBox interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with EventBox objects.

func MakeEventBox

func MakeEventBox() *CEventBox

MakeEventBox is used by the Buildable system to construct a new EventBox.

func NewEventBox

func NewEventBox() (value *CEventBox)

NewEventBox is the constructor for new EventBox instances.

func (*CEventBox) Activate

func (b *CEventBox) Activate() (value bool)

Activate will emit an activate signal and return TRUE if the signal handlers return EVENT_STOP indicating that the event was in fact handled.

func (*CEventBox) CancelEvent

func (b *CEventBox) CancelEvent()

CancelEvent will emit a cancel-event signal.

func (*CEventBox) GetAboveChild

func (b *CEventBox) GetAboveChild() (value bool)

GetAboveChild returns whether the event box window is above or below the windows of its child. See: SetAboveChild()

func (*CEventBox) GetVisibleWindow

func (b *CEventBox) GetVisibleWindow() (value bool)

GetVisibleWindow returns whether the event box has a visible window. See: SetVisibleWindow()

func (*CEventBox) GrabEventFocus added in v0.1.4

func (b *CEventBox) GrabEventFocus()

GrabEventFocus will emit a grab-event-focus signal and if all signal handlers return enums.EVENT_PASS will set the Button instance as the Window event focus handler.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CEventBox) GrabFocus

func (b *CEventBox) GrabFocus()

GrabFocus will take the focus of the associated Window if the Widget instance CanFocus(). Any previously focused Widget will emit a lost-focus signal and the newly focused Widget will emit a gained-focus signal. This method emits a grab-focus signal initially and if the listeners return EVENT_PASS, the changes are applied.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CEventBox) Init

func (b *CEventBox) Init() (already bool)

Init initializes a EventBox object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the EventBox instance. Init is used in the NewEventBox constructor and only necessary when implementing a derivative EventBox type.

func (*CEventBox) ProcessEvent

func (b *CEventBox) ProcessEvent(evt cdk.Event) enums.EventFlag

ProcessEvent manages the processing of events, current this is just emitting a cdk-event signal and returning the result.

func (*CEventBox) SetAboveChild

func (b *CEventBox) SetAboveChild(aboveChild bool)

SetAboveChild updates whether the event box window is positioned above the windows of its child, as opposed to below it. If the window is above, all events inside the event box will go to the event box. If the window is below, events in windows of child widgets will first got to that widget, and then to its parents. The default is to keep the window below the child.

Parameters:

aboveChild	TRUE if the event box window is above the windows of its child

func (*CEventBox) SetVisibleWindow

func (b *CEventBox) SetVisibleWindow(visibleWindow bool)

SetVisibleWindow updates whether the event box uses a visible or invisible child window. The default is to use visible windows. In an invisible window event box, the window that the event box creates is a GDK_INPUT_ONLY window, which means that it is invisible and only serves to receive events. A visible window event box creates a visible (GDK_INPUT_OUTPUT) window that acts as the parent window for all the widgets contained in the event box. You should generally make your event box invisible if you just want to trap events. Creating a visible window may cause artifacts that are visible to the user. The main reason to create a non input-only event box is if you want to set the background to a different color or draw on it.

Parameters:

visibleWindow	boolean value

type CFakeWindow

type CFakeWindow struct {
	CWindow
}

func (*CFakeWindow) Init

func (f *CFakeWindow) Init() (already bool)

type CFrame

type CFrame struct {
	CBin
	// contains filtered or unexported fields
}

The CFrame structure implements the Frame interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Frame objects.

func MakeFrame

func MakeFrame() *CFrame

MakeFrame is used by the Buildable system to construct a new Frame.

func NewFrame

func NewFrame(text string) *CFrame

NewFrame is the constructor for new Frame instances.

func NewFrameWithWidget

func NewFrameWithWidget(w Widget) *CFrame

NewFrameWithWidget will construct a new Frame with the given widget instead of the default Label.

func (*CFrame) Add

func (f *CFrame) Add(w Widget)

Add will add the given Widget to the Frame. As the Frame Widget is of Bin type, any previous child Widget is removed first.

func (*CFrame) GetFocusWithChild

func (f *CFrame) GetFocusWithChild() (focusWithChild bool)

GetFocusWithChild returns true if the Frame is supposed to follow the focus of its child Widget or if it should follow its own focus. See: SetFocusWithChild()

func (*CFrame) GetLabel

func (f *CFrame) GetLabel() (value string)

GetLabel returns the text in the label Widget, if the Widget is in fact of Label Widget type. If the label Widget is not an actual Label, the value of the Frame label property is returned.

Returns:

the text in the label, or NULL if there was no label widget or
the label widget was not a Label. This string is owned by
CTK and must not be modified or freed.

func (*CFrame) GetLabelAlign

func (f *CFrame) GetLabelAlign() (xAlign float64, yAlign float64)

GetLabelAlign retrieves the X and Y alignment of the frame's label. If the label Widget is not of Label Widget type, then the values of the label-x-align and label-y-align properties are returned. See: SetLabelAlign()

Parameters:

xAlign	X alignment of frame's label
yAlign	Y alignment of frame's label

func (*CFrame) GetLabelWidget

func (f *CFrame) GetLabelWidget() (value Widget)

GetLabelWidget retrieves the label widget for the Frame. See: SetLabelWidget()

func (*CFrame) GetShadowType

func (f *CFrame) GetShadowType() (value ShadowType)

Retrieves the shadow type of the frame. See SetShadowType. Returns:

the current shadow type of the frame.

func (*CFrame) GetSizeRequest

func (f *CFrame) GetSizeRequest() (width, height int)

GetSizeRequest returns the requested size of the Frame, taking into account any children and their size requests.

func (*CFrame) GetWidgetAt

func (f *CFrame) GetWidgetAt(p *ptypes.Point2I) Widget

GetWidgetAt returns the Widget at the given point within the Frame. Widgets that are not visible are ignored.

func (*CFrame) GrabFocus

func (f *CFrame) GrabFocus()

If the Widget instance CanFocus() then take the focus of the associated Window. Any previously focused Widget will emit a lost-focus signal and the newly focused Widget will emit a gained-focus signal. This method emits a grab-focus signal initially and if the listeners return EVENT_PASS, the changes are applied

Emits: SignalGrabFocus, Argv=[Widget instance] Emits: SignalLostFocus, Argv=[Previous focus Widget instance], From=Previous focus Widget instance Emits: SignalGainedFocus, Argv=[Widget instance, previous focus Widget instance]

func (*CFrame) Init

func (f *CFrame) Init() (already bool)

Init initializes a Frame object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Frame instance. Init is used in the NewFrame constructor and only necessary when implementing a derivative Frame type.

func (*CFrame) IsFocus

func (f *CFrame) IsFocus() bool

IsFocus is a convenience method for returning whether the child Widget is the focused Widget. If no child Widget exists, or the child Widget cannot be focused itself, then the return value is whether the Frame itself is the focused Widget.

func (*CFrame) Remove

func (f *CFrame) Remove(w Widget)

Remove will remove the given Widget from the Frame.

func (*CFrame) SetFocusWithChild

func (f *CFrame) SetFocusWithChild(focusWithChild bool)

SetFocusWithChild updates whether or not the Frame's theme will reflect the focused state of the Frame's child Widget.

func (*CFrame) SetLabel

func (f *CFrame) SetLabel(label string)

SetLabel updates the text of the Label.

Parameters:

label	the text to use as the label of the frame.

func (*CFrame) SetLabelAlign

func (f *CFrame) SetLabelAlign(xAlign float64, yAlign float64)

SetLabelAlign is a convenience method for setting the label-x-align and label-y-align properties of the Frame. The default values for a newly created frame are 0.0 and 0.5. If the label Widget is in fact of Label Widget type, SetAlignment with the given x and y alignment values.

Parameters:

xAlign	The position of the label along the top edge of the widget. A value
        of 0.0 represents left alignment; 1.0 represents right alignment.
yAlign	The y alignment of the label. A value of 0.0 aligns under the frame;
        1.0 aligns above the frame. If the values are exactly 0.0 or 1.0 the
        gap in the frame won't be painted because the label will be
        completely above or below the frame.

func (*CFrame) SetLabelWidget

func (f *CFrame) SetLabelWidget(labelWidget Widget)

SetLabelWidget removes any existing Widget and replaces it with the given one. This is the widget that will appear embedded in the top edge of the frame as a title.

Parameters:

labelWidget	the new label widget

func (*CFrame) SetShadowType

func (f *CFrame) SetShadowType(shadowType ShadowType)

SetShadowType updates the shadow-type property for the Frame.

Parameters:

type	the new ShadowType

Note that usage of this within CTK is unimplemented at this time

type CHBox

type CHBox struct {
	CBox
}

func MakeHBox

func MakeHBox() *CHBox

func NewHBox

func NewHBox(homogeneous bool, spacing int) *CHBox

func (*CHBox) Init

func (b *CHBox) Init() bool

type CHButtonBox

type CHButtonBox struct {
	CButtonBox
}

func MakeHButtonBox

func MakeHButtonBox() *CHButtonBox

func NewHButtonBox

func NewHButtonBox(homogeneous bool, spacing int) *CHButtonBox

func (*CHButtonBox) Init

func (b *CHButtonBox) Init() bool

type CHScrollbar

type CHScrollbar struct {
	CScrollbar
}

func MakeHScrollbar

func MakeHScrollbar() *CHScrollbar

func NewHScrollbar

func NewHScrollbar() *CHScrollbar

func (*CHScrollbar) Init

func (s *CHScrollbar) Init() (already bool)

type CLabel

type CLabel struct {
	CMisc
	// contains filtered or unexported fields
}

The CLabel structure implements the Label interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Label objects.

func MakeLabel

func MakeLabel() *CLabel

MakeLabel is used by the Buildable system to construct a new Label.

func NewLabel

func NewLabel(plain string) *CLabel

NewLabel is the constructor for new Label instances.

func NewLabelWithMarkup

func NewLabelWithMarkup(markup string) (label *CLabel, err error)

NewLabelWithMarkup creates a new Label, containing the text given and if the text contains Tango markup, the rendered text will display accordingly.

func NewLabelWithMnemonic

func NewLabelWithMnemonic(label string) (value *CLabel)

NewLabelWithMnemonic creates a new Label, containing the text given. If characters in the string are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using SetMnemonicWidget. If SetMnemonicWidget is not called, then the first activatable ancestor of the Label will be chosen as the mnemonic widget. For instance, if the label is inside a button or menu item, the button or menu item will automatically become the mnemonic widget and be activated by the mnemonic.

Parameters:

label	text, with an underscore in front of the mnemonic character

func (*CLabel) Build

func (l *CLabel) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Label Widgets.

func (*CLabel) GetAttributes

func (l *CLabel) GetAttributes() (value paint.Style)

GetAttributes returns the attribute list that was set on the label using SetAttributes, if any. This function does not reflect attributes that come from the labels markup (see SetMarkup).

func (*CLabel) GetCleanText

func (l *CLabel) GetCleanText() (text string)

GetCleanText filters the result of GetClearText to strip leading underscores.

func (*CLabel) GetClearText

func (l *CLabel) GetClearText() (text string)

GetClearText returns the Label's text, stripped of markup.

func (*CLabel) GetCurrentUri

func (l *CLabel) GetCurrentUri() (value string)

GetCurrentUri returns the URI for the currently active link in the label. The active link is the one under the mouse pointer or, in a selectable label, the link in which the text cursor is currently positioned. This function is intended for use in a activate-link handler or for use in a query-tooltip handler.

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) GetEllipsize

func (l *CLabel) GetEllipsize() (value bool)

GetEllipsize returns the ellipsizing state of the label. See: SetEllipsize()

func (*CLabel) GetJustify

func (l *CLabel) GetJustify() (value enums.Justification)

GetJustify returns the justification of the label. See: SetJustify()

func (*CLabel) GetLabel

func (l *CLabel) GetLabel() (value string)

GetLabel returns the text from a label widget including any embedded underlines indicating mnemonics and Tango markup. See: GetText()

func (*CLabel) GetLineWrap

func (l *CLabel) GetLineWrap() (value bool)

GetLineWrap returns whether lines in the label are automatically wrapped. See: SetLineWrap()

func (*CLabel) GetLineWrapMode

func (l *CLabel) GetLineWrapMode() (value enums.WrapMode)

GetLineWrapMode returns line wrap mode used by the label. See: SetLineWrapMode()

func (*CLabel) GetMaxWidthChars

func (l *CLabel) GetMaxWidthChars() (value int)

GetMaxWidthChars retrieves the desired maximum width of label, in characters. See: SetWidthChars()

func (*CLabel) GetMnemonicKeyVal

func (l *CLabel) GetMnemonicKeyVal() (value rune)

GetMnemonicKeyVal returns the mnemonic character in the Label text if the Label has been set so that it has an mnemonic key. Rhis function returns the keyval used for the mnemonic accelerator. If there is no mnemonic set up it returns `rune(0)`.

Returns:

value	keyval usable for accelerators

func (*CLabel) GetMnemonicWidget

func (l *CLabel) GetMnemonicWidget() (value Widget)

GetMnemonicWidget retrieves the target of the mnemonic (keyboard shortcut) of this Label. See: SetMnemonicWidget()

func (*CLabel) GetPlainText

func (l *CLabel) GetPlainText() (text string)

GetPlainText returns the Label's text, stripped of markup and mnemonics.

func (*CLabel) GetPlainTextInfo

func (l *CLabel) GetPlainTextInfo() (maxWidth, lineCount int)

GetPlainTextInfo returns the maximum line width and line count.

func (*CLabel) GetPlainTextInfoAtWidth

func (l *CLabel) GetPlainTextInfoAtWidth(width int) (maxWidth, lineCount int)

GetPlainTextInfoAtWidth returns the maximum line width and line count, with the given width as an override to the value set with SetMaxWidthChars. This is used primarily for pre-rendering stages like Resize to determine the size allocations without having to render the actual text with Tango first.

func (*CLabel) GetSelectable

func (l *CLabel) GetSelectable() (value bool)

GetSelectable returns the value set by SetSelectable.

func (*CLabel) GetSelectionBounds

func (l *CLabel) GetSelectionBounds() (start int, end int, nonEmpty bool)

GetSelectionBounds returns the selected range of characters in the label, returning TRUE for nonEmpty if there's a selection.

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) GetSingleLineMode

func (l *CLabel) GetSingleLineMode() (value bool)

GetSingleLineMode returns whether the label is in single line mode.

func (*CLabel) GetSizeRequest

func (l *CLabel) GetSizeRequest() (width, height int)

GetSizeRequest returns the requested size of the Label taking into account the label's content and any padding set.

func (*CLabel) GetText

func (l *CLabel) GetText() (value string)

GetText returns the text from a label widget, as displayed on the screen. This does not include any embedded underlines indicating mnemonics or Tango markup. See: GetLabel

func (l *CLabel) GetTrackVisitedLinks() (value bool)

GetTrackVisitedLinks returns whether the label is currently keeping track of clicked links.

Returns:

TRUE if clicked links are remembered

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) GetUseMarkup

func (l *CLabel) GetUseMarkup() (value bool)

GetUseMarkup returns whether the label's text is interpreted as marked up with the Tango text markup language. See: SetUseMarkup()

func (*CLabel) GetUseUnderline

func (l *CLabel) GetUseUnderline() (value bool)

GetUseUnderline returns whether an embedded underline in the label indicates a mnemonic. See: SetUseUnderline()

func (*CLabel) GetWidthChars

func (l *CLabel) GetWidthChars() (value int)

GetWidthChars retrieves the desired width of label, in characters. See: SetWidthChars()

func (*CLabel) Init

func (l *CLabel) Init() (already bool)

Init initializes a Label object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Label instance. Init is used in the NewLabel constructor and only necessary when implementing a derivative Label type.

func (*CLabel) SelectRegion

func (l *CLabel) SelectRegion(startOffset int, endOffset int)

SelectRegion selects a range of characters in the label, if the label is selectable. If the label is not selectable, this function has no effect. If start_offset or end_offset are -1, then the end of the label will be substituted. See: SetSelectable()

Parameters:

startOffset	start offset (in characters not bytes)
endOffset	end offset (in characters not bytes)

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) SetAttributes

func (l *CLabel) SetAttributes(attrs paint.Style)

SetAttributes updates the attributes property to be the given paint.Style.

Parameters:

attrs	a paint.Style

func (*CLabel) SetEllipsize

func (l *CLabel) SetEllipsize(mode bool)

SetEllipsize updates the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string.

Parameters:

mode	bool

func (*CLabel) SetJustify

func (l *CLabel) SetJustify(justify enums.Justification)

SetJustify updates the alignment of the lines in the text of the label relative to each other. JUSTIFY_LEFT is the default value when the widget is first created with New. If you instead want to set the alignment of the label as a whole, use SetAlignment instead.

SetJustify has no effect on labels containing only a single line.

Parameters:

jtype	a Justification

func (*CLabel) SetLabel

func (l *CLabel) SetLabel(str string)

SetLabel updates the text of the label. The label is interpreted as including embedded underlines and/or Pango markup depending on the values of the use-underline and use-markup properties.

Parameters:

str	the new text to set for the label

func (*CLabel) SetLineWrap

func (l *CLabel) SetLineWrap(wrap bool)

SetLineWrap updates the line wrapping within the Label widget. TRUE makes it break lines if text exceeds the widget's size. FALSE lets the text get cut off by the edge of the widget if it exceeds the widget size. Note that setting line wrapping to TRUE does not make the label wrap at its parent container's width, because CTK widgets conceptually can't make their requisition depend on the parent container's size. For a label that wraps at a specific position, set the label's width using SetSizeRequest.

Parameters:

wrap	the setting

func (*CLabel) SetLineWrapMode

func (l *CLabel) SetLineWrapMode(wrapMode enums.WrapMode)

SetLineWrapMode updates the line wrapping if line-wrap is on (see SetLineWrap) this controls how the line wrapping is done. The default is WRAP_WORD which means wrap on word boundaries.

Parameters:

wrapMode	the line wrapping mode

func (*CLabel) SetMarkup

func (l *CLabel) SetMarkup(text string) (parseError error)

SetMarkup parses text which is marked up with the Tango text markup language, setting the Label's text and attribute list based on the parse results.

Parameters:

text	a markup string (see Tango markup format)

func (*CLabel) SetMarkupWithMnemonic

func (l *CLabel) SetMarkupWithMnemonic(str string) (err error)

SetMarkupWithMnemonic parses str which is marked up with the Tango text markup language, setting the label's text and attribute list based on the parse results. If characters in str are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using SetMnemonicWidget.

Parameters:

str	a markup string (see Pango markup format)

func (*CLabel) SetMaxWidthChars

func (l *CLabel) SetMaxWidthChars(nChars int)

SetMaxWidthChars updates the desired maximum width in characters of label to nChars.

Parameters:

nChars	the new desired maximum width, in characters.

func (*CLabel) SetMnemonicWidget

func (l *CLabel) SetMnemonicWidget(widget Widget)

SetMnemonicWidget updates the mnemonic-widget property with the given Widget. If the label has been set so that it has a mnemonic key (using i.e. SetMarkupWithMnemonic, SetTextWithMnemonic, NewWithMnemonic or the use-underline property) the label can be associated with a widget that is the target of the mnemonic. When the label is inside a widget (like a Button or a Notebook tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is a Entry next to the label) you need to set it explicitly using this function. The target widget will be accelerated by emitting the mnemonic-activate signal on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.

Parameters:

widget	the target Widget.

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) SetSelectable

func (l *CLabel) SetSelectable(setting bool)

SetSelectable updates the selectable property for the Label. Labels allow the user to select text from the label, for copy-and-paste.

Parameters:

setting	TRUE to allow selecting text in the label

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) SetSingleLineMode

func (l *CLabel) SetSingleLineMode(singleLineMode bool)

SetSingleLineMode updates whether the label is in single line mode.

Parameters:

singleLineMode	TRUE if the label should be in single line mode

func (*CLabel) SetText

func (l *CLabel) SetText(text string)

SetText updates the text within the Label widget. It overwrites any text that was there before. This will also clear any previously set mnemonic accelerators.

Parameters:

text	the text you want to set

func (*CLabel) SetTextWithMnemonic

func (l *CLabel) SetTextWithMnemonic(str string)

SetTextWithMnemonic updates the Label's text from the string str. If characters in str are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using SetMnemonicWidget.

Parameters:

str	a string
func (l *CLabel) SetTrackVisitedLinks(trackLinks bool)

SetTrackVisitedLinks updates whether the label should keep track of clicked links (and use a different color for them).

Parameters:

trackLinks	TRUE to track visited links

Note that usage of this within CTK is unimplemented at this time

func (*CLabel) SetUseMarkup

func (l *CLabel) SetUseMarkup(setting bool)

SetUseMarkup updates whether the text of the label contains markup in Tango's text markup language. See: SetMarkup()

Parameters:

setting	TRUE if the label's text should be parsed for markup.

func (*CLabel) SetUseUnderline

func (l *CLabel) SetUseUnderline(setting bool)

SetUseUnderline updates the use-underline property for the Lable. If TRUE, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

Parameters:

setting	TRUE if underlines in the text indicate mnemonics

func (*CLabel) SetWidthChars

func (l *CLabel) SetWidthChars(nChars int)

SetWidthChars updates the desired width in characters of label to nChars.

Parameters:

nChars	the new desired width, in characters.

type CListDragPos

type CListDragPos uint64

List drag pos

const (
	CLIST_DRAC_NONE CListDragPos = iota
	CLIST_DRAC_BEFORE
	CLIST_DRAC_INTO
	CLIST_DRAC_AFTER
)

type CMisc

type CMisc struct {
	CWidget
}

The CMisc structure implements the Misc interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Misc objects.

func (*CMisc) GetAlignment

func (m *CMisc) GetAlignment() (xAlign float64, yAlign float64)

GetAlignment returns the X and Y alignment of the widget within its allocation. See: SetAlignment()

func (*CMisc) GetPadding

func (m *CMisc) GetPadding() (xPad int, yPad int)

GetPadding returns the padding in the X and Y directions of the widget. See: SetPadding()

func (*CMisc) Init

func (m *CMisc) Init() (already bool)

Init initializes a Misc object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Misc instance. Init is used in the NewMisc constructor and only necessary when implementing a derivative Misc type.

func (*CMisc) SetAlignment

func (m *CMisc) SetAlignment(xAlign float64, yAlign float64)

SetAlignment is a convenience method to set the x-align and y-align properties of the Misc Widget.

func (*CMisc) SetPadding

func (m *CMisc) SetPadding(xPad int, yPad int)

SetPadding is a convenience method to set x-pad and y-pad properties of the Misc Widget.

type CObject

type CObject struct {
	cdk.CObject
	// contains filtered or unexported fields
}

The CObject structure implements the Object interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Object objects.

func (*CObject) Build

func (o *CObject) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Object Widgets.

func (*CObject) CssSelector

func (o *CObject) CssSelector() (selector string)

CssSelector returns a selector string identifying this exact Object instance.

func (*CObject) GetAllocation

func (o *CObject) GetAllocation() ptypes.Rectangle

GetAllocation returns the current allocation size of the Object instance.

func (*CObject) GetCssBool

func (o *CObject) GetCssBool(name cdk.Property, state StateType) (value bool, err error)

GetCssBool is a convenience method to return a boolean value for the CSS property of the given name.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssColor

func (o *CObject) GetCssColor(name cdk.Property, state StateType) (value paint.Color, err error)

GetCssColor is a convenience method to return a paint.Color value for the CSS property of the given name.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssFloat

func (o *CObject) GetCssFloat(name cdk.Property, state StateType) (value float64, err error)

GetCssFloat is a convenience method to return a float value for the CSS property of the given name.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssInt

func (o *CObject) GetCssInt(name cdk.Property, state StateType) (value int, err error)

GetCssInt is a convenience method to return a int value for the CSS property of the given name.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssProperties

func (o *CObject) GetCssProperties() (properties map[StateType][]*CStyleProperty)

GetCssProperties returns all the installed CSS properties for the Object.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssProperty

func (o *CObject) GetCssProperty(name cdk.Property, state StateType) (property *CStyleProperty)

GetCssProperty returns the cdk.Property instance of the property found with the name given, returning `nil` if no property by the name given is found.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssString

func (o *CObject) GetCssString(name cdk.Property, state StateType) (value string, err error)

GetCssString is a convenience method to return a string value for the CSS property of the given name.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetCssValue added in v0.1.2

func (o *CObject) GetCssValue(name cdk.Property, state StateType) (value interface{})

GetCssValue returns the value of the property found with the same name as the given name.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) GetObjectAt

func (o *CObject) GetObjectAt(p *ptypes.Point2I) Object

GetObjectAt returns the Object's instance if the given point is within the Object's display space bounds. This method is mainly used by Window objects and other event processing Widgets that need to find a Widget by mouse-cursor coordinates for example. If this Object does not encompass the point given, it returns `nil`.

func (*CObject) GetOrigin

func (o *CObject) GetOrigin() ptypes.Point2I

GetOrigin returns the current origin point of the Object instance

func (*CObject) GetTextDirection

func (o *CObject) GetTextDirection() (direction TextDirection)

GetTextDirection returns the current text direction for this Object instance.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) HasPoint

func (o *CObject) HasPoint(p *ptypes.Point2I) (contains bool)

HasPoint determines whether the given point is within the Object's display space bounds.

func (*CObject) Init

func (o *CObject) Init() (already bool)

Init initializes an Object instance. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Object instance. Init is used in the NewObject constructor and only necessary when implementing a derivative Object type.

func (*CObject) InstallCssProperty

func (o *CObject) InstallCssProperty(name cdk.Property, state StateType, kind cdk.PropertyType, write bool, def interface{}) (err error)

InstallCssProperty installs a new cdk.Property in a secondary CSS-focused property list.

Note that usage of this within CTK is unimplemented at this time

func (*CObject) Invalidate

func (o *CObject) Invalidate() enums.EventFlag

Invalidate emits an invalidate signal, primarily used in other CTK types which are drawable and need an opportunity to invalidate the memphis surfaces so that the next CTK draw cycle can reflect the latest changes to the Object instance.

func (*CObject) ObjectInfo

func (o *CObject) ObjectInfo() string

ObjectInfo is a convenience method to return a string identifying the Object instance with its type, unique identifier, name if set (see SetName()), the origin point and current size allocation.

func (*CObject) ProcessEvent

func (o *CObject) ProcessEvent(evt cdk.Event) enums.EventFlag

ProcessEvent emits a cdk-event signal, primarily used to consume CDK events received such as mouse or key events in other CTK and custom types that embed CObject.

func (*CObject) Resize

func (o *CObject) Resize() enums.EventFlag

Resize emits a resize signal, primarily used to make adjustments or otherwise reallocate resources necessary for subsequent draw events.

func (*CObject) SetAllocation

func (o *CObject) SetAllocation(size ptypes.Rectangle)

SetAllocation updates the allocated size of the Object instance. This method is only useful for custom CTK types that need to render child Widgets. This method emits an allocation signal initially and if the listeners return EVENT_PASS the change is applied and constrained to a minimum width and height of zero.

func (*CObject) SetCssPropertyFromStyle added in v0.1.4

func (o *CObject) SetCssPropertyFromStyle(key, value string) (err error)

func (*CObject) SetOrigin

func (o *CObject) SetOrigin(x, y int)

SetOrigin updates the origin of this instance in display space. This method emits an origin signal initially and if the listeners return EVENT_PASS then the change is applied.

Emits: SignalOrigin, Argv=[Object instance, new origin]

func (*CObject) SetTextDirection

func (o *CObject) SetTextDirection(direction TextDirection)

SetTextDirection updates text direction for this Object instance. This method emits a text-direction signal initially and if the listeners return EVENT_PASS, the change is applied.

Note that usage of this within CTK is unimplemented at this time

type CRange

type CRange struct {
	CWidget
	// contains filtered or unexported fields
}

The CRange structure implements the Range interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Range objects.

func (*CRange) GetAdjustment

func (r *CRange) GetAdjustment() (adjustment *CAdjustment)

GetAdjustment returns the Adjustment which is the "model" object for Range. See: SetAdjustment()

func (*CRange) GetFillLevel

func (r *CRange) GetFillLevel() (value float64)

GetFillLevel returns the current position of the fill level indicator.

func (*CRange) GetFlippable

func (r *CRange) GetFlippable() (value bool)

GetFlippable returns the value set by SetFlippable.

func (*CRange) GetIncrements

func (r *CRange) GetIncrements() (step int, page int)

GetIncrements returns the step and page sizes for the range. The step size is used when the user clicks the Scrollbar arrows or moves Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

func (*CRange) GetInverted

func (r *CRange) GetInverted() (value bool)

GetInverted returns the value set by SetInverted.

func (*CRange) GetLowerStepperSensitivity

func (r *CRange) GetLowerStepperSensitivity() (value SensitivityType)

GetLowerStepperSensitivity updates the sensitivity policy for the stepper that points to the 'lower' end of the Range's adjustment.

func (*CRange) GetMinSliderLength

func (r *CRange) GetMinSliderLength() (length int)

GetMinSliderLength returns the minimum slider length. This method is useful mainly for Range subclasses. See: SetMinSliderLength()

func (*CRange) GetMinSliderSize

func (r *CRange) GetMinSliderSize() (value int)

GetMinSliderSize returns the minimum slider size. This method is useful mainly for Range subclasses. See: SetMinSliderSize()

Note that usage of this within CTK is unimplemented at this time

func (*CRange) GetRange

func (r *CRange) GetRange() (min, max int)

GetRange returns the allowable values in the Range.

func (*CRange) GetRangeRect

func (r *CRange) GetRangeRect() (rangeRect ptypes.Rectangle)

GetRangeRect returns the area that contains the range's trough and its steppers, in widget->window coordinates. This function is useful mainly for Range subclasses.

Note that usage of this within CTK is unimplemented at this time

func (*CRange) GetRestrictToFillLevel

func (r *CRange) GetRestrictToFillLevel() (value bool)

GetRestricttoFillLevel returns whether the range is restricted to the fill level.

func (*CRange) GetRoundDigits

func (r *CRange) GetRoundDigits() (value int)

GetRoundDigits returns the number of digits to round the value to when it changes.

func (*CRange) GetShowFillLevel

func (r *CRange) GetShowFillLevel() (value bool)

GetShowFillLevel returns whether the range displays the fill level graphically.

func (*CRange) GetSliderLength

func (r *CRange) GetSliderLength() (length int)

GetSliderLength returns the length of the scrollbar or scale thumb.

func (*CRange) GetSliderRange

func (r *CRange) GetSliderRange() (sliderStart int, sliderEnd int)

GetSliderRange returns sliders range along the long dimension, in widget->window coordinates. This function is useful mainly for Range subclasses.

Note that usage of this within CTK is unimplemented at this time

func (*CRange) GetSliderSizeFixed

func (r *CRange) GetSliderSizeFixed() (value bool)

GetSliderSizeFixed returns whether the slider size is fixed or not. This method is useful mainly for Range subclasses. See: SetSliderSizeFixed()

Note that usage of this within CTK is unimplemented at this time

func (*CRange) GetStepperSize

func (r *CRange) GetStepperSize() (size int)

GetStepperSize returns the length of step buttons at ends.

func (*CRange) GetStepperSpacing

func (r *CRange) GetStepperSpacing() (spacing int)

GetStepperSpacing returns the spacing between the stepper buttons and thumb. Note that setting this value to anything > 0 will automatically set the trough-under-steppers style property to TRUE as well. Also, stepper-spacing won't have any effect if there are no steppers.

func (*CRange) GetTroughUnderSteppers

func (r *CRange) GetTroughUnderSteppers() (underSteppers bool)

GetTroughUnderSteppers returns whether to draw the trough across the full length of the range or to exclude the steppers and their spacing. Note that setting the stepper-spacing style property to any value > 0 will automatically enable trough-under-steppers too.

func (*CRange) GetUpperStepperSensitivity

func (r *CRange) GetUpperStepperSensitivity() (value SensitivityType)

GetUpperStepperSensitivity updates the sensitivity policy for the stepper that points to the 'upper' end of the Range's adjustment.

func (*CRange) GetValue

func (r *CRange) GetValue() (value int)

GetValue returns the current value of the range.

func (*CRange) Init

func (r *CRange) Init() (already bool)

Init initializes a Range object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Range instance. Init is used in the NewRange constructor and only necessary when implementing a derivative Range type.

func (*CRange) SetFillLevel

func (r *CRange) SetFillLevel(fillLevel float64)

SetFillLevel updates the new position of the fill level indicator. The "fill level" is probably best described by its most prominent use case, which is an indicator for the amount of pre-buffering in a streaming media player. In that use case, the value of the range would indicate the current play position, and the fill level would be the position up to which the file/stream has been downloaded. This amount of pre-buffering can be displayed on the range's trough and is themeable separately from the trough. To enable fill level display, use SetShowFillLevel. The range defaults to not showing the fill level. Additionally, it's possible to restrict the range's slider position to values which area smaller than the fill level. This is controller by SetRestrictToFillLevel and is by default enabled.

Parameters:

fillLevel	the new position of the fill level indicator

func (*CRange) SetFlippable

func (r *CRange) SetFlippable(flippable bool)

SetFlippable updates whether a range is flippable. If the range is flippable, it will switch its direction if it is horizontal and its direction is TEXT_DIR_RTL. See: Widget.GetTextDirection()

Parameters:

flippable	TRUE to make the range flippable

Note that usage of this within CTK is unimplemented at this time

func (*CRange) SetIncrements

func (r *CRange) SetIncrements(step int, page int)

SetIncrements updates the step and page sizes for the range. The step size is used when the user clicks the Scrollbar arrows or moves Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

Parameters:

step	step size
page	page size

func (*CRange) SetInverted

func (r *CRange) SetInverted(setting bool)

SetInverted updates the inverted property value. Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

Parameters:

setting	TRUE to invert the range

func (*CRange) SetLowerStepperSensitivity

func (r *CRange) SetLowerStepperSensitivity(sensitivity SensitivityType)

SetLowerStepperSensitivity updates the sensitivity policy for the stepper that points to the 'lower' end of the Range's adjustment.

Parameters:

sensitivity	the lower stepper's sensitivity policy.

func (*CRange) SetMinSliderLength

func (r *CRange) SetMinSliderLength(length int)

SetMinSliderLength updates the minimum size of the range's slider. This method is useful mainly for Range subclasses.

Parameters:

minSize	The slider's minimum size

func (*CRange) SetMinSliderSize

func (r *CRange) SetMinSliderSize(minSize bool)

SetMinSliderSize updates the minimum size of the range's slider. This method is useful mainly for Range subclasses.

Parameters:

minSize	The slider's minimum size

Note that usage of this within CTK is unimplemented at this time

func (*CRange) SetRange

func (r *CRange) SetRange(min, max int)

SetRange updates the allowable values in the Range, and clamps the range value to be between min and max. (If the range has a non-zero page size, it is clamped between min and max - page-size.)

Parameters:

min	minimum range value
max	maximum range value

func (*CRange) SetRestrictToFillLevel

func (r *CRange) SetRestrictToFillLevel(restrictToFillLevel bool)

SetRestrictToFillLevel updates whether the slider is restricted to the fill level. See: SetFillLevel()

Parameters:

restrictToFillLevel	Whether the fill level restricts slider movement.

func (*CRange) SetRoundDigits

func (r *CRange) SetRoundDigits(roundDigits int)

SetRoundDigits updates the number of digits to round the value to when it changes.

Parameters:

roundDigits	the precision in digits, or -1

func (*CRange) SetShowFillLevel

func (r *CRange) SetShowFillLevel(showFillLevel bool)

SetShowFillLevel updates whether a graphical fill level is show on the trough. See: SetFillLevel()

Parameters:

showFillLevel	Whether a fill level indicator graphics is shown.

func (*CRange) SetSliderLength

func (r *CRange) SetSliderLength(length int)

SetSliderLength updates the length of the scrollbar or scale thumb. Sets fixed slider length to true. Set to -1 for variable slider length.

func (*CRange) SetSliderSizeFixed

func (r *CRange) SetSliderSizeFixed(sizeFixed bool)

SetSliderSizeFixed updates whether the range's slider has a fixed size, or a size that depends on it's adjustment's page size. This function is useful mainly for Range subclasses.

Parameters:

sizeFixed	TRUE to make the slider size constant

Note that usage of this within CTK is unimplemented at this time

func (*CRange) SetStepperSize

func (r *CRange) SetStepperSize(size int)

SetStepperSize updates the length of step buttons at ends.

func (*CRange) SetStepperSpacing

func (r *CRange) SetStepperSpacing(spacing int)

SetStepperSpacing updates the spacing between the stepper buttons and thumb. Note that setting this value to anything > 0 will automatically set the trough-under-steppers style property to TRUE as well. Also, stepper-spacing won't have any effect if there are no steppers.

func (*CRange) SetTroughUnderSteppers

func (r *CRange) SetTroughUnderSteppers(underSteppers bool)

SetTroughUnderSteppers updates whether to draw the trough across the full length of the range or to exclude the steppers and their spacing. Note that setting the stepper-spacing style property to any value > 0 will automatically enable trough-under-steppers too.

func (*CRange) SetUpperStepperSensitivity

func (r *CRange) SetUpperStepperSensitivity(sensitivity SensitivityType)

SetUpperStepperSensitivity updates the sensitivity policy for the stepper that points to the 'upper' end of the Range's adjustment.

Parameters:

sensitivity	the upper stepper's sensitivity policy.

func (*CRange) SetValue

func (r *CRange) SetValue(value int)

SetValue updates the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The range emits the value-changed signal if the value changes.

Parameters:

value	new value of the range

type CRcStyle

type CRcStyle struct {
}

type CScrollbar

type CScrollbar struct {
	CRange
	// contains filtered or unexported fields
}

The CScrollbar structure implements the Scrollbar interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Scrollbar objects.

func (*CScrollbar) Backward

func (s *CScrollbar) Backward(step int) enums.EventFlag

func (*CScrollbar) BackwardPage

func (s *CScrollbar) BackwardPage() enums.EventFlag

func (*CScrollbar) BackwardStep

func (s *CScrollbar) BackwardStep() enums.EventFlag

func (*CScrollbar) CancelEvent

func (s *CScrollbar) CancelEvent()

func (*CScrollbar) Changed

func (s *CScrollbar) Changed()

func (*CScrollbar) Forward

func (s *CScrollbar) Forward(step int) enums.EventFlag

func (*CScrollbar) ForwardPage

func (s *CScrollbar) ForwardPage() enums.EventFlag

func (*CScrollbar) ForwardStep

func (s *CScrollbar) ForwardStep() enums.EventFlag

func (*CScrollbar) GetAllStepperRegions

func (s *CScrollbar) GetAllStepperRegions() (fwd, bwd, sFwd, sBwd ptypes.Region)

func (*CScrollbar) GetHasBackwardStepper

func (s *CScrollbar) GetHasBackwardStepper() (hasBackwardStepper bool)

GetHasBackwardStepper returns whether to display the standard backward arrow button. See: SetHasBackwardStepper()

func (*CScrollbar) GetHasForwardStepper

func (s *CScrollbar) GetHasForwardStepper() (hasForwardStepper bool)

Display the standard forward arrow button. Flags: Read Default value: TRUE

func (*CScrollbar) GetHasSecondaryBackwardStepper

func (s *CScrollbar) GetHasSecondaryBackwardStepper() (hasSecondaryBackwardStepper bool)

Display a second backward arrow button on the opposite end of the scrollbar. Flags: Read Default value: FALSE

func (*CScrollbar) GetHasSecondaryForwardStepper

func (s *CScrollbar) GetHasSecondaryForwardStepper() (hasSecondaryForwardStepper bool)

Display a second forward arrow button on the opposite end of the scrollbar. Flags: Read Default value: FALSE

func (*CScrollbar) GetSizeRequest

func (s *CScrollbar) GetSizeRequest() (width, height int)

func (*CScrollbar) GetSliderRegion

func (s *CScrollbar) GetSliderRegion() (region ptypes.Region)

func (*CScrollbar) GetStepperRegions

func (s *CScrollbar) GetStepperRegions() (start, end ptypes.Region)

func (*CScrollbar) GetTroughRegion

func (s *CScrollbar) GetTroughRegion() (region ptypes.Region)

func (*CScrollbar) GetWidgetAt

func (s *CScrollbar) GetWidgetAt(p *ptypes.Point2I) Widget

func (*CScrollbar) GrabEventFocus added in v0.1.4

func (s *CScrollbar) GrabEventFocus()

GrabEventFocus will emit a grab-event-focus signal and if all signal handlers return enums.EVENT_PASS will set the Button instance as the Window event focus handler.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CScrollbar) GrabFocus

func (s *CScrollbar) GrabFocus()

GrabFocus will take the focus of the associated Window if the Widget instance CanFocus(). Any previously focused Widget will emit a lost-focus signal and the newly focused Widget will emit a gained-focus signal. This method emits a grab-focus signal initially and if the listeners return EVENT_PASS, the changes are applied.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CScrollbar) Init

func (s *CScrollbar) Init() (already bool)

Init initializes a Scrollbar object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Scrollbar instance. Init is used in the NewScrollbar constructor and only necessary when implementing a derivative Scrollbar type.

func (*CScrollbar) SetHasBackwardStepper

func (s *CScrollbar) SetHasBackwardStepper(hasBackwardStepper bool)

SetHasBackwardStepper updates whether to display the standard backward arrow button.

func (*CScrollbar) SetHasForwardStepper

func (s *CScrollbar) SetHasForwardStepper(hasForwardStepper bool)

Display the standard forward arrow button. Flags: Read Default value: TRUE

func (*CScrollbar) SetHasSecondaryBackwardStepper

func (s *CScrollbar) SetHasSecondaryBackwardStepper(hasSecondaryBackwardStepper bool)

Display a second backward arrow button on the opposite end of the scrollbar. Flags: Read Default value: FALSE

func (*CScrollbar) SetHasSecondaryForwardStepper

func (s *CScrollbar) SetHasSecondaryForwardStepper(hasSecondaryForwardStepper bool)

Display a second forward arrow button on the opposite end of the scrollbar. Flags: Read Default value: FALSE

func (*CScrollbar) ValueChanged

func (s *CScrollbar) ValueChanged()

type CScrolledViewport

type CScrolledViewport struct {
	CViewport
	// contains filtered or unexported fields
}

func MakeScrolledViewport

func MakeScrolledViewport() *CScrolledViewport

func NewScrolledViewport

func NewScrolledViewport() *CScrolledViewport

func (*CScrolledViewport) Add

func (s *CScrolledViewport) Add(w Widget)

func (*CScrolledViewport) AddWithViewport

func (s *CScrolledViewport) AddWithViewport(child Widget)

Used to add children without native scrolling capabilities. This is simply a convenience function; it is equivalent to adding the unscrollable child to a viewport, then adding the viewport to the scrolled window. If a child has native scrolling, use ContainerAdd instead of this function. The viewport scrolls the child by moving its Window, and takes the size of the child to be the size of its toplevel Window. This will be very wrong for most widgets that support native scrolling; for example, if you add a widget such as TreeView with a viewport, the whole widget will scroll, including the column headings. Thus, widgets with native scrolling support should not be used with the Viewport proxy. A widget supports scrolling natively if the set_scroll_adjustments_signal field in WidgetClass is non-zero, i.e. has been filled in with a valid signal identifier. Parameters:

child   the widget you want to scroll

func (*CScrolledViewport) Build

func (s *CScrolledViewport) Build(builder Builder, element *CBuilderElement) error

func (*CScrolledViewport) CancelEvent

func (s *CScrolledViewport) CancelEvent()

func (*CScrolledViewport) GetChild

func (s *CScrolledViewport) GetChild() Widget

func (*CScrolledViewport) GetHAdjustment

func (s *CScrolledViewport) GetHAdjustment() (value Adjustment)

Returns the horizontal scrollbar's adjustment, used to connect the horizontal scrollbar to the child widget's horizontal scroll functionality. Returns:

the horizontal Adjustment.

func (*CScrolledViewport) GetHScrollbar

func (s *CScrolledViewport) GetHScrollbar() *CHScrollbar

func (*CScrolledViewport) GetPlacement

func (s *CScrolledViewport) GetPlacement() (value CornerType)

Gets the placement of the contents with respect to the scrollbars for the scrolled window. See SetPlacement. Returns:

the current placement value.
See also SetPlacement and
UnsetPlacement.

func (*CScrolledViewport) GetPolicy

func (s *CScrolledViewport) GetPolicy() (hScrollbarPolicy PolicyType, vScrollbarPolicy PolicyType)

Retrieves the current policy values for the horizontal and vertical scrollbars. See SetPolicy. Parameters:

hScrollbarPolicy        location to store the policy

for the horizontal scrollbar, or NULL.

vScrollbarPolicy        location to store the policy

for the vertical scrollbar, or NULL.

func (*CScrolledViewport) GetRegions

func (s *CScrolledViewport) GetRegions() (c, h, v ptypes.Region)

Returns a CDK Region for each of the viewport child space, horizontal and vertical scrollbar spaces.

func (*CScrolledViewport) GetShadowType

func (s *CScrolledViewport) GetShadowType() (value ShadowType)

Gets the shadow type of the scrolled window. See SetShadowType. Returns:

the current shadow type

func (*CScrolledViewport) GetVAdjustment

func (s *CScrolledViewport) GetVAdjustment() (value Adjustment)

Returns the vertical scrollbar's adjustment, used to connect the vertical scrollbar to the child widget's vertical scroll functionality. Returns:

the vertical Adjustment.

func (*CScrolledViewport) GetVScrollbar

func (s *CScrolledViewport) GetVScrollbar() *CVScrollbar

func (*CScrolledViewport) GetWidgetAt

func (s *CScrolledViewport) GetWidgetAt(p *ptypes.Point2I) Widget

func (*CScrolledViewport) GrabEventFocus added in v0.1.4

func (b *CScrolledViewport) GrabEventFocus()

GrabEventFocus will emit a grab-event-focus signal and if all signal handlers return enums.EVENT_PASS will set the Button instance as the Window event focus handler.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CScrolledViewport) GrabFocus

func (s *CScrolledViewport) GrabFocus()

GrabFocus will take the focus of the associated Window if the Widget instance CanFocus(). Any previously focused Widget will emit a lost-focus signal and the newly focused Widget will emit a gained-focus signal. This method emits a grab-focus signal initially and if the listeners return EVENT_PASS, the changes are applied.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CScrolledViewport) Hide

func (s *CScrolledViewport) Hide()

func (*CScrolledViewport) HorizontalShowByPolicy

func (s *CScrolledViewport) HorizontalShowByPolicy() (show bool)

func (*CScrolledViewport) Init

func (s *CScrolledViewport) Init() (already bool)

func (*CScrolledViewport) Remove

func (s *CScrolledViewport) Remove(w Widget)

func (*CScrolledViewport) SetHAdjustment

func (s *CScrolledViewport) SetHAdjustment(hAdjustment *CAdjustment)

Sets the Adjustment for the horizontal scrollbar. Parameters:

hAdjustment     horizontal scroll adjustment

func (*CScrolledViewport) SetPlacement

func (s *CScrolledViewport) SetPlacement(windowPlacement CornerType)

Sets the placement of the contents with respect to the scrollbars for the scrolled window. The default is GTK_CORNER_TOP_LEFT, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in CornerType are GTK_CORNER_TOP_RIGHT, GTK_CORNER_BOTTOM_LEFT, and GTK_CORNER_BOTTOM_RIGHT. See also GetPlacement and UnsetPlacement. Parameters:

windowPlacement position of the child window

func (*CScrolledViewport) SetPolicy

func (s *CScrolledViewport) SetPolicy(hScrollbarPolicy PolicyType, vScrollbarPolicy PolicyType)

Sets the scrollbar policy for the horizontal and vertical scrollbars. The policy determines when the scrollbar should appear; it is a value from the PolicyType enumeration. If GTK_POLICY_ALWAYS, the scrollbar is always present; if GTK_POLICY_NEVER, the scrollbar is never present; if GTK_POLICY_AUTOMATIC, the scrollbar is present only if needed (that is, if the slider part of the bar would be smaller than the trough - the display is larger than the page size). Parameters:

hScrollbarPolicy        policy for horizontal bar
vScrollbarPolicy        policy for vertical bar

func (*CScrolledViewport) SetShadowType

func (s *CScrolledViewport) SetShadowType(t ShadowType)

Changes the type of shadow drawn around the contents of scrolled_window . Parameters:

type    kind of shadow to draw around scrolled window contents

func (*CScrolledViewport) SetVAdjustment

func (s *CScrolledViewport) SetVAdjustment(vAdjustment *CAdjustment)

Sets the Adjustment for the vertical scrollbar. Parameters:

vAdjustment     vertical scroll adjustment

func (*CScrolledViewport) Show

func (s *CScrolledViewport) Show()

func (*CScrolledViewport) UnsetPlacement

func (s *CScrolledViewport) UnsetPlacement()

Unsets the placement of the contents with respect to the scrollbars for the scrolled window. If no window placement is set for a scrolled window, it obeys the "gtk-scrolled-window-placement" XSETTING. See also SetPlacement and GetPlacement.

func (*CScrolledViewport) VerticalShowByPolicy

func (s *CScrolledViewport) VerticalShowByPolicy() (show bool)

type CStyle

type CStyle struct {
	CObject
}

The CStyle structure implements the Style interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Style objects

func MakeStyle

func MakeStyle() *CStyle

Default constructor for Style objects

func NewStyle

func NewStyle() (value *CStyle)

Constructor for Style objects

func (*CStyle) Init

func (s *CStyle) Init() (already bool)

Style object initialization. This must be called at least once to setup the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Style instance

func (*CStyle) PaintArrow

func (s *CStyle) PaintArrow(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, arrowType ArrowType, fill bool, x int, y int, width int, height int)

Draws an arrow in the given rectangle on window using the given parameters. arrow_type determines the direction of the arrow. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
arrowType	the type of arrow to draw
fill	TRUE if the arrow tip should be filled
x	x origin of the rectangle to draw the arrow in
y	y origin of the rectangle to draw the arrow in
width	width of the rectangle to draw the arrow in
height	height of the rectangle to draw the arrow in

func (*CStyle) PaintBox

func (s *CStyle) PaintBox(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a box on window with the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the box
y	y origin of the box
width	the width of the box
height	the height of the box

func (*CStyle) PaintBoxGap

func (s *CStyle) PaintBoxGap(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, gapSide PositionType, gapX int, gapWidth int)

Draws a box in window using the given style and state and shadow type, leaving a gap in one side. Parameters:

window	a Window
stateType	a state
shadowType	type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle
y	y origin of the rectangle
width	width of the rectangle
height	width of the rectangle
gapSide	side in which to leave the gap
gapX	starting position of the gap
gapWidth	width of the gap

func (*CStyle) PaintCheck

func (s *CStyle) PaintCheck(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a check button indicator in the given rectangle on window with the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle to draw the check in
y	y origin of the rectangle to draw the check in
width	the width of the rectangle to draw the check in
height	the height of the rectangle to draw the check in

func (*CStyle) PaintDiamond

func (s *CStyle) PaintDiamond(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a diamond in the given rectangle on window using the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle to draw the diamond in
y	y origin of the rectangle to draw the diamond in
width	width of the rectangle to draw the diamond in
height	height of the rectangle to draw the diamond in

func (*CStyle) PaintExpander

func (s *CStyle) PaintExpander(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, expanderStyle ExpanderStyle)

Draws an expander as used in TreeView. x and y specify the center the expander. The size of the expander is determined by the "expander-size" style property of widget . (If widget is not specified or doesn't have an "expander-size" property, an unspecified default size will be used, since the caller doesn't have sufficient information to position the expander, this is likely not useful.) The expander is expander_size pixels tall in the collapsed position and expander_size pixels wide in the expanded position. Parameters:

window	a Window
stateType	a state
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	the x position to draw the expander at
y	the y position to draw the expander at
expanderStyle	the style to draw the expander in; determines

whether the expander is collapsed, expanded, or in an intermediate state.

func (*CStyle) PaintExtension

func (s *CStyle) PaintExtension(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, gapSide PositionType)

Draws an extension, i.e. a notebook tab. Parameters:

window	a Window
stateType	a state
shadowType	type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the extension
y	y origin of the extension
width	width of the extension
height	width of the extension
gapSide	the side on to which the extension is attached

func (*CStyle) PaintFlatBox

func (s *CStyle) PaintFlatBox(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a flat box on window with the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the box
y	y origin of the box
width	the width of the box
height	the height of the box

func (*CStyle) PaintFocus

func (s *CStyle) PaintFocus(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a focus indicator around the given rectangle on window using the given style. Parameters:

window	a Window
stateType	a state
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	the x origin of the rectangle around which to draw a focus indicator
y	the y origin of the rectangle around which to draw a focus indicator
width	the width of the rectangle around which to draw a focus indicator
height	the height of the rectangle around which to draw a focus indicator

func (*CStyle) PaintHandle

func (s *CStyle) PaintHandle(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, orientation enums.Orientation)

Draws a handle as used in HandleBox and Paned. Parameters:

window	a Window
stateType	a state
shadowType	type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the handle
y	y origin of the handle
width	with of the handle
height	height of the handle
orientation	the orientation of the handle

func (*CStyle) PaintOption

func (s *CStyle) PaintOption(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a radio button indicator in the given rectangle on window with the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle to draw the option in
y	y origin of the rectangle to draw the option in
width	the width of the rectangle to draw the option in
height	the height of the rectangle to draw the option in

func (*CStyle) PaintPolygon

func (s *CStyle) PaintPolygon(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, points []ptypes.Point2I, nPoints int, fill bool)

Draws a polygon on window with the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
points	an array of Points
nPoints	length of points

fill	TRUE if the polygon should be filled

func (*CStyle) PaintResizeGrip

func (s *CStyle) PaintResizeGrip(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, edge WindowEdge, x int, y int, width int, height int)

Draws a resize grip in the given rectangle on window using the given parameters. Parameters:

window	a Window
stateType	a state
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
edge	the edge in which to draw the resize grip
x	the x origin of the rectangle in which to draw the resize grip
y	the y origin of the rectangle in which to draw the resize grip
width	the width of the rectangle in which to draw the resize grip
height	the height of the rectangle in which to draw the resize grip

func (*CStyle) PaintShadow

func (s *CStyle) PaintShadow(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws a shadow around the given rectangle in window using the given style and state and shadow type. Parameters:

window	a Window
stateType	a state
shadowType	type of shadow to draw
area	clip rectangle or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle
y	y origin of the rectangle
width	width of the rectangle
height	width of the rectangle

func (*CStyle) PaintShadowGap

func (s *CStyle) PaintShadowGap(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, gapSide PositionType, gapX int, gapWidth int)

Draws a shadow around the given rectangle in window using the given style and state and shadow type, leaving a gap in one side. Parameters:

window	a Window
stateType	a state
shadowType	type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle
y	y origin of the rectangle
width	width of the rectangle
height	width of the rectangle
gapSide	side in which to leave the gap
gapX	starting position of the gap
gapWidth	width of the gap

func (*CStyle) PaintSlider

func (s *CStyle) PaintSlider(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, orientation enums.Orientation)

Draws a slider in the given rectangle on window using the given style and orientation. Parameters:

window	a Window
stateType	a state
shadowType	a shadow
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	the x origin of the rectangle in which to draw a slider
y	the y origin of the rectangle in which to draw a slider
width	the width of the rectangle in which to draw a slider
height	the height of the rectangle in which to draw a slider
orientation	the orientation to be used

func (*CStyle) PaintSpinner

func (s *CStyle) PaintSpinner(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, step int, x int, y int, width int, height int)

Draws a spinner on window using the given parameters. Parameters:

window	a Window
stateType	a state
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget (may be NULL).
detail	a style detail (may be NULL).
step	the nth step, a value between 0 and “num-steps”
x	the x origin of the rectangle in which to draw the spinner
y	the y origin of the rectangle in which to draw the spinner
width	the width of the rectangle in which to draw the spinner
height	the height of the rectangle in which to draw the spinner

func (*CStyle) PaintTab

func (s *CStyle) PaintTab(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)

Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on window using the given parameters. Parameters:

window	a Window
stateType	a state
shadowType	the type of shadow to draw
area	clip rectangle, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
x	x origin of the rectangle to draw the tab in
y	y origin of the rectangle to draw the tab in
width	the width of the rectangle to draw the tab in
height	the height of the rectangle to draw the tab in

func (*CStyle) PaintVLine

func (s *CStyle) PaintVLine(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, y1 int, y2 int, x int)

Draws a vertical line from (x , y1_ ) to (x , y2_ ) in window using the given style and state. Parameters:

window	a Window
stateType	a state
area	rectangle to which the output is clipped, or NULL if the

output should not be clipped.

widget	the widget.
detail	a style detail.
y1	the starting y coordinate
y2	the ending y coordinate
x	the x coordinate

type CStyleProperty added in v0.1.4

type CStyleProperty struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStyleProperty added in v0.1.4

func NewStyleProperty(name cdk.Property, state StateType, kind cdk.PropertyType, write bool, buildable bool, def interface{}) (property *CStyleProperty)

func (*CStyleProperty) Buildable added in v0.1.4

func (p *CStyleProperty) Buildable() bool

func (*CStyleProperty) Clone added in v0.1.4

func (p *CStyleProperty) Clone() *CStyleProperty

func (*CStyleProperty) Default added in v0.1.4

func (p *CStyleProperty) Default() (def interface{})

func (*CStyleProperty) Name added in v0.1.4

func (p *CStyleProperty) Name() cdk.Property

func (*CStyleProperty) ReadOnly added in v0.1.4

func (p *CStyleProperty) ReadOnly() bool

func (*CStyleProperty) Set added in v0.1.4

func (p *CStyleProperty) Set(value interface{}) error

func (*CStyleProperty) SetFromString added in v0.1.4

func (p *CStyleProperty) SetFromString(value string) error

func (*CStyleProperty) State added in v0.1.4

func (p *CStyleProperty) State() StateType

func (*CStyleProperty) Type added in v0.1.4

func (p *CStyleProperty) Type() cdk.PropertyType

func (*CStyleProperty) Value added in v0.1.4

func (p *CStyleProperty) Value() (value interface{})

type CTreeExpanderStyle

type CTreeExpanderStyle uint64

Tree expander style

const (
	CTREE_EXPANDER_NONE CTreeExpanderStyle = iota
	CTREE_EXPANDER_SQUARE
	CTREE_EXPANDER_TRIANGLE
	CTREE_EXPANDER_CIRCULAR
)

type CTreeExpansionType

type CTreeExpansionType uint64

Tree expansion type

const (
	CTREE_EXPANSION_EXPAND CTreeExpansionType = iota
	CTREE_EXPANSION_EXPAND_RECURSIVE
	CTREE_EXPANSION_COLLAPSE
	CTREE_EXPANSION_COLLAPSE_RECURSIVE
	CTREE_EXPANSION_TOGGLE
	CTREE_EXPANSION_TOGGLE_RECURSIVE
)

type CTreeLineStyle

type CTreeLineStyle uint64

Tree line style

const (
	CTREE_LINES_NONE CTreeLineStyle = iota
	CTREE_LINES_SOLID
	CTREE_LINES_DOTTED
	CTREE_LINES_TABBED
)

type CTreePos

type CTreePos uint64

Tree pos

const (
	CTREE_POS_BEFORE CTreePos = iota
	CTREE_POS_AS_CHILD
	CTREE_POS_AFTER
)

type CVBox

type CVBox struct {
	CBox
}

func MakeVBox

func MakeVBox() *CVBox

func NewVBox

func NewVBox(homogeneous bool, spacing int) *CVBox

func (*CVBox) Init

func (b *CVBox) Init() bool

type CVButtonBox

type CVButtonBox struct {
	CButtonBox
}

func MakeVButtonBox

func MakeVButtonBox() *CVButtonBox

func NewVButtonBox

func NewVButtonBox(homogeneous bool, spacing int) *CVButtonBox

func (*CVButtonBox) Init

func (b *CVButtonBox) Init() bool

type CVScrollbar

type CVScrollbar struct {
	CScrollbar
}

func MakeVScrollbar

func MakeVScrollbar() *CVScrollbar

func NewVScrollbar

func NewVScrollbar() *CVScrollbar

func (*CVScrollbar) Init

func (v *CVScrollbar) Init() (already bool)

type CViewport

type CViewport struct {
	CBin
	// contains filtered or unexported fields
}

The CViewport structure implements the Viewport interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Viewport objects.

func MakeViewport

func MakeViewport() *CViewport

MakeViewport is used by the Buildable system to construct a new Viewport.

func NewViewport

func NewViewport(hAdjustment, vAdjustment *CAdjustment) *CViewport

NewViewport is the constructor for new Viewport instances.

func (*CViewport) GetBinWindow

func (v *CViewport) GetBinWindow() (value Window)

GetBinWindow returns the bin window of the Viewport.

Note that usage of this within CTK is unimplemented at this time

func (*CViewport) GetHAdjustment

func (v *CViewport) GetHAdjustment() (adjustment *CAdjustment)

GetHAdjustment returns the horizontal adjustment of the viewport. See: SetHAdjustment()

func (*CViewport) GetShadowType

func (v *CViewport) GetShadowType() (shadowType ShadowType)

GetShadowType returns the shadow type of the Viewport. See: SetShadowType()

Note that usage of this within CTK is unimplemented at this time

func (*CViewport) GetVAdjustment

func (v *CViewport) GetVAdjustment() (adjustment *CAdjustment)

GetVAdjustment returns the vertical adjustment of the viewport. See: SetVAdjustment()

func (*CViewport) GetViewWindow

func (v *CViewport) GetViewWindow() (value Window)

GetViewWindow returns the view window of the Viewport.

Note that usage of this within CTK is unimplemented at this time

func (*CViewport) Init

func (v *CViewport) Init() (already bool)

Init initializes a Viewport object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Viewport instance. Init is used in the NewViewport constructor and only necessary when implementing a derivative Viewport type.

func (*CViewport) SetHAdjustment

func (v *CViewport) SetHAdjustment(adjustment *CAdjustment)

SetHAdjustment replaces the horizontal adjustment of the viewport with the given adjustment.

func (*CViewport) SetShadowType

func (v *CViewport) SetShadowType(shadowType ShadowType)

SetShadowType updates the shadow type of the viewport.

Note that usage of this within CTK is unimplemented at this time

func (*CViewport) SetVAdjustment

func (v *CViewport) SetVAdjustment(adjustment *CAdjustment)

SetHAdjustment replaces the horizontal adjustment of the viewport with the given adjustment.

type CWidget

type CWidget struct {
	CObject
	// contains filtered or unexported fields
}

The CWidget structure implements the Widget interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Widget objects.

func (*CWidget) Activate

func (w *CWidget) Activate() (value bool)

For widgets that can be "activated" (buttons, menu items, etc.) this function activates them. Activation is what happens when you press Enter on a widget during key navigation. If widget isn't activatable, the function returns FALSE. Returns:

TRUE if the widget was activatable

func (*CWidget) AddAccelerator

func (w *CWidget) AddAccelerator(accelSignal string, accelGroup AccelGroup, accelKey int, accelMods ModifierType, accelFlags AccelFlags)

Installs an accelerator for this widget in accel_group that causes accel_signal to be emitted if the accelerator is activated. The accel_group needs to be added to the widget's toplevel via WindowAddAccelGroup, and the signal must be of type G_RUN_ACTION. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use AccelMapAddEntry and SetAccelPath or MenuItemSetAccelPath instead. Parameters:

widget	widget to install an accelerator on
accelSignal	widget signal to emit on accelerator activation
accelGroup	accel group for this widget, added to its toplevel
accelKey	GDK keyval of the accelerator
accelMods	modifier key combination of the accelerator
accelFlags	flag accelerators, e.g. GTK_ACCEL_VISIBLE

func (*CWidget) AddEvents

func (w *CWidget) AddEvents(events cdk.EventMask)

Adds the events in the bitfield events to the event mask for widget . See SetEvents for details. Parameters:

events	an event mask, see EventMask

func (*CWidget) AddMnemonicLabel

func (w *CWidget) AddMnemonicLabel(label Widget)

Adds a widget to the list of mnemonic labels for this widget. (See ListMnemonicLabels). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the destroy signal or a weak notifier.

func (*CWidget) CanActivateAccel

func (w *CWidget) CanActivateAccel(signalId int) (value bool)

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This is done by emitting the can-activate-accel signal on widget ; if the signal isn't overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped. Parameters:

signalId	the ID of a signal installed on widget

Returns:

TRUE if the accelerator can be activated.

func (*CWidget) CanDefault

func (w *CWidget) CanDefault() bool

Returns TRUE if the Widget instance IsSensitive() and the CAN_DEFAULT flag is set, returns FALSE otherwise

func (*CWidget) CanFocus

func (w *CWidget) CanFocus() bool

Returns TRUE if the Widget instance has the CAN_FOCUS flag, FALSE otherwise

func (*CWidget) ChildFocus

func (w *CWidget) ChildFocus(direction DirectionType) (value bool)

This function is used by custom widget implementations; if you're writing an app, you'd use GrabFocus to move the focus to a particular widget, and ContainerSetFocusChain to change the focus tab order. So you may want to investigate those functions instead. ChildFocus is called by containers as the user moves around the window using keyboard shortcuts. direction indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). ChildFocus emits the focus signal; widgets override the default handler for this signal in order to implement appropriate focus behavior. The default ::focus handler for a widget should return TRUE if moving in direction left the focus on a focusable location inside that widget, and FALSE if moving in direction moved the focus outside the widget. If returning TRUE, widgets normally call GrabFocus to place the focus accordingly; if returning FALSE, they don't modify the current focus location. This function replaces ContainerFocus from CTK 1.2. It was necessary to check that the child was visible, sensitive, and focusable before calling ContainerFocus. ChildFocus returns FALSE if the widget is not currently in a focusable state, so there's no need for those checks. Parameters:

direction	direction of focus movement

Returns:

TRUE if focus ended up inside widget

func (*CWidget) ChildNotify

func (w *CWidget) ChildNotify(childProperty string)

Emits a child-notify signal for the on widget . This is the analogue of g_object_notify for child properties. Parameters:

childProperty	the name of a child property installed on the

class of widget 's parent

func (*CWidget) ClassPath

func (w *CWidget) ClassPath(pathLength int, path string, pathReversed string)

Same as Path, but always uses the name of a widget's type, never uses a custom name set with SetName. Parameters:

pathLength	location to store the length of the class path, or NULL.
path	location to store the class path as an allocated string, or NULL.
pathReversed	location to store the reverse class path as an allocated

string, or NULL.

func (*CWidget) CssFullPath added in v0.1.4

func (w *CWidget) CssFullPath() (selector string)

CssFullPath returns a CSS selector rule for the Widget which includes the parent hierarchy in type form.

func (*CWidget) CssState added in v0.1.4

func (w *CWidget) CssState() (state StateType)

func (*CWidget) Destroy

func (w *CWidget) Destroy()

Destroy a widget. Equivalent to DestroyObject. When a widget is destroyed, it will break any references it holds to other objects. If the widget is inside a container, the widget will be removed from the container. If the widget is a toplevel (derived from Window), it will be removed from the list of toplevels, and the reference CTK holds to it will be removed. Removing a widget from its container or the list of toplevels results in the widget being finalized, unless you've added additional references to the widget with g_object_ref. In most cases, only toplevel widgets (windows) require explicit destruction, because when you destroy a toplevel its children will be destroyed as well.

func (*CWidget) Draw

func (w *CWidget) Draw() enums.EventFlag

Emits a draw signal, primarily used to render canvases and cause end-user facing display updates. Signal listeners can draw to the Canvas and return EVENT_STOP to cause those changes to be composited upon the larger display canvas

Emits: SignalDraw, Argv=[Object instance, canvas]

func (*CWidget) ErrorBell

func (w *CWidget) ErrorBell()

Notifies the user about an input-related error on this widget. If the gtk-error-bell setting is TRUE, it calls WindowBeep, otherwise it does nothing. Note that the effect of WindowBeep can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.

func (*CWidget) FreezeChildNotify

func (w *CWidget) FreezeChildNotify()

Stops emission of child-notify signals on widget . The signals are queued until ThawChildNotify is called on widget . This is the analogue of g_object_freeze_notify for child properties.

func (*CWidget) GetAncestor

func (w *CWidget) GetAncestor(widgetType cdk.CTypeTag) (value Widget)

Gets the first ancestor of widget with type widget_type . For example, GetAncestor (widget, GTK_TYPE_BOX) gets the first Box that's an ancestor of widget . No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Window in the docs for GetToplevel. Note that unlike IsAncestor, GetAncestor considers widget to be an ancestor of itself. Parameters:

widgetType	ancestor type

Returns:

the ancestor widget, or NULL if not found.

func (*CWidget) GetAppPaintable

func (w *CWidget) GetAppPaintable() (value bool)

Determines whether the application intends to draw on the widget in an expose-event handler. See SetAppPaintable Returns:

TRUE if the widget is app paintable

func (*CWidget) GetCanDefault

func (w *CWidget) GetCanDefault() (value bool)

Determines whether widget can be a default widget. See SetCanDefault. Returns:

TRUE if widget can be a default widget, FALSE otherwise

func (*CWidget) GetCanFocus

func (w *CWidget) GetCanFocus() (value bool)

Determines whether widget can own the input focus. See SetCanFocus. Returns:

TRUE if widget can own the input focus, FALSE otherwise

func (*CWidget) GetChildVisible

func (w *CWidget) GetChildVisible() (value bool)

Gets the value set with SetChildVisible. If you feel a need to use this function, your code probably needs reorganization. This function is only useful for container implementations and never should be called by an application. Returns:

TRUE if the widget is mapped with the parent.

func (*CWidget) GetCompositeName

func (w *CWidget) GetCompositeName() (value string)

Obtains the composite name of a widget.

func (*CWidget) GetDefaultDirection

func (w *CWidget) GetDefaultDirection() (value TextDirection)

Obtains the current default reading direction. See SetDefaultDirection. Returns:

the current default direction.

func (*CWidget) GetDirection

func (w *CWidget) GetDirection() (value TextDirection)

Gets the reading direction for a particular widget. See SetDirection. Returns:

the reading direction for the widget.

func (*CWidget) GetDisplay

func (w *CWidget) GetDisplay() (value cdk.Display)

Get the Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized. Returns:

the Display for the toplevel for this widget.

func (*CWidget) GetEvents

func (w *CWidget) GetEvents() (value cdk.EventMask)

Returns the event mask for the widget (a bitfield containing flags from the EventMask enumeration). These are the events that the widget will receive. Returns:

event mask for widget

func (*CWidget) GetFlags

func (w *CWidget) GetFlags() WidgetFlags

Returns the current flags for the Widget instance

func (*CWidget) GetHasTooltip

func (w *CWidget) GetHasTooltip() (value bool)

Returns the current value of the has-tooltip property. See Widget:has-tooltip for more information. Returns:

current value of has-tooltip on widget .

func (*CWidget) GetHasWindow

func (w *CWidget) GetHasWindow() (ok bool)

Determines whether widget has a Window of its own. See SetHasWindow. Returns:

TRUE if widget has a window, FALSE otherwise

func (*CWidget) GetMapped

func (w *CWidget) GetMapped() (value bool)

Whether the widget is mapped. Returns:

TRUE if the widget is mapped, FALSE otherwise.

func (*CWidget) GetNoShowAll

func (w *CWidget) GetNoShowAll() (value bool)

Returns the current value of the Widget:no-show-all property, which determines whether calls to ShowAll and HideAll will affect this widget. Returns:

the current value of the "no-show-all" property.

func (*CWidget) GetParent

func (w *CWidget) GetParent() (value Container)

Returns the parent container of widget . Returns:

the parent container of widget , or NULL.

func (*CWidget) GetParentWindow

func (w *CWidget) GetParentWindow() (value Window)

Gets widget's parent window. Returns:

the parent window of widget.

func (*CWidget) GetPointer

func (w *CWidget) GetPointer(x int, y int)

Obtains the location of the mouse pointer in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widget->window coordinates for widgets that are not GTK_NO_WINDOW widgets, and are relative to widget->allocation.x , widget->allocation.y for widgets that are GTK_NO_WINDOW widgets. Parameters:

x	return location for the X coordinate, or NULL.
y	return location for the Y coordinate, or NULL.

func (*CWidget) GetRealized

func (w *CWidget) GetRealized() (value bool)

Determines whether widget is realized. Returns:

TRUE if widget is realized, FALSE otherwise

func (*CWidget) GetReceivesDefault

func (w *CWidget) GetReceivesDefault() (value bool)

Determines whether widget is alyways treated as default widget withing its toplevel when it has the focus, even if another widget is the default. See SetReceivesDefault. Returns:

TRUE if widget acts as default widget when focussed, FALSE
otherwise

func (*CWidget) GetRootWindow

func (w *CWidget) GetRootWindow() (value Window)

Get the root window where this widget is located. This function can only be called after the widget has been added to a widget hierarchy with Window at the top. The root window is useful for such purposes as creating a popup Window associated with the window. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized. Returns:

the Window root window for the toplevel for this widget.

func (*CWidget) GetScreen

func (w *CWidget) GetScreen() (value cdk.Display)

Get the Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top. In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized. Returns:

the Screen for the toplevel for this widget.

func (*CWidget) GetSensitive

func (w *CWidget) GetSensitive() (value bool)

Returns the widget's sensitivity (in the sense of returning the value that has been set using SetSensitive). The effective sensitivity of a widget is however determined by both its own and its parent widget's sensitivity. See IsSensitive. Returns:

TRUE if the widget is sensitive

func (*CWidget) GetSizeRequest

func (w *CWidget) GetSizeRequest() (width, height int)

Gets the size request that was explicitly set for the widget using SetSizeRequest. A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used intead. See SetSizeRequest. To get the size a widget will actually use, call SizeRequest instead of this function. Parameters:

width	return location for width, or NULL.
height	return location for height, or NULL.

func (*CWidget) GetState

func (w *CWidget) GetState() (value StateType)

Returns the widget's state. See SetState. Returns:

the state of the widget.

func (*CWidget) GetTheme added in v0.1.4

func (w *CWidget) GetTheme() (theme paint.Theme)

func (*CWidget) GetThemeRequest

func (w *CWidget) GetThemeRequest() (theme paint.Theme)

GetThemeRequest returns the current theme, adjusted for Widget state and accounting for any PARENT_SENSITIVE conditions. This method is primarily useful in drawable Widget types during Invalidate() and Draw() stages of the Widget lifecycle. This method emits an initial get-theme-request signal with a pointer to the theme instance to be modified as there are no return values for signal listeners. If the signal listeners return EVENT_STOP, the theme instance is returned without modification. If the signal listeners return EVENT_PASS, this method will perform the changes to the theme instance mentioned above.

func (*CWidget) GetTooltipMarkup

func (w *CWidget) GetTooltipMarkup() (value string)

Gets the contents of the tooltip for widget . Returns:

the tooltip text, or NULL. You should free the returned string
with g_free when done.

func (*CWidget) GetTooltipText

func (w *CWidget) GetTooltipText() (value string)

Gets the contents of the tooltip for widget . Returns:

the tooltip text, or NULL. You should free the returned string
with g_free when done.

func (*CWidget) GetTooltipWindow

func (w *CWidget) GetTooltipWindow() (value Window)

Returns the Window of the current tooltip. This can be the Window created by default, or the custom tooltip window set using SetTooltipWindow. Returns:

The Window of the current tooltip.

func (*CWidget) GetTopParent

func (w *CWidget) GetTopParent() (parent Container)

Returns the top-most parent in the Widget instance's parent hierarchy. Returns nil if the Widget has no parent container

func (*CWidget) GetToplevel

func (w *CWidget) GetToplevel() (value Widget)

This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced. Note the difference in behavior vs. GetAncestor; GetAncestor (widget, GTK_TYPE_WINDOW) would return NULL if widget wasn't inside a toplevel window, and if the window was inside a Window-derived widget which was in turn inside the toplevel Window. While the second case may seem unlikely, it actually happens when a Plug is embedded inside a Socket within the same application. To reliably find the toplevel Window, use GetToplevel and check if the TOPLEVEL flags is set on the result. Returns:

the topmost ancestor of widget , or widget itself if there's no
ancestor.

func (*CWidget) GetVisible

func (w *CWidget) GetVisible() (value bool)

Determines whether the widget is visible. Note that this doesn't take into account whether the widget's parent is also visible or the widget is obscured in any way. See SetVisible. Returns:

TRUE if the widget is visible

func (*CWidget) GetWidgetAt

func (w *CWidget) GetWidgetAt(p *ptypes.Point2I) Widget

A wrapper around the Object.GetObjectAt() method, only returning Widget instance types or nil otherwise

func (*CWidget) GetWindow

func (w *CWidget) GetWindow() (window Window)

Returns the widget's window if it is realized, NULL otherwise Returns:

widget 's window.

Returns the Window instance associated with this Widget instance, nil otherwise

func (*CWidget) GrabDefault

func (w *CWidget) GrabDefault()

Causes widget to become the default widget. widget must have the GTK_CAN_DEFAULT flag set; typically you have to set this flag yourself by calling SetCanDefault (widget , TRUE). The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, Activate should affect them.

func (*CWidget) GrabEventFocus

func (w *CWidget) GrabEventFocus()

GrabEventFocus will attempt to set the Widget as the Window event focus handler. This method emits a grab-event-focus signal and if the listeners all return EVENT_PASS, the changes are applied.

Note that this method needs to be implemented within each Drawable that can be focused because of the golang interface system losing the concrete struct when a Widget interface reference is passed as a generic interface{} argument.

func (*CWidget) GrabFocus

func (w *CWidget) GrabFocus()

Causes widget to have the keyboard focus for the Window it's inside. widget must be a focusable widget, such as a Entry; something like Frame won't work. More precisely, it must have the GTK_CAN_FOCUS flag set. Use SetCanFocus to modify that flag. The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings. If the Widget instance CanFocus() then take the focus of the associated Window. Any previously focused Widget will emit a lost-focus signal and the newly focused Widget will emit a gained-focus signal. This method emits a grab-focus signal initially and if the listeners return EVENT_PASS, the changes are applied

Emits: SignalGrabFocus, Argv=[Widget instance] Emits: SignalLostFocus, Argv=[Previous focus Widget instance], From=Previous focus Widget instance Emits: SignalGainedFocus, Argv=[Widget instance, previous focus Widget instance]

func (*CWidget) HasDefault

func (w *CWidget) HasDefault() (value bool)

Determines whether widget is the current default widget within its toplevel. See SetCanDefault. Returns:

TRUE if widget is the current default widget within its
toplevel, FALSE otherwise

func (*CWidget) HasEventFocus

func (w *CWidget) HasEventFocus() bool

func (*CWidget) HasFlags

func (w *CWidget) HasFlags(f WidgetFlags) bool

Returns TRUE if the Widget instance has the given flag, FALSE otherwise

func (*CWidget) HasFocus

func (w *CWidget) HasFocus() (value bool)

Determines if the widget has the global input focus. See IsFocus for the difference between having the global input focus, and only having the focus within a toplevel. Returns:

TRUE if the widget has the global input focus.

func (*CWidget) HasGrab

func (w *CWidget) HasGrab() (value bool)

Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse). See also GrabAdd. Returns:

TRUE if the widget is in the grab_widgets stack

func (*CWidget) HasScreen

func (w *CWidget) HasScreen() (value bool)

Checks whether there is a Screen is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a hierarchy with a toplevel window at the top. Returns:

TRUE if there is a Screen associcated with the widget.

func (*CWidget) HasState

func (w *CWidget) HasState(s StateType) bool

Returns TRUE if the Widget has the given StateType, FALSE otherwise

func (*CWidget) Hide

func (w *CWidget) Hide()

Hide reverses the effects of Show, causing the widget to be hidden (invisible to the user).

func (*CWidget) HideOnDelete

func (w *CWidget) HideOnDelete() (value bool)

Utility function; intended to be connected to the delete-event signal on a Window. The function calls Hide on its argument, then returns TRUE. If connected to ::delete-event, the result is that clicking the close button for a window (on the window frame, top right corner usually) will hide but not destroy the window. By default, CTK destroys windows when ::delete-event is received. Returns:

TRUE

func (*CWidget) Init

func (w *CWidget) Init() (already bool)

Init initializes a Widget object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Widget instance. Init is used in the NewWidget constructor and only necessary when implementing a derivative Widget type.

func (*CWidget) IsAncestor

func (w *CWidget) IsAncestor(ancestor Widget) (value bool)

Determines whether widget is somewhere inside ancestor , possibly with intermediate containers. Returns:

TRUE if ancestor contains widget as a child, grandchild, great
grandchild, etc.

func (*CWidget) IsDefault

func (w *CWidget) IsDefault() bool

Returns TRUE if the Widget instance CanDefault() and the HAS_DEFAULT flag is set, returns FALSE otherwise

func (*CWidget) IsDrawable

func (w *CWidget) IsDrawable() (value bool)

Determines whether widget can be drawn to. A widget can be drawn to if it is mapped and visible. Returns:

TRUE if widget is drawable, FALSE otherwise

Returns TRUE if the APP_PAINTABLE flag is set, FALSE otherwise

func (*CWidget) IsFocus

func (w *CWidget) IsFocus() (value bool)

Determines if the widget is the focus widget within its toplevel. (This does not mean that the HAS_FOCUS flag is necessarily set; HAS_FOCUS will only be set if the toplevel widget additionally has the global input focus.) Returns:

TRUE if the widget is the focus widget.

Returns TRUE if the Widget instance is currently the focus of it's parent Window, FALSE otherwise

func (*CWidget) IsFocused

func (w *CWidget) IsFocused() bool

Returns TRUE if the Widget instance or it's parent are the current focus of the associated Window

func (*CWidget) IsParentFocused

func (w *CWidget) IsParentFocused() bool

If the Widget instance is PARENT_SENSITIVE and one of it's parents are the focus for the associated Window, return TRUE and FALSE otherwise

func (*CWidget) IsSensitive

func (w *CWidget) IsSensitive() bool

Returns the widget's effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive Returns:

TRUE if the widget is effectively sensitive

func (*CWidget) IsToplevel

func (w *CWidget) IsToplevel() (value bool)

Determines whether widget is a toplevel widget. Currently only Window and Invisible are toplevel widgets. Toplevel widgets have no parent widget. Returns:

TRUE if widget is a toplevel, FALSE otherwise

func (*CWidget) IsVisible

func (w *CWidget) IsVisible() bool

Returns TRUE if the VISIBLE flag is set, FALSE otherwise

func (*CWidget) KeynavFailed

func (w *CWidget) KeynavFailed(direction DirectionType) (value bool)

This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the keynav-failed signal on the widget and its return value should be interpreted in a way similar to the return value of ChildFocus: When TRUE is returned, stay in the widget, the failed keyboard navigation is Ok and/or there is nowhere we can/should move the focus to. When FALSE is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling ChildFocus on the widget's toplevel. The default ::keynav-failed handler returns TRUE for GTK_DIR_TAB_FORWARD and GTK_DIR_TAB_BACKWARD. For the other values of DirectionType, it looks at the gtk-keynav-cursor-only setting and returns FALSE if the setting is TRUE. This way the entire user interface becomes cursor-navigatable on input devices such as mobile phones which only have cursor keys but no tab key. Whenever the default handler returns TRUE, it also calls ErrorBell to notify the user of the failed keyboard navigation. A use case for providing an own implementation of ::keynav-failed (either by connecting to it or by overriding it) would be a row of Entry widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys. Parameters:

direction	direction of focus movement

Returns:

TRUE if stopping keyboard navigation is fine, FALSE if the
emitting widget should try to handle the keyboard navigation
attempt in its parent container(s).

func (*CWidget) MnemonicActivate added in v0.1.4

func (w *CWidget) MnemonicActivate(groupCycling bool) (value bool)

Emits the mnemonic-activate signal. The default handler for this signal activates the widget if group_cycling is FALSE, and just grabs the focus if group_cycling is TRUE. Parameters:

groupCycling	TRUE if there are other widgets with the same mnemonic

Returns:

TRUE if the signal has been handled

func (*CWidget) Path

func (w *CWidget) Path() (path string)

Obtains the full path to widget . The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods. The name of a widget comes from GetName. Paths are used to apply styles to a widget in gtkrc configuration files. Widget names are the type of the widget by default (e.g. "Button") or can be set to an application-specific value with SetName. By setting the name of a widget, you allow users or theme authors to apply styles to that specific widget in their gtkrc file. path_reversed_p fills in the path in reverse order, i.e. starting with widget 's name instead of starting with the name of widget 's outermost ancestor. Parameters:

pathLength	location to store length of the path, or NULL.
path	location to store allocated path string, or NULL.
pathReversed	location to store allocated reverse path string, or NULL.

func (*CWidget) ReleaseEventFocus

func (w *CWidget) ReleaseEventFocus()

func (*CWidget) RemoveAccelerator

func (w *CWidget) RemoveAccelerator(accelGroup AccelGroup, accelKey int, accelMods ModifierType) (value bool)

Removes an accelerator from widget , previously installed with AddAccelerator. Parameters:

widget	widget to install an accelerator on
accelGroup	accel group for this widget
accelKey	GDK keyval of the accelerator
accelMods	modifier key combination of the accelerator
returns	whether an accelerator was installed and could be removed

func (*CWidget) RemoveMnemonicLabel

func (w *CWidget) RemoveMnemonicLabel(label Widget)

Removes a widget from the list of mnemonic labels for this widget. (See ListMnemonicLabels). The widget must have previously been added to the list with AddMnemonicLabel.

func (*CWidget) Reparent

func (w *CWidget) Reparent(parent Container)

Move the Widget to the given container, removing itself first from any other container that was currently holding it. This method emits a reparent signal initially and if the listeners return EVENT_PAS, the change is applied Parameters:

newParent	a Container to move the widget into

Emits: SignalReparent, Argv=[Widget instance, new parent]

func (*CWidget) SendExpose

func (w *CWidget) SendExpose(event cdk.Event) (value int)

Very rarely-used function. This function is used to emit an expose event signals on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a child NO_WINDOW widget, and that is normally done using ContainerPropagateExpose. If you want to force an area of a window to be redrawn, use WindowInvalidateRect or WindowInvalidateRegion. To cause the redraw to be done immediately, follow that call with a call to WindowProcessUpdates. Parameters:

event	a expose Event

Returns:

return from the event signal emission (TRUE if the event was
handled)

func (*CWidget) SendFocusChange

func (w *CWidget) SendFocusChange(event cdk.Event) (value bool)

Sends the focus change event to widget This function is not meant to be used by applications. The only time it should be used is when it is necessary for a Widget to assign focus to a widget that is semantically owned by the first widget even though it's not a direct child - for instance, a search entry in a floating window similar to the quick search in TreeView. An example of its usage is: Parameters:

event	a Event of type GDK_FOCUS_CHANGE

Returns:

the return value from the event signal emission: TRUE if the
event was handled, and FALSE otherwise

func (*CWidget) SetAccelPath

func (w *CWidget) SetAccelPath(accelPath string, accelGroup AccelGroup)

Given an accelerator group, accel_group , and an accelerator path, accel_path , sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to SetAccelPath. Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See AccelMapSave.) This function is a low level function that would most likely be used by a menu creation system like UIManager. If you use UIManager, setting up accelerator paths will be done automatically. Even when you you aren't using UIManager, if you only want to set up accelerators on menu items MenuItemSetAccelPath provides a somewhat more convenient interface. Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string. Parameters:

accelPath	path used to look up the accelerator.
accelGroup	a AccelGroup.

func (*CWidget) SetAppPaintable

func (w *CWidget) SetAppPaintable(appPaintable bool)

Sets whether the application intends to draw on the widget in an expose-event handler. This is a hint to the widget and does not affect the behavior of the CTK core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as EventBox and Window, the effect is to suppress default themed drawing of the widget's background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background. Note that the background is still drawn when the widget is mapped. If this is not suitable (e.g. because you want to make a transparent window using an RGBA visual), you can work around this by doing: Parameters:

appPaintable	TRUE if the application will paint on the widget

func (*CWidget) SetCanDefault

func (w *CWidget) SetCanDefault(canDefault bool)

Specifies whether widget can be a default widget. See GrabDefault for details about the meaning of "default". Parameters:

canDefault	whether or not widget

can be a default widget.

func (*CWidget) SetCanFocus

func (w *CWidget) SetCanFocus(canFocus bool)

Specifies whether widget can own the input focus. See GrabFocus for actually setting the input focus on a widget. Parameters:

canFocus	whether or not widget

can own the input focus.

func (*CWidget) SetCompositeName

func (w *CWidget) SetCompositeName(name string)

Sets a widgets composite name. The widget must be a composite child of its parent; see PushCompositeChild. Parameters:

name	the name to set

func (*CWidget) SetDefaultDirection

func (w *CWidget) SetDefaultDirection(dir TextDirection)

Sets the default reading direction for widgets where the direction has not been explicitly set by SetDirection. Parameters:

dir	the new default direction. This cannot be

GTK_TEXT_DIR_NONE.

func (*CWidget) SetDirection

func (w *CWidget) SetDirection(dir TextDirection)

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitely visual rather than logical (such as buttons for text justification). If the direction is set to GTK_TEXT_DIR_NONE, then the value set by SetDefaultDirection will be used. Parameters:

dir	the new direction

func (*CWidget) SetDoubleBuffered

func (w *CWidget) SetDoubleBuffered(doubleBuffered bool)

Widgets are double buffered by default; you can use this function to turn off the buffering. "Double buffered" simply means that WindowBeginPaintRegion and WindowEndPaint are called automatically around expose events sent to the widget. WindowBeginPaint diverts all drawing to a widget's window to an offscreen buffer, and WindowEndPaint draws the buffer to the screen. The result is that users see the window update in one smooth step, and don't see individual graphics primitives being rendered. In very simple terms, double buffered widgets don't flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing. Note: if you turn off double-buffering, you have to handle expose events, since even the clearing to the background color or pixmap will not happen automatically (as it is done in WindowBeginPaint). Parameters:

doubleBuffered	TRUE to double-buffer a widget

func (*CWidget) SetEvents

func (w *CWidget) SetEvents(events cdk.EventMask)

Sets the event mask (see EventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget's functionality, so be careful. This function must be called while a widget is unrealized. Consider AddEvents for widgets that are already realized, or if you want to preserve the existing event mask. This function can't be used with GTK_NO_WINDOW widgets; to get events on those widgets, place them inside a EventBox and receive events on the event box. Parameters:

events	event mask

func (*CWidget) SetFlags

func (w *CWidget) SetFlags(v WidgetFlags)

Sets the given flags on the Widget instance. This method emits a set-flags signal initially and if the listeners return EVENT_PASS, the change is applied

Emits: SignalSetFlags, Argv=[Widget instance, given flags to set]

func (*CWidget) SetHasTooltip

func (w *CWidget) SetHasTooltip(hasTooltip bool)

Sets the has-tooltip property on widget to has_tooltip . See Widget:has-tooltip for more information. Parameters:

hasTooltip	whether or not widget

has a tooltip.

func (*CWidget) SetMapped

func (w *CWidget) SetMapped(mapped bool)

Marks the widget as being realized. This function should only ever be called in a derived widget's "map" or "unmap" implementation. Parameters:

mapped	TRUE to mark the widget as mapped

func (*CWidget) SetNoShowAll

func (w *CWidget) SetNoShowAll(noShowAll bool)

Sets the no-show-all property, which determines whether calls to ShowAll and HideAll will affect this widget. This is mostly for use in constructing widget hierarchies with externally controlled visibility, see UIManager. Parameters:

noShowAll	the new value for the "no-show-all" property

func (*CWidget) SetParent

func (w *CWidget) SetParent(parent Container)

This function is useful only when implementing subclasses of Container. Sets the container as the parent of widget , and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is Unparent. Parameters:

parent	parent container

func (*CWidget) SetParentWindow

func (w *CWidget) SetParentWindow(parentWindow Window)

Sets a non default parent window for widget . Parameters:

parentWindow	the new parent window.

func (*CWidget) SetRealized

func (w *CWidget) SetRealized(realized bool)

Marks the widget as being realized. This function should only ever be called in a derived widget's "realize" or "unrealize" implementation. Parameters:

realized	TRUE to mark the widget as realized

func (*CWidget) SetReceivesDefault

func (w *CWidget) SetReceivesDefault(receivesDefault bool)

Specifies whether widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default. See GrabDefault for details about the meaning of "default". Parameters:

receivesDefault	whether or not widget

can be a default widget.

func (*CWidget) SetRedrawOnAllocate

func (w *CWidget) SetRedrawOnAllocate(redrawOnAllocate bool)

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is TRUE and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance. Note that for NO_WINDOW widgets setting this flag to FALSE turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don't draw anything to avoid excess invalidations. If you set this flag on a NO_WINDOW widget that does draw on widget->window , you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size. Parameters:

redrawOnAllocate	if TRUE, the entire widget will be redrawn

when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.

func (*CWidget) SetScrollAdjustments

func (w *CWidget) SetScrollAdjustments(hadjustment Adjustment, vadjustment Adjustment) (value bool)

For widgets that support scrolling, sets the scroll adjustments and returns TRUE. For widgets that don't support scrolling, does nothing and returns FALSE. Widgets that don't support scrolling can be scrolled by placing them in a Viewport, which does support scrolling. Parameters:

hadjustment	an adjustment for horizontal scrolling, or NULL.
vadjustment	an adjustment for vertical scrolling, or NULL.

Returns:

TRUE if the widget supports scrolling

func (*CWidget) SetSensitive

func (w *CWidget) SetSensitive(sensitive bool)

Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are "grayed out" and the user can't interact with them. Insensitive widgets are known as "inactive", "disabled", or "ghosted" in some other toolkits. Parameters:

sensitive	TRUE to make the widget sensitive

Emits: SignalSetSensitive, Argv=[Widget instance, given sensitive bool]

func (*CWidget) SetSizeRequest

func (w *CWidget) SetSizeRequest(width, height int)

Sets the minimum size of a widget; that is, the widget's size request will be width by height . You can use this function to force a widget to be either larger or smaller than it normally would be. In most cases, WindowSetDefaultSize is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, WindowSetGeometryHints can be a useful function as well. Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct. The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested. If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead. Widgets can't actually be allocated a size less than 1 by 1, but you can pass 0,0 to this function to mean "as small as possible." Parameters:

width	width widget should request, or -1 to unset
height	height widget should request, or -1 to unset

Emits: SignalSetSizeRequest, Argv=[Widget instance, given size]

func (*CWidget) SetState

func (w *CWidget) SetState(state StateType)

This function is for use in widget implementations. Sets the state of a widget (insensitive, prelighted, etc.) Usually you should set the state using wrapper functions such as SetSensitive. Parameters:

state	new state for widget

Adds the given state bitmask to the Widget instance. This method emits a set-state signal initially and if the listeners return EVENT_PASS, the change is applied

Emit: SignalSetState, Argv=[Widget instance, given state to set]

func (*CWidget) SetTheme

func (w *CWidget) SetTheme(theme paint.Theme)

Set the Theme for the Widget instance. This will also refresh the requested theme. A request theme is a transient theme, based on the actually set theme and adjusted for focus. If the given theme is equivalent to the current theme then no action is taken. After verifying that the given theme is different, this method emits a set-theme signal and if the listeners return EVENT_PASS, the changes are applied and the Widget.Invalidate() method is called

func (*CWidget) SetTooltipMarkup

func (w *CWidget) SetTooltipMarkup(markup string)

Sets markup as the contents of the tooltip, which is marked up with the Tango text markup language. This function will take care of setting Widget:has-tooltip to TRUE and of the default handler for the Widget::query-tooltip signal. See also the Widget:tooltip-markup property and TooltipSetMarkup. Parameters:

markup	the contents of the tooltip for widget

, or NULL.

func (*CWidget) SetTooltipText

func (w *CWidget) SetTooltipText(text string)

Sets text as the contents of the tooltip. This function will take care of setting Widget:has-tooltip to TRUE and of the default handler for the Widget::query-tooltip signal. See also the Widget:tooltip-text property and TooltipSetText. Parameters:

text	the contents of the tooltip for widget

func (*CWidget) SetTooltipWindow

func (w *CWidget) SetTooltipWindow(customWindow Window)

Replaces the default, usually yellow, window used for displaying tooltips with custom_window . CTK will take care of showing and hiding custom_window at the right moment, to behave likewise as the default tooltip window. If custom_window is NULL, the default tooltip window will be used. If the custom window should have the default theming it needs to have the name "gtk-tooltip", see SetName. Parameters:

customWindow	a Window, or NULL.

func (*CWidget) SetVisible

func (w *CWidget) SetVisible(visible bool)

Sets the visibility state of widget . Note that setting this to TRUE doesn't mean the widget is actually viewable, see GetVisible. This function simply calls Show or Hide but is nicer to use when the visibility of the widget depends on some condition. Parameters:

visible	whether the widget should be shown or not

func (*CWidget) SetWindow

func (w *CWidget) SetWindow(window Window)

Sets a widget's window. This function should only be used in a widget's Widget::realize implementation. The window passed is usually either new window created with WindowNew, or the window of its parent widget as returned by GetParentWindow. Widgets must indicate whether they will create their own Window by calling SetHasWindow. This is usually done in the widget's init function. Parameters:

window	a Window

Emits: SignalSetWindow, Argv=[Widget instance, given window]

func (*CWidget) Show

func (w *CWidget) Show()

Show flags a widget to be displayed. Any widget that isn't shown will not appear on the screen. If you want to show all the widgets in a container, it's easier to call ShowAll on the container, instead of individually showing the widgets. Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen. When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

func (*CWidget) ShowAll

func (w *CWidget) ShowAll()

ShowAll recursively shows a widget, and any child widgets (if the widget is a container).

func (*CWidget) SizeRequest

func (w *CWidget) SizeRequest() ptypes.Rectangle

Returns the currently requested size

func (*CWidget) TranslateCoordinates

func (w *CWidget) TranslateCoordinates(destWidget Widget, srcX int, srcY int, destX int, destY int) (value bool)

Translate coordinates relative to src_widget 's allocation to coordinates relative to dest_widget 's allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel. Parameters:

srcX	X position relative to src_widget

srcY	Y position relative to src_widget

destX	location to store X position relative to dest_widget

.

destY	location to store Y position relative to dest_widget

. Returns:

FALSE if either widget was not realized, or there was no common
ancestor. In this case, nothing is stored in *dest_x and
*dest_y . Otherwise TRUE.

func (*CWidget) TriggerTooltipQuery

func (w *CWidget) TriggerTooltipQuery()

Triggers a tooltip query on the display where the toplevel of widget is located. See TooltipTriggerTooltipQuery for more information.

func (*CWidget) Unparent

func (w *CWidget) Unparent()

Unparent is only for use in widget implementations. Should be called by implementations of the remove method on Container, to dissociate a child from the container.

func (*CWidget) UnsetFlags

func (w *CWidget) UnsetFlags(v WidgetFlags)

Removes the given flags from the Widget instance. This method emits an unset-flags signal initially and if the listeners return EVENT_PASS, the change is applied

Emits: SignalUnsetFlags, Argv=[Widget instance, given flags to unset]

func (*CWidget) UnsetState

func (w *CWidget) UnsetState(state StateType)

Removes the given state bitmask from the Widget instance. This method emits an unset-state signal initially and if the listeners return EVENT_PASS, the change is applied

Emit: SignalUnsetState, Argv=[Widget instance, given state to unset]

type CWindow

type CWindow struct {
	CBin
	// contains filtered or unexported fields
}

The CWindow structure implements the Window interface and is exported to facilitate type embedding with custom implementations. No member variables are exported as the interface methods are the only intended means of interacting with Window objects.

func MakeWindow

func MakeWindow() *CWindow

MakeWindow is used by the Buildable system to construct a new Window.

func NewWindow

func NewWindow() (w *CWindow)

NewWindow is a constructor for new Window instances.

func NewWindowWithTitle

func NewWindowWithTitle(title string) (w *CWindow)

NewWindowWithTitle is a constructor for new Window instances that also sets the Window title to the string given.

func (*CWindow) ActivateDefault

func (w *CWindow) ActivateDefault() (value bool)

Activates the default widget for the window, unless the current focused widget has been configured to receive the default action (see WidgetSetReceivesDefault), in which case the focused widget is activated. Returns:

TRUE if a widget got activated.

func (*CWindow) ActivateFocus

func (w *CWindow) ActivateFocus() (value bool)

Activates the current focused widget within the window. Returns:

TRUE if a widget got activated.

func (*CWindow) ActivateKey

func (w *CWindow) ActivateKey(event cdk.EventKey) (value bool)

Activates mnemonics and accelerators for this Window. This is normally called by the default ::key_press_event handler for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window. Parameters:

event	a EventKey

Returns:

TRUE if a mnemonic or accelerator was found and activated.

func (*CWindow) AddAccelGroup

func (w *CWindow) AddAccelGroup(accelGroup AccelGroup)

Associate accel_group with window , such that calling AccelGroupsActivate on window will activate accelerators in accel_group . Parameters:

window	window to attach accelerator group to
accelGroup	a AccelGroup

func (*CWindow) AddMnemonic

func (w *CWindow) AddMnemonic(keyval rune, target interface{})

Adds a mnemonic to this window. Parameters:

keyval	the mnemonic
target	the widget that gets activated by the mnemonic

func (*CWindow) AddStylesFromString added in v0.1.4

func (w *CWindow) AddStylesFromString(css string) (err error)

func (*CWindow) ApplyStylesTo added in v0.1.4

func (w *CWindow) ApplyStylesTo(widget Widget)

func (*CWindow) Build

func (w *CWindow) Build(builder Builder, element *CBuilderElement) error

Build provides customizations to the Buildable system for Window Widgets.

func (*CWindow) Deiconify

func (w *CWindow) Deiconify()

Asks to deiconify (i.e. unminimize) the specified window . Note that you shouldn't assume the window is definitely deiconified afterward, because other entities (e.g. the user or window manager) could iconify it again before your code which assumes deiconification gets to run. You can track iconification via the "window-state-event" signal on Widget.

func (*CWindow) FocusNext

func (w *CWindow) FocusNext() enums.EventFlag

func (*CWindow) FocusPrevious

func (w *CWindow) FocusPrevious() enums.EventFlag

func (*CWindow) Fullscreen

func (w *CWindow) Fullscreen()

Asks to place window in the fullscreen state. Note that you shouldn't assume the window is definitely full screen afterward, because other entities (e.g. the user or window manager) could unfullscreen it again, and not all window managers honor requests to fullscreen windows. But normally the window will end up fullscreen. Just don't write code that crashes if not. You can track the fullscreen state via the "window-state-event" signal on Widget.

func (*CWindow) GetAcceptFocus

func (w *CWindow) GetAcceptFocus() (value bool)

Gets the value set by SetAcceptFocus. Returns:

TRUE if window should receive the input focus

func (*CWindow) GetDecorated

func (w *CWindow) GetDecorated() (value bool)

Returns whether the window has been set to have decorations such as a title bar via SetDecorated. Returns:

TRUE if the window has been set to have decorations

func (*CWindow) GetDefaultSize

func (w *CWindow) GetDefaultSize(width int, height int)

Gets the default size of the window. A value of -1 for the width or height indicates that a default size has not been explicitly set for that dimension, so the "natural" size of the window will be used. Parameters:

width	location to store the default width, or NULL.
height	location to store the default height, or NULL.

func (*CWindow) GetDefaultWidget

func (w *CWindow) GetDefaultWidget() (value Widget)

Returns the default widget for window . See SetDefault for more details. Returns:

the default widget, or NULL if there is none.
[transfer none]

func (*CWindow) GetDeletable

func (w *CWindow) GetDeletable() (value bool)

Returns whether the window has been set to have a close button via SetDeletable. Returns:

TRUE if the window has been set to have a close button

func (*CWindow) GetDestroyWithParent

func (w *CWindow) GetDestroyWithParent() (value bool)

Returns whether the window will be destroyed with its transient parent. See SetDestroyWithParent. Returns:

TRUE if the window will be destroyed with its transient parent.

func (*CWindow) GetDisplay

func (w *CWindow) GetDisplay() (dm cdk.Display)

func (*CWindow) GetEventFocus

func (w *CWindow) GetEventFocus() (o interface{})

func (*CWindow) GetFocus

func (w *CWindow) GetFocus() (focus interface{})

Retrieves the current focused widget within the window. Note that this is the widget that would have the focus if the toplevel window focused; if the toplevel window is not focused then WidgetHasFocus (widget) will not be TRUE for the widget. Returns:

the currently focused widget, or NULL if there is none.
[transfer none]

func (*CWindow) GetFocusOnMap

func (w *CWindow) GetFocusOnMap() (value bool)

Gets the value set by SetFocusOnMap. Returns:

TRUE if window should receive the input focus when mapped.

func (*CWindow) GetMnemonicModifier

func (w *CWindow) GetMnemonicModifier() (value cdk.ModMask)

Returns the mnemonic modifier for this window. See SetMnemonicModifier. Returns:

the modifier mask used to activate mnemonics on this window.

func (*CWindow) GetMnemonicsVisible

func (w *CWindow) GetMnemonicsVisible() (value bool)

func (*CWindow) GetModal

func (w *CWindow) GetModal() (value bool)

Returns whether the window is modal. See SetModal. Returns:

TRUE if the window is set to be modal and establishes a grab
when shown

func (*CWindow) GetNextFocus

func (w *CWindow) GetNextFocus() (next interface{})

func (*CWindow) GetOpacity

func (w *CWindow) GetOpacity() (value float64)

Fetches the requested opacity for this window. See SetOpacity. Returns:

the requested opacity for this window.

func (*CWindow) GetPosition

func (w *CWindow) GetPosition(rootX int, rootY int)

This function returns the position you need to pass to Move to keep window in its current position. This means that the meaning of the returned value varies with window gravity. See Move for more details. If you haven't changed the window gravity, its gravity will be GDK_GRAVITY_NORTH_WEST. This means that GetPosition gets the position of the top-left corner of the window manager frame for the window. Move sets the position of this same top-left corner. GetPosition is not 100% reliable because the X Window System does not specify a way to obtain the geometry of the decorations placed on a window by the window manager. Thus CTK is using a "best guess" that works with most window managers. Moreover, nearly all window managers are historically broken with respect to their handling of window gravity. So moving a window to its current position as returned by GetPosition tends to result in moving the window slightly. Window managers are slowly getting better over time. If a window has gravity GDK_GRAVITY_STATIC the window manager frame is not relevant, and thus GetPosition will always produce accurate results. However you can't use static gravity to do things like place a window in a corner of the screen, because static gravity ignores the window manager decorations. If you are saving and restoring your application's window positions, you should know that it's impossible for applications to do this without getting it somewhat wrong because applications do not have sufficient knowledge of window manager state. The Correct Mechanism is to support the session management protocol (see the "GnomeClient" object in the GNOME libraries for example) and allow the window manager to save your window sizes and positions. Parameters:

rootX	return location for X coordinate of gravity-determined reference point.
rootY	return location for Y coordinate of gravity-determined reference point.

func (*CWindow) GetPreviousFocus

func (w *CWindow) GetPreviousFocus() (previous interface{})

func (*CWindow) GetResizable

func (w *CWindow) GetResizable() (value bool)

GetResizable returns the value set by SetResizable.

func (*CWindow) GetRole

func (w *CWindow) GetRole() (value string)

Returns the role of the window. See SetRole for further explanation. Returns:

the role of the window if set, or NULL. The returned is owned
by the widget and must not be modified or freed.

func (*CWindow) GetSize

func (w *CWindow) GetSize() (width, height int)

Obtains the current size of window . If window is not onscreen, it returns the size CTK will suggest to the window manager for the initial window size (but this is not reliably the same as the size the window manager will actually select). The size obtained by GetSize is the last size received in a EventConfigure, that is, CTK uses its locally-stored size, rather than querying the X server for the size. As a result, if you call Resize then immediately call GetSize, the size won't have taken effect yet. After the window manager processes the resize request, CTK receives notification that the size has changed via a configure event, and the size of the window gets updated. Note 1: Nearly any use of this function creates a race condition, because the size of the window may change between the time that you get the size and the time that you perform some action assuming that size is the current size. To avoid race conditions, connect to "configure-event" on the window and adjust your size-dependent state to match the size delivered in the EventConfigure. Note 2: The returned size does not include the size of the window manager decorations (aka the window frame or border). Those are not drawn by CTK and CTK has no reliable method of determining their size. Note 3: If you are getting a window size in order to position the window onscreen, there may be a better way. The preferred way is to simply set the window's semantic type with SetTypeHint, which allows the window manager to e.g. center dialogs. Also, if you set the transient parent of dialogs with SetTransientFor window managers will often center the dialog over its parent window. It's much preferred to let the window manager handle these things rather than doing it yourself, because all apps will behave consistently and according to user prefs if the window manager handles it. Also, the window manager can take the size of the window decorations/border into account, while your application cannot. In any case, if you insist on application-specified window positioning, there's still a better way than doing it yourself - SetPosition will frequently handle the details for you. Parameters:

width	return location for width, or NULL.
height	return location for height, or NULL.

func (*CWindow) GetSkipPagerHint

func (w *CWindow) GetSkipPagerHint() (value bool)

Gets the value set by SetSkipPagerHint. Returns:

TRUE if window shouldn't be in pager

func (*CWindow) GetSkipTaskbarHint

func (w *CWindow) GetSkipTaskbarHint() (value bool)

Gets the value set by SetSkipTaskbarHint Returns:

TRUE if window shouldn't be in taskbar

func (*CWindow) GetTitle

func (w *CWindow) GetTitle() (value string)

Retrieves the title of the window. See SetTitle. Returns:

the title of the window, or NULL if none has been set
explicitely. The returned string is owned by the widget and
must not be modified or freed.

func (*CWindow) GetTransientFor

func (w *CWindow) GetTransientFor() (value Window)

Fetches the transient parent for this window. See SetTransientFor. Returns:

the transient parent for this window, or NULL if no transient
parent has been set.
[transfer none]

func (*CWindow) GetUrgencyHint

func (w *CWindow) GetUrgencyHint() (value bool)

Gets the value set by SetUrgencyHint Returns:

TRUE if window is urgent

func (*CWindow) GetVBox

func (w *CWindow) GetVBox() (vbox VBox)

func (*CWindow) HasGroup

func (w *CWindow) HasGroup() (value bool)

Returns whether window has an explicit window group. Returns:

TRUE if window has an explicit window group.
Since 2.22

func (*CWindow) HasToplevelFocus

func (w *CWindow) HasToplevelFocus() (focused bool)

Returns whether the input focus is within this Window. For real toplevel windows, this is identical to IsActive, but for embedded windows, like Plug, the results will differ. Returns:

TRUE if the input focus is within this Window

func (*CWindow) Iconify

func (w *CWindow) Iconify()

Asks to iconify (i.e. minimize) the specified window . Note that you shouldn't assume the window is definitely iconified afterward, because other entities (e.g. the user or window manager) could deiconify it again, or there may not be a window manager in which case iconification isn't possible, etc. But normally the window will end up iconified. Just don't write code that crashes if not. It's permitted to call this function before showing a window, in which case the window will be iconified before it ever appears onscreen. You can track iconification via the "window-state-event" signal on Widget.

func (*CWindow) Init

func (w *CWindow) Init() (already bool)

Init initializes a Window object. This must be called at least once to set up the necessary defaults and allocate any memory structures. Calling this more than once is safe though unnecessary. Only the first call will result in any effect upon the Window instance. Init is used in the NewWindow constructor and only necessary when implementing a derivative Window type.

func (*CWindow) IsActive

func (w *CWindow) IsActive() (active bool)

Returns whether the window is part of the current active toplevel. (That is, the toplevel window receiving keystrokes.) The return value is TRUE if the window is active toplevel itself, but also if it is, say, a Plug embedded in the active toplevel. You might use this function if you wanted to draw a widget differently in an active window from a widget in an inactive window. See HasToplevelFocus Returns:

TRUE if the window part of the current active window.

func (*CWindow) ListTopLevels

func (w *CWindow) ListTopLevels() (value []Window)

Returns a list of all existing toplevel windows. The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and then unref all the widgets afterwards. Returns:

list of toplevel widgets.
[element-type Widget][transfer container]

func (*CWindow) Maximize

func (w *CWindow) Maximize()

Asks to maximize window , so that it becomes full-screen. Note that you shouldn't assume the window is definitely maximized afterward, because other entities (e.g. the user or window manager) could unmaximize it again, and not all window managers support maximization. But normally the window will end up maximized. Just don't write code that crashes if not. It's permitted to call this function before showing a window, in which case the window will be maximized when it appears onscreen initially. You can track maximization via the "window-state-event" signal on Widget.

func (*CWindow) MnemonicActivate

func (w *CWindow) MnemonicActivate(keyval rune, modifier cdk.ModMask) (activated bool)

Activates the targets associated with the mnemonic. Parameters:

keyval	the mnemonic
modifier	the modifiers
returns	TRUE if the activation is done.

func (*CWindow) Move

func (w *CWindow) Move(x int, y int)

Asks the window manager to move window to the given position. Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown. Note: the position is the position of the gravity-determined reference point for the window. The gravity determines two things: first, the location of the reference point in root window coordinates; and second, which point on the window is positioned at the reference point. By default the gravity is GDK_GRAVITY_NORTH_WEST, so the reference point is simply the x , y supplied to Move. The top-left corner of the window decorations (aka window frame or border) will be placed at x , y . Therefore, to position a window at the top left of the screen, you want to use the default gravity (which is GDK_GRAVITY_NORTH_WEST) and move the window to 0,0. To position a window at the bottom right corner of the screen, you would set GDK_GRAVITY_SOUTH_EAST, which means that the reference point is at x + the window width and y + the window height, and the bottom-right corner of the window border will be placed at that reference point. So, to place a window in the bottom right corner you would first set gravity to south east, then write: Move (window, ScreenWidth - window_width, ScreenHeight - window_height) (note that this example does not take multi-head scenarios into account). The Extended Window Manager Hints specification at http://www.freedesktop.org/Standards/wm-spec has a nice table of gravities in the "implementation notes" section. The GetPosition documentation may also be relevant. Parameters:

x	X coordinate to move window to
y	Y coordinate to move window to

func (*CWindow) ParseGeometry

func (w *CWindow) ParseGeometry(geometry string) (value bool)

Parses a standard X Window System geometry string - see the manual page for X (type 'man X') for details on this. ParseGeometry does work on all CTK ports including Win32 but is primarily intended for an X environment. If either a size or a position can be extracted from the geometry string, ParseGeometry returns TRUE and calls SetDefaultSize and/or Move to resize/move the window. If ParseGeometry returns TRUE, it will also set the GDK_HINT_USER_POS and/or GDK_HINT_USER_SIZE hints indicating to the window manager that the size/position of the window was user-specified. This causes most window managers to honor the geometry. Note that for ParseGeometry to work as expected, it has to be called when the window has its "final" size, i.e. after calling WidgetShowAll on the contents and SetGeometryHints on the window. Parameters:

geometry	geometry string

Returns:

TRUE if string was parsed successfully

func (*CWindow) Present

func (w *CWindow) Present()

Presents a window to the user. This may mean raising the window in the stacking order, deiconifying it, moving it to the current desktop, and/or giving it the keyboard focus, possibly dependent on the user's platform, window manager, and preferences. If window is hidden, this function calls WidgetShow as well. This function should be used when the user tries to open a window that's already open. Say for example the preferences dialog is currently open, and the user chooses Preferences from the menu a second time; use Present to move the already-open dialog where the user can see it. If you are calling this function in response to a user interaction, it is preferable to use PresentWithTime.

func (*CWindow) PresentWithTime

func (w *CWindow) PresentWithTime(timestamp int)

Presents a window to the user in response to a user interaction. If you need to present a window without a timestamp, use Present. See Present for details. Parameters:

timestamp	the timestamp of the user interaction (typically a

button or key press event) which triggered this call

func (*CWindow) PropagateKeyEvent

func (w *CWindow) PropagateKeyEvent(event cdk.EventKey) (value bool)

Propagate a key press or release event to the focus widget and up the focus container chain until a widget handles event . This is normally called by the default ::key_press_event and ::key_release_event handlers for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window. Parameters:

event	a EventKey

Returns:

TRUE if a widget in the focus chain handled the event.

func (*CWindow) RemoveAccelGroup

func (w *CWindow) RemoveAccelGroup(accelGroup AccelGroup)

Reverses the effects of AddAccelGroup. Parameters:

accelGroup	a AccelGroup

func (*CWindow) RemoveMnemonic

func (w *CWindow) RemoveMnemonic(keyval rune, target interface{})

Removes a mnemonic from this window. Parameters:

keyval	the mnemonic
target	the widget that gets activated by the mnemonic

func (*CWindow) RemoveWidgetMnemonics

func (w *CWindow) RemoveWidgetMnemonics(target interface{})

Removes all mnemonics from this window for the target Widget. Parameters:

target	the widget that gets activated by the mnemonic

func (*CWindow) ReplaceStylesFromString added in v0.1.4

func (w *CWindow) ReplaceStylesFromString(css string) (err error)

func (*CWindow) ReshowWithInitialSize

func (w *CWindow) ReshowWithInitialSize()

Hides window , then reshows it, resetting the default size and position of the window. Used by GUI builders only.

func (*CWindow) SetAcceptFocus

func (w *CWindow) SetAcceptFocus(setting bool)

Windows may set a hint asking the desktop environment not to receive the input focus. This function sets this hint. Parameters:

setting	TRUE to let this window receive input focus

func (*CWindow) SetAutoStartupNotification

func (w *CWindow) SetAutoStartupNotification(setting bool)

By default, after showing the first Window, CTK calls NotifyStartupComplete. Call this function to disable the automatic startup notification. You might do this if your first window is a splash screen, and you want to delay notification until after your real main window has been shown, for example. In that example, you would disable startup notification temporarily, show your splash screen, then re-enable it so that showing the main window would automatically result in notification. Parameters:

setting	TRUE to automatically do startup notification

func (*CWindow) SetDecorated

func (w *CWindow) SetDecorated(setting bool)

By default, windows are decorated with a title bar, resize controls, etc. Some window managers allow CTK to disable these decorations, creating a borderless window. If you set the decorated property to FALSE using this function, CTK will do its best to convince the window manager not to decorate the window. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling Show. On Windows, this function always works, since there's no window manager policy involved. Parameters:

setting	TRUE to decorate the window

func (*CWindow) SetDefault

func (w *CWindow) SetDefault(defaultWidget Widget)

The default widget is the widget that's activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a Window about. When setting (rather than unsetting) the default widget it's generally easier to call WidgetGrabFocus on the widget. Before making a widget the default widget, you must set the GTK_CAN_DEFAULT flag on the widget you'd like to make the default using GTK_WIDGET_SET_FLAGS. Parameters:

defaultWidget	widget to be the default, or NULL to unset the

default widget for the toplevel.

func (*CWindow) SetDeletable

func (w *CWindow) SetDeletable(setting bool)

By default, windows have a close button in the window frame. Some disable this button. If you set the deletable property to FALSE using this function, CTK will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling Show. On Windows, this function always works, since there's no window manager policy involved. Parameters:

setting	TRUE to decorate the window as deletable

func (*CWindow) SetDestroyWithParent

func (w *CWindow) SetDestroyWithParent(setting bool)

If setting is TRUE, then destroying the transient parent of window will also destroy window itself. This is useful for dialogs that shouldn't persist beyond the lifetime of the main window they're associated with, for example. Parameters:

setting	whether to destroy window

with its transient parent

func (*CWindow) SetDisplay

func (w *CWindow) SetDisplay(dm cdk.Display)

func (*CWindow) SetEventFocus

func (w *CWindow) SetEventFocus(o interface{})

func (*CWindow) SetFocus

func (w *CWindow) SetFocus(focus interface{})

If focus is not the current focus widget, and is focusable, sets it as the focus widget for the window. If focus is NULL, unsets the focus widget for this window. To set the focus to a particular widget in the toplevel, it is usually more convenient to use WidgetGrabFocus instead of this function.

Parameters:

focus	widget to be the new focus widget, or NULL to unset

func (*CWindow) SetFocusOnMap

func (w *CWindow) SetFocusOnMap(setting bool)

Windows may set a hint asking the desktop environment not to receive the input focus when the window is mapped. This function sets this hint. Parameters:

setting	TRUE to let this window receive input focus on map

func (*CWindow) SetKeepAbove

func (w *CWindow) SetKeepAbove(setting bool)

Asks to keep window above, so that it stays on top. Note that you shouldn't assume the window is definitely above afterward, because other entities (e.g. the user or window manager) could not keep it above, and not all window managers support keeping windows above. But normally the window will end kept above. Just don't write code that crashes if not. It's permitted to call this function before showing a window, in which case the window will be kept above when it appears onscreen initially. You can track the above state via the "window-state-event" signal on Widget. Note that, according to the Extended Window Manager Hints specification, the above state is mainly meant for user preferences and should not be used by applications e.g. for drawing attention to their dialogs. Parameters:

setting	whether to keep window

above other windows

func (*CWindow) SetKeepBelow

func (w *CWindow) SetKeepBelow(setting bool)

Asks to keep window below, so that it stays in bottom. Note that you shouldn't assume the window is definitely below afterward, because other entities (e.g. the user or window manager) could not keep it below, and not all window managers support putting windows below. But normally the window will be kept below. Just don't write code that crashes if not. It's permitted to call this function before showing a window, in which case the window will be kept below when it appears onscreen initially. You can track the below state via the "window-state-event" signal on Widget. Note that, according to the Extended Window Manager Hints specification, the above state is mainly meant for user preferences and should not be used by applications e.g. for drawing attention to their dialogs. Parameters:

setting	whether to keep window

below other windows

func (*CWindow) SetMnemonicModifier

func (w *CWindow) SetMnemonicModifier(modifier cdk.ModMask)

Sets the mnemonic modifier for this window. Parameters:

modifier	the modifier mask used to activate

mnemonics on this window.

func (*CWindow) SetMnemonicsVisible

func (w *CWindow) SetMnemonicsVisible(setting bool)

Sets the mnemonics-visible property. Parameters:

setting	the new value

func (*CWindow) SetModal

func (w *CWindow) SetModal(modal bool)

Sets a window modal or non-modal. Modal windows prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use SetTransientFor to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent. Parameters:

modal	whether the window is modal

func (*CWindow) SetOpacity

func (w *CWindow) SetOpacity(opacity float64)

Request the windowing system to make window partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Values of the opacity parameter are clamped to the [0,1] range.) On X11 this has any effect only on X screens with a compositing manager running. See WidgetIsComposited. On Windows it should work always. Note that setting a window's opacity after the window has been shown causes it to flicker once on Windows. Parameters:

opacity	desired opacity, between 0 and 1

func (*CWindow) SetPosition

func (w *CWindow) SetPosition(position WindowPosition)

Sets a position constraint for this window. If the old or new constraint is GTK_WIN_POS_CENTER_ALWAYS, this will also cause the window to be repositioned to satisfy the new constraint. Parameters:

position	a position constraint.

func (*CWindow) SetResizable

func (w *CWindow) SetResizable(resizable bool)

SetResizable updates whether the user can resize a window. Windows are user resizable by default.

Parameters:

resizable	TRUE if the user can resize this window

func (*CWindow) SetRole

func (w *CWindow) SetRole(role string)

This function is only useful on X11, not with other CTK targets. In combination with the window title, the window role allows a same" window when an application is restarted. So for example you might set the "toolbox" role on your app's toolbox window, so that when the user restarts their session, the window manager can put the toolbox back in the same place. If a window already has a unique title, you don't need to set the role, since the WM can use the title to identify the window when restoring the session. Parameters:

role	unique identifier for the window to be used when restoring a session

func (*CWindow) SetSkipPagerHint

func (w *CWindow) SetSkipPagerHint(setting bool)

Windows may set a hint asking the desktop environment not to display the window in the pager. This function sets this hint. (A "pager" is any desktop navigation tool such as a workspace switcher that displays a thumbnail representation of the windows on the screen.) Parameters:

setting	TRUE to keep this window from appearing in the pager

func (*CWindow) SetSkipTaskbarHint

func (w *CWindow) SetSkipTaskbarHint(setting bool)

Windows may set a hint asking the desktop environment not to display the window in the task bar. This function sets this hint. Parameters:

setting	TRUE to keep this window from appearing in the task bar

func (*CWindow) SetStartupId

func (w *CWindow) SetStartupId(startupId string)

Startup notification identifiers are used by desktop environment to track application startup, to provide user feedback and other features. This function changes the corresponding property on the underlying Window. Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes. You should use this function before calling Present or any equivalent function generating a window map event. This function is only useful on X11, not with other CTK targets. Parameters:

startupId	a string with startup-notification identifier

func (*CWindow) SetTitle

func (w *CWindow) SetTitle(title string)

SetTitle updates the title of the Window. The title of a window will be displayed in its title bar; on the X Window System, the title bar is rendered by the window manager, so exactly how the title appears to users may vary according to a user's exact configuration. The title should help a user distinguish this window from other windows they may have open. A good title might include the application name and current document filename, for example.

Parameters:

title	text for the title of the window

func (*CWindow) SetTransientFor

func (w *CWindow) SetTransientFor(parent Window)

Dialog windows should be set transient for the main application window they were spawned from. This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window. DialogNewWithButtons and other convenience functions in CTK will sometimes call SetTransientFor on your behalf. Passing NULL for parent unsets the current transient window. On Windows, this function puts the child window on top of the parent, much as the window manager would have done on X. Parameters:

parent	parent window, or NULL.

func (*CWindow) SetUrgencyHint

func (w *CWindow) SetUrgencyHint(setting bool)

Windows may set a hint asking the desktop environment to draw the users attention to the window. This function sets this hint. Parameters:

setting	TRUE to mark this window as urgent

func (*CWindow) Stick

func (w *CWindow) Stick()

Asks to stick window , which means that it will appear on all user desktops. Note that you shouldn't assume the window is definitely stuck afterward, because other entities (e.g. the user or window manager) could unstick it again, and some window managers do not support sticking windows. But normally the window will end up stuck. Just don't write code that crashes if not. It's permitted to call this function before showing a window. You can track stickiness via the "window-state-event" signal on Widget.

func (*CWindow) Unfullscreen

func (w *CWindow) Unfullscreen()

Asks to toggle off the fullscreen state for window . Note that you shouldn't assume the window is definitely not full screen afterward, because other entities (e.g. the user or window manager) could fullscreen it again, and not all window managers honor requests to unfullscreen windows. But normally the window will end up restored to its normal state. Just don't write code that crashes if not. You can track the fullscreen state via the "window-state-event" signal on Widget.

func (*CWindow) Unmaximize

func (w *CWindow) Unmaximize()

Asks to unmaximize window . Note that you shouldn't assume the window is definitely unmaximized afterward, because other entities (e.g. the user or window manager) could maximize it again, and not all window managers honor requests to unmaximize. But normally the window will end up unmaximized. Just don't write code that crashes if not. You can track maximization via the "window-state-event" signal on Widget.

func (*CWindow) Unstick

func (w *CWindow) Unstick()

Asks to unstick window , which means that it will appear on only one of the user's desktops. Note that you shouldn't assume the window is definitely unstuck afterward, because other entities (e.g. the user or window manager) could stick it again. But normally the window will end up stuck. Just don't write code that crashes if not. You can track stickiness via the "window-state-event" signal on Widget.

type CalendarDisplayOptions

type CalendarDisplayOptions uint64

Calendar display options

const (
	CALENDAR_SHOW_HEADING   CalendarDisplayOptions = 1 << 0
	CALENDAR_SHOW_DAY_NAMES CalendarDisplayOptions = 1 << iota
	CALENDAR_NO_MONTH_CHANGE
	CALENDAR_SHOW_WEEK_NUMBERS
	CALENDAR_WEEK_START_MONDAY
	CALENDAR_SHOW_DETAILS
)

type CellRendererAccelMode

type CellRendererAccelMode uint64

Cell renderer accel mode

const (
	CELL_RENDERER_ACCEL_MODE_CTK CellRendererAccelMode = iota
	CELL_RENDERER_ACCEL_MODE_OTHER
)

type CellRendererMode

type CellRendererMode uint64

Cell renderer mode

const (
	CELL_RENDERER_MODE_INERT CellRendererMode = iota
	CELL_RENDERER_MODE_ACTIVATABLE
	CELL_RENDERER_MODE_EDITABLE
)

type CellRendererState

type CellRendererState uint64

Cell renderer state

const (
	CELL_RENDERER_SELECTED CellRendererState = 1 << 0
	CELL_RENDERER_PRELIT   CellRendererState = 1 << iota
	CELL_RENDERER_INSENSITIVE
	CELL_RENDERER_SORTED
	CELL_RENDERER_FOCUSED
)

type CellType

type CellType uint64

Cell type

const (
	CELL_EMPTY CellType = iota
	CELL_TEXT
	CELL_PIXMAP
	CELL_PIXTEXT
	CELL_WIDGET
)

type Container

type Container interface {
	Widget
	Buildable

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	SetOrigin(x, y int)
	SetWindow(w Window)
	ShowAll()
	Add(w Widget)
	AddWithProperties(widget Widget, argv ...interface{})
	Remove(w Widget)
	ResizeChildren()
	ChildType() (value cdk.CTypeTag)
	GetChildren() (children []Widget)
	GetFocusChild() (value Widget)
	SetFocusChild(child Widget)
	GetFocusVAdjustment() (value Adjustment)
	SetFocusVAdjustment(adjustment Adjustment)
	GetFocusHAdjustment() (value Adjustment)
	SetFocusHAdjustment(adjustment Adjustment)
	ChildGet(child Widget, properties ...cdk.Property) (values []interface{})
	ChildSet(child Widget, argv ...interface{})
	GetChildProperty(child Widget, propertyName cdk.Property) (value interface{})
	SetChildProperty(child Widget, propertyName cdk.Property, value interface{})
	GetBorderWidth() (value int)
	SetBorderWidth(borderWidth int)
	GetFocusChain() (focusableWidgets []interface{}, explicitlySet bool)
	SetFocusChain(focusableWidgets []interface{})
	UnsetFocusChain()
	FindChildProperty(property cdk.Property) (value *cdk.CProperty)
	InstallChildProperty(name cdk.Property, kind cdk.PropertyType, write bool, def interface{}) error
	ListChildProperties() (properties []*cdk.CProperty)
	GetWidgetAt(p *ptypes.Point2I) Widget
}

Container Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
      +- Box
      +- CList
      +- Fixed
      +- Paned
      +- IconView
      +- Layout
      +- List
      +- MenuShell
      +- Notebook
      +- Socket
      +- Table
      +- TextView
      +- Toolbar
      +- ToolItemGroup
      +- ToolPalette
      +- Tree
      +- TreeView

In the Curses Tool Kit, the Container interface is an extension of the CTK Widget interface and for all intents and purposes, this is the base class for any CTK type that will contain other widgets. The Container also supports the tracking of focus and default widgets by maintaining two chain-list types: FocusChain and DefaultChain.

Note that currently CTK only supports the FocusChain

type CornerType

type CornerType uint64

Corner type

const (
	CornerTopLeft CornerType = iota
	CornerBottomLeft
	CornerTopRight
	CornerBottomRight
)

type CurveType

type CurveType uint64

Curve type

const (
	CURVE_TYPE_LINEAR CurveType = iota
	CURVE_TYPE_SPLINE
	CURVE_TYPE_FREE
)

type DebugFlag

type DebugFlag uint64

Debug flag

const (
	DEBUG_MISC       DebugFlag = 1 << 0
	DEBUG_PLUGSOCKET DebugFlag = 1 << iota
	DEBUG_TEXT
	DEBUG_TREE
	DEBUG_UPDATES
	DEBUG_KEYBINDINGS
	DEBUG_MULTIHEAD
	DEBUG_MODULES
	DEBUG_GEOMETRY
	DEBUG_ICONTHEME
	DEBUG_PRINTING
	DEBUG_BUILDER
)

type DeleteType

type DeleteType uint64

Delete type

const (
	DELETE_CHARS DeleteType = iota
	DELETE_WORD_ENDS
	DELETE_WORDS
	DELETE_DISPLAY_LINES
	DELETE_DISPLAY_LINE_ENDS
	DELETE_PARAGRAPH_ENDS
	DELETE_PARAGRAPHS
	DELETE_WHITESPACE
)

type Dialog

type Dialog interface {
	Window
	Buildable

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	Run() (response chan ResponseType)
	Response(responseId ResponseType)
	AddButton(buttonText string, responseId ResponseType) (value Button)
	AddButtons(argv ...interface{})
	AddActionWidget(child Widget, responseId ResponseType)
	AddSecondaryActionWidget(child Widget, responseId ResponseType)
	SetDefaultResponse(responseId ResponseType)
	SetResponseSensitive(responseId ResponseType, sensitive bool)
	GetResponseForWidget(widget Widget) (value ResponseType)
	GetWidgetForResponse(responseId ResponseType) (value Widget)
	GetActionArea() (value ButtonBox)
	GetContentArea() (value VBox)
	Show()
	ShowAll()
	Destroy()
}

Dialog Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Window
          +- Dialog
            +- AboutDialog
            +- ColorSelectionDialog
            +- FileChooserDialog
            +- FileSelection
            +- FontSelectionDialog
            +- InputDialog
            +- MessageDialog
            +- PageSetupUnixDialog
            +- PrintUnixDialog
            +- RecentChooserDialog

The Dialog Widget is a Window with actionable Buttons, typically intended to be used as a transient for another Window rather than a Window on its own.

type DialogFlags

type DialogFlags uint64

Dialog flags

const (
	DialogModal             DialogFlags = 1 << 0
	DialogDestroyWithParent DialogFlags = 1 << iota
	DialogNoSeparator
)

type DirectionType

type DirectionType uint64

Direction type

const (
	DIR_TAB_FORWARD DirectionType = iota
	DIR_TAB_BACKWARD
	DIR_UP
	DIR_DOWN
	DIR_LEFT
	DIR_RIGHT
)

type Drawable

type Drawable interface {
	Hide()
	Show()
	ShowAll()
	IsVisible() bool
	HasPoint(p *ptypes.Point2I) bool
	GetWidgetAt(p *ptypes.Point2I) (instance interface{})
	GetSizeRequest() (size ptypes.Rectangle)
	SetSizeRequest(x, y int)
	GetTheme() (theme paint.Theme)
	SetTheme(theme paint.Theme)
	GetThemeRequest() (theme paint.Theme)
	GetOrigin() (origin ptypes.Point2I)
	SetOrigin(x, y int)
	GetAllocation() (alloc ptypes.Rectangle)
	SetAllocation(alloc ptypes.Rectangle)
	Invalidate() enums.EventFlag
	Resize() enums.EventFlag
	Draw() enums.EventFlag
}

type EntryIconPosition

type EntryIconPosition uint64

Entry icon position

const (
	ENTRY_ICON_PRIMARY EntryIconPosition = iota
	ENTRY_ICON_SECONDARY
)

type EnumFromString

type EnumFromString interface {
	FromString(value string) (enum interface{}, err error)
}

type ErrorType

type ErrorType uint64

Error type

const (
	ERR_UNKNOWN ErrorType = iota
	ERR_UNEXP_EOF
	ERR_UNEXP_EOF_IN_STRING
	ERR_UNEXP_EOF_IN_COMMENT
	ERR_NON_DIGIT_IN_CONST
	ERR_DIGIT_RADIX
	ERR_FLOAT_RADIX
	ERR_FLOAT_MALFORMED
)

type EventBox

type EventBox interface {
	Bin
	Buildable

	Init() (already bool)
	SetAboveChild(aboveChild bool)
	GetAboveChild() (value bool)
	SetVisibleWindow(visibleWindow bool)
	GetVisibleWindow() (value bool)
	Activate() (value bool)
	CancelEvent()
	ProcessEvent(evt cdk.Event) enums.EventFlag
	GrabFocus()
	GrabEventFocus()
}

EventBox Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- EventBox

The EventBox Widget is used to capture Widget events (mouse, keyboard) without needing having any defined user-interface.

type ExpanderStyle

type ExpanderStyle uint64

Expander style

const (
	EXPANDER_COLLAPSED ExpanderStyle = iota
	EXPANDER_SEMI_COLLAPSED
	EXPANDER_SEMI_EXPANDED
	EXPANDER_EXPANDED
)

type ExtensionMode

type ExtensionMode uint64
const (
	EXTENSION_EVENTS_NONE ExtensionMode = iota
	EXTENSION_EVENTS_ALL
	EXTENSION_EVENTS_CURSOR
)

type FileChooserAction

type FileChooserAction uint64

File chooser action

const (
	FILE_CHOOSER_ACTION_OPEN FileChooserAction = iota
	FILE_CHOOSER_ACTION_SAVE
	FILE_CHOOSER_ACTION_SELECT_FOLDER
	FILE_CHOOSER_ACTION_CREATE_FOLDER
)

type FileChooserConfirmation

type FileChooserConfirmation uint64

File chooser confirmation

const (
	FILE_CHOOSER_CONFIRMATION_CONFIRM FileChooserConfirmation = iota
	FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME
	FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
)

type FileChooserError

type FileChooserError uint64

File chooser error

const (
	FILE_CHOOSER_ERROR_NONEXISTENT FileChooserError = iota
	FILE_CHOOSER_ERROR_BAD_FILENAME
	FILE_CHOOSER_ERROR_ALREADY_EXISTS
	FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME
)

type FileChooserProp

type FileChooserProp uint64

File chooser prop

const (
	FILE_CHOOSER_PROP_FIRST               FileChooserProp = 0
	FILE_CHOOSER_PROP_ACTION              FileChooserProp = FileChooserProp(FILE_CHOOSER_PROP_FIRST)
	FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND FileChooserProp = iota
	FILE_CHOOSER_PROP_FILTER
	FILE_CHOOSER_PROP_LOCAL_ONLY
	FILE_CHOOSER_PROP_PREVIEW_WIDGET
	FILE_CHOOSER_PROP_PREVIEW_WIDGET_ACTIVE
	FILE_CHOOSER_PROP_USE_PREVIEW_LABEL
	FILE_CHOOSER_PROP_EXTRA_WIDGET
	FILE_CHOOSER_PROP_SELECT_MULTIPLE
	FILE_CHOOSER_PROP_SHOW_HIDDEN
	FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION
	FILE_CHOOSER_PROP_CREATE_FOLDERS
	FILE_CHOOSER_PROP_LAST FileChooserProp = FileChooserProp(FILE_CHOOSER_PROP_CREATE_FOLDERS)
)

type FileFilterFlags

type FileFilterFlags uint64

File filter flags

const (
	FILE_FILTER_FILENAME FileFilterFlags = 1 << 0
	FILE_FILTER_URI      FileFilterFlags = 1 << iota
	FILE_FILTER_DISPLAY_NAME
	FILE_FILTER_MIME_TYPE
)

type Frame

type Frame interface {
	Bin
	Buildable

	Init() (already bool)
	GetLabel() (value string)
	SetLabel(label string)
	GetLabelWidget() (value Widget)
	SetLabelWidget(labelWidget Widget)
	GetLabelAlign() (xAlign float64, yAlign float64)
	SetLabelAlign(xAlign float64, yAlign float64)
	GetShadowType() (value ShadowType)
	SetShadowType(shadowType ShadowType)
	GrabFocus()
	Add(w Widget)
	Remove(w Widget)
	IsFocus() bool
	GetFocusWithChild() (focusWithChild bool)
	SetFocusWithChild(focusWithChild bool)
	GetWidgetAt(p *ptypes.Point2I) Widget
	GetThemeRequest() (theme paint.Theme)
	GetSizeRequest() (width, height int)
}

Frame Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Frame
          +- AspectFrame

The Frame Widget wraps other Widgets with a border and optional title label.

type GClosure

type GClosure = func(argv ...interface{}) (handled bool)

type Gravity

type Gravity uint64
const (
	// The reference point is at the top left corner.
	GravityNorthWest Gravity = iota
	// The reference point is in the middle of the top edge.
	GravityNorth
	// The reference point is at the top right corner.
	GravityNorthEast
	// The reference point is at the middle of the left edge.
	GravityWest
	// The reference point is at the center of the window.
	GravityCenter
	// The reference point is at the middle of the right edge.
	GravityEast
	// The reference point is at the lower left corner.
	GravitySouthWest
	// The reference point is at the middle of the lower edge.
	GravitySouth
	// The reference point is at the lower right corner.
	GravitySouthEast
	// The reference point is at the top left corner of the window itself, ignoring window manager decorations.
	GravityStatic
)

func (Gravity) FromString

func (t Gravity) FromString(value string) (enum interface{}, err error)

type HBox

type HBox interface {
	Box

	Init() bool
}

type HButtonBox

type HButtonBox interface {
	ButtonBox

	Init() bool
}

type HScrollbar

type HScrollbar interface {
	Scrollbar

	Init() (already bool)
}

type IMPreeditStyle

type IMPreeditStyle uint64

Preedit style

const (
	IM_PREEDIT_NOTHING IMPreeditStyle = iota
	IM_PREEDIT_CALLBACK
	IM_PREEDIT_NONE
)

type IMStatusStyle

type IMStatusStyle uint64

Status style

const (
	IM_STATUS_NOTHING IMStatusStyle = iota
	IM_STATUS_CALLBACK
	IM_STATUS_NONE
)

type IconLookupFlags

type IconLookupFlags uint64

Icon lookup flags

const (
	ICON_LOOKUP_NO_SVG    IconLookupFlags = 1 << 0
	ICON_LOOKUP_FORCE_SVG IconLookupFlags = 1 << iota
	ICON_LOOKUP_USE_BUILTIN
	ICON_LOOKUP_GENERIC_FALLBACK
	ICON_LOOKUP_FORCE_SIZE
)

type IconSize

type IconSize uint64

Icon size

const (
	ICON_SIZE_INVALID IconSize = iota
	ICON_SIZE_MENU
	ICON_SIZE_SMALL_TOOLBAR
	ICON_SIZE_LARGE_TOOLBAR
	ICON_SIZE_BUTTON
	ICON_SIZE_DND
	ICON_SIZE_DIALOG
)

type IconThemeError

type IconThemeError uint64

Icon style error

const (
	ICON_THEME_NOT_FOUND IconThemeError = iota
	ICON_THEME_FAILED
)

type IconViewDropPosition

type IconViewDropPosition uint64

Icon view drop position

const (
	ICON_VIEW_NO_DROP IconViewDropPosition = iota
	ICON_VIEW_DROP_INTO
	ICON_VIEW_DROP_LEFT
	ICON_VIEW_DROP_RIGHT
	ICON_VIEW_DROP_ABOVE
	ICON_VIEW_DROP_BELOW
)

type ImageType

type ImageType uint64

Image type

const (
	IMAGE_EMPTY ImageType = iota
	IMAGE_PIXMAP
	IMAGE_IMAGE
	IMAGE_PIXBUF
	IMAGE_STOCK
	IMAGE_ICON_SET
	IMAGE_ANIMATION
	IMAGE_ICON_NAME
	IMAGE_GICON
)

type Label

type Label interface {
	Misc
	Alignable
	Buildable

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	SetText(text string)
	SetAttributes(attrs paint.Style)
	SetMarkup(text string) (parseError error)
	SetMarkupWithMnemonic(str string) (err error)
	SetJustify(justify enums.Justification)
	SetEllipsize(mode bool)
	SetWidthChars(nChars int)
	SetMaxWidthChars(nChars int)
	SetLineWrap(wrap bool)
	SetLineWrapMode(wrapMode enums.WrapMode)
	GetMnemonicKeyVal() (value rune)
	GetSelectable() (value bool)
	GetText() (value string)
	SelectRegion(startOffset int, endOffset int)
	SetMnemonicWidget(widget Widget)
	SetSelectable(setting bool)
	SetTextWithMnemonic(str string)
	GetAttributes() (value paint.Style)
	GetJustify() (value enums.Justification)
	GetEllipsize() (value bool)
	GetWidthChars() (value int)
	GetMaxWidthChars() (value int)
	GetLabel() (value string)
	GetLineWrap() (value bool)
	GetLineWrapMode() (value enums.WrapMode)
	GetMnemonicWidget() (value Widget)
	GetSelectionBounds() (start int, end int, nonEmpty bool)
	GetUseMarkup() (value bool)
	GetUseUnderline() (value bool)
	GetSingleLineMode() (value bool)
	SetLabel(str string)
	SetUseMarkup(setting bool)
	SetUseUnderline(setting bool)
	SetSingleLineMode(singleLineMode bool)
	GetCurrentUri() (value string)
	SetTrackVisitedLinks(trackLinks bool)
	GetTrackVisitedLinks() (value bool)
	GetClearText() (text string)
	GetPlainText() (text string)
	GetCleanText() (text string)
	GetPlainTextInfo() (maxWidth, lineCount int)
	GetPlainTextInfoAtWidth(width int) (maxWidth, lineCount int)
	GetSizeRequest() (width, height int)
}

Label Hierarchy:

Object
  +- Widget
    +- Misc
      +- Label
        +- AccelLabel
        +- TipsQuery

The Label Widget presents text to the end user.

type LayoutStyle

type LayoutStyle uint64

layout style

const (
	LayoutStart LayoutStyle = iota
	LayoutEnd
)

func (LayoutStyle) FromString

func (l LayoutStyle) FromString(value string) (enum interface{}, err error)

type LoadState

type LoadState uint64

Load state

const (
	LOAD_EMPTY LoadState = iota
	LOAD_PRELOAD
	LOAD_LOADING
	LOAD_FINISHED
)

type LocationMode

type LocationMode uint64

Location mode

const (
	LOCATION_MODE_PATH_BAR LocationMode = iota
	LOCATION_MODE_FILENAME_ENTRY
)

type MatchType

type MatchType uint64

Match type

const (
	MATCH_ALL MatchType = iota
	MATCH_ALL_TAIL
	MATCH_HEAD
	MATCH_TAIL
	MATCH_EXACT
	MATCH_LAST
)
type MenuDirectionType uint64

Menu direction type

const (
	MENU_DIR_PARENT MenuDirectionType = iota
	MENU_DIR_CHILD
	MENU_DIR_NEXT
	MENU_DIR_PREV
)

type MessageType

type MessageType uint64

Message type

const (
	MESSAGE_INFO MessageType = iota
	MESSAGE_WARNING
	MESSAGE_QUESTION
	MESSAGE_ERROR
	MESSAGE_OTHER
)

type MetricType

type MetricType uint64

Metric type

const (
	PIXELS MetricType = iota
	INCHES
	CENTIMETERS
)

type Misc

type Misc interface {
	Widget
	Buildable

	Init() (already bool)
	GetAlignment() (xAlign float64, yAlign float64)
	SetAlignment(xAlign float64, yAlign float64)
	GetPadding() (xPad int, yPad int)
	SetPadding(xPad int, yPad int)
}

Misc Hierarchy:

Object
  +- Widget
    +- Misc
      +- Label
      +- Arrow
      +- Image
      +- Pixmap

The Misc Widget is intended primarily as a base type for other Widget implementations where there is a necessity for alignment and padding properties.

type ModifierType

type ModifierType uint64
const (
	NullModMask ModifierType = 0
	ShiftMask   ModifierType = 1 << iota
	LockMask
	ControlMask
	Mod1Mask
	Mod2Mask
	Mod3Mask
	Mod4Mask
	Mod5Mask
	Button1Mask
	Button2Mask
	Button3Mask
	Button4Mask
	Button5Mask
	SuperMask
	HyperMask
	MetaMask
	ReleaseMask
	ModifierMask
)

func (ModifierType) HasBit

func (m ModifierType) HasBit(b ModifierType) bool

func (ModifierType) String

func (m ModifierType) String() string

type MovementStep

type MovementStep uint64

Movement step

const (
	MOVEMENT_LOGICAL_POSITIONS MovementStep = iota
	MOVEMENT_VISUAL_POSITIONS
	MOVEMENT_WORDS
	MOVEMENT_DISPLAY_LINES
	MOVEMENT_DISPLAY_LINE_ENDS
	MOVEMENT_PARAGRAPHS
	MOVEMENT_PARAGRAPH_ENDS
	MOVEMENT_PAGES
	MOVEMENT_BUFFER_ENDS
	MOVEMENT_HORIZONTAL_PAGES
)

type NotebookTab

type NotebookTab uint64

Notebook tab

const (
	NOTEBOOK_TAB_FIRST NotebookTab = iota
	NOTEBOOK_TAB_LAST
)

type NumberUpLayout

type NumberUpLayout uint64

Number up layout

const (
	NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM NumberUpLayout = iota
	NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP
	NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM
	NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP
	NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT
	NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT
	NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT
	NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT
)

type Object

type Object interface {
	cdk.Object

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	ObjectInfo() string
	SetOrigin(x, y int)
	GetOrigin() ptypes.Point2I
	SetAllocation(size ptypes.Rectangle)
	GetAllocation() ptypes.Rectangle
	GetObjectAt(p *ptypes.Point2I) Object
	HasPoint(p *ptypes.Point2I) (contains bool)
	Invalidate() enums.EventFlag
	ProcessEvent(evt cdk.Event) enums.EventFlag
	Resize() enums.EventFlag
	GetTextDirection() (direction TextDirection)
	SetTextDirection(direction TextDirection)
	CssSelector() (selector string)
	InstallCssProperty(name cdk.Property, state StateType, kind cdk.PropertyType, write bool, def interface{}) (err error)
	SetCssPropertyFromStyle(key, value string) (err error)
	GetCssProperty(name cdk.Property, state StateType) (property *CStyleProperty)
	GetCssProperties() (properties map[StateType][]*CStyleProperty)
	GetCssBool(name cdk.Property, state StateType) (value bool, err error)
	GetCssString(name cdk.Property, state StateType) (value string, err error)
	GetCssInt(name cdk.Property, state StateType) (value int, err error)
	GetCssFloat(name cdk.Property, state StateType) (value float64, err error)
	GetCssColor(name cdk.Property, state StateType) (value paint.Color, err error)
}

Object in the Curses Tool Kit, is an extension of the CDK Object type and for all intents and purposes, this is the base class for any CTK type with no other CTK type embedding a CDK type directly.

type OperationMode

type OperationMode uint64

Operation mode

const (
	OPERATION_MODE_BROWSE OperationMode = iota
	OPERATION_MODE_SEARCH
	OPERATION_MODE_RECENT
)

type Orientable

type Orientable interface {
	GetOrientation() (orientation enums.Orientation)
	SetOrientation(orientation enums.Orientation)
}

type PackDirection

type PackDirection uint64

packing direction

const (
	PACK_DIRECTION_LTR PackDirection = iota
	PACK_DIRECTION_RTL
	PACK_DIRECTION_TTB
	PACK_DIRECTION_BTT
)

type PackType

type PackType uint64

packing type

const (
	PackStart PackType = iota
	PackEnd
)

type PageSet

type PageSet uint64

Page set

const (
	PAGE_SET_ALL PageSet = iota
	PAGE_SET_EVEN
	PAGE_SET_ODD
)

type ParamFlags

type ParamFlags uint64

Param flags

const (
	PARAM_READABLE  ParamFlags = 1 << 0
	PARAM_WRITABLE  ParamFlags = 1 << iota
	PARAM_READWRITE ParamFlags = ParamFlags(PARAM_READABLE | PARAM_WRITABLE)
	PARAM_CONSTRUCT
	PARAM_CONSTRUCT_ONLY
	PARAM_LAX_VALIDATION
	PARAM_STATIC_NAME
	PARAM_PRIVATE ParamFlags = ParamFlags(PARAM_STATIC_NAME)
	PARAM_STATIC_NICK
	PARAM_STATIC_BLURB
	PARAM_EXPLICIT_NOTIFY
)

type PathPriorityType

type PathPriorityType uint64

Path priority type

const (
	PATH_PRIO_LOWEST      PathPriorityType = 0
	PATH_PRIO_CTK         PathPriorityType = 4
	PATH_PRIO_APPLICATION PathPriorityType = 8
	PATH_PRIO_THEME       PathPriorityType = 10
	PATH_PRIO_RC          PathPriorityType = 12
	PATH_PRIO_HIGHEST     PathPriorityType = 15
)

type PathType

type PathType uint64

Path type

const (
	PATH_WIDGET PathType = iota
	PATH_WIDGET_CLASS
	PATH_CLASS
)

type PolicyType

type PolicyType uint64

Policy type

const (
	PolicyAlways PolicyType = iota
	PolicyAutomatic
	PolicyNever
)

func (PolicyType) FromString

func (p PolicyType) FromString(value string) (enum interface{}, err error)

type PositionType

type PositionType uint64

Position type

const (
	POS_LEFT PositionType = iota
	POS_RIGHT
	POS_TOP
	POS_BOTTOM
)

type PrintPages

type PrintPages uint64

Print pages

const (
	PRINT_PAGES_ALL PrintPages = iota
	PRINT_PAGES_CURRENT
	PRINT_PAGES_RANGES
	PRINT_PAGES_SELECTION
)

type PrivateFlags

type PrivateFlags uint64

Private flags

const (
	PRIVATE_USER_STYLE      PrivateFlags = 1 << 0
	PRIVATE_RESIZE_PENDING  PrivateFlags = 1 << 2
	PRIVATE_HAS_POINTER     PrivateFlags = 1 << 3
	PRIVATE_SHADOWED        PrivateFlags = 1 << 4
	PRIVATE_HAS_SHAPE_MASK  PrivateFlags = 1 << 5
	PRIVATE_IN_REPARENT     PrivateFlags = 1 << 6
	PRIVATE_DIRECTION_SET   PrivateFlags = 1 << 7
	PRIVATE_DIRECTION_LTR   PrivateFlags = 1 << 8
	PRIVATE_ANCHORED        PrivateFlags = 1 << 9
	PRIVATE_CHILD_VISIBLE   PrivateFlags = 1 << 10
	PRIVATE_REDRAW_ON_ALLOC PrivateFlags = 1 << 11
	PRIVATE_ALLOC_NEEDED    PrivateFlags = 1 << 12
	PRIVATE_REQUEST_NEEDED  PrivateFlags = 1 << 13
)

type ProgressBarOrientation

type ProgressBarOrientation uint64

Progress bar orientation

const (
	PROGRESS_LEFT_TO_RIGHT ProgressBarOrientation = iota
	PROGRESS_RIGHT_TO_LEFT
	PROGRESS_BOTTOM_TO_TOP
	PROGRESS_TOP_TO_BOTTOM
)

type ProgressBarStyle

type ProgressBarStyle uint64

Progress bar style

const (
	PROGRESS_CONTINUOUS ProgressBarStyle = iota
	PROGRESS_DISCRETE
)

type RBNodeColor

type RBNodeColor uint64

Node color

const (
	RBNODE_BLACK RBNodeColor = 1 << 0
	RBNODE_RED   RBNodeColor = 1 << iota
	RBNODE_IS_PARENT
	RBNODE_IS_SELECTED
	RBNODE_IS_PRELIT
	RBNODE_IS_SEMI_COLLAPSED
	RBNODE_IS_SEMI_EXPANDED
	RBNODE_INVALID
	RBNODE_COLUMN_INVALID
	RBNODE_DESCENDANTS_INVALID
	RBNODE_NON_COLORS RBNodeColor = RBNodeColor(RBNODE_IS_PARENT)
)

type Range

type Range interface {
	Widget

	Init() (already bool)
	GetFillLevel() (value float64)
	GetRestrictToFillLevel() (value bool)
	GetShowFillLevel() (value bool)
	SetFillLevel(fillLevel float64)
	SetRestrictToFillLevel(restrictToFillLevel bool)
	SetShowFillLevel(showFillLevel bool)
	GetAdjustment() (adjustment *CAdjustment)
	GetInverted() (value bool)
	SetInverted(setting bool)
	SetIncrements(step int, page int)
	SetRange(min, max int)
	GetValue() (value int)
	SetValue(value int)
	GetRoundDigits() (value int)
	SetRoundDigits(roundDigits int)
	SetLowerStepperSensitivity(sensitivity SensitivityType)
	GetLowerStepperSensitivity() (value SensitivityType)
	SetUpperStepperSensitivity(sensitivity SensitivityType)
	GetUpperStepperSensitivity() (value SensitivityType)
	GetFlippable() (value bool)
	SetFlippable(flippable bool)
	GetMinSliderSize() (value int)
	GetRangeRect() (rangeRect ptypes.Rectangle)
	GetSliderRange() (sliderStart int, sliderEnd int)
	GetSliderSizeFixed() (value bool)
	SetMinSliderSize(minSize bool)
	SetSliderSizeFixed(sizeFixed bool)
	GetIncrements() (step int, page int)
	GetRange() (min, max int)
	GetMinSliderLength() (length int)
	SetMinSliderLength(length int)
	GetSliderLength() (length int)
	SetSliderLength(length int)
	GetStepperSize() (size int)
	SetStepperSize(size int)
	GetStepperSpacing() (spacing int)
	SetStepperSpacing(spacing int)
	GetTroughUnderSteppers() (underSteppers bool)
	SetTroughUnderSteppers(underSteppers bool)
}

Range Hierarchy:

Object
  +- Widget
    +- Range
      +- Scale
      +- Scrollbar

The Range Widget is used to manage the position of things within some range of values. Scrollbar and Scale are two examples.

type RcFlags

type RcFlags uint64

Rc flags

const (
	RC_FG RcFlags = 1 << 0
	RC_BG RcFlags = 1 << iota
	RC_TEXT
	RC_BASE
)

type RcStyle

type RcStyle interface {
}

type RcTokenType

type RcTokenType uint64

Rc token type

const (
	RC_TOKEN_INVALID RcTokenType = RcTokenType(TOKEN_LAST)
	RC_TOKEN_INCLUDE RcTokenType = iota
	RC_TOKEN_NORMAL
	RC_TOKEN_ACTIVE
	RC_TOKEN_PRELIGHT
	RC_TOKEN_SELECTED
	RC_TOKEN_INSENSITIVE
	RC_TOKEN_FG
	RC_TOKEN_BG
	RC_TOKEN_TEXT
	RC_TOKEN_BASE
	RC_TOKEN_XTHICKNESS
	RC_TOKEN_YTHICKNESS
	RC_TOKEN_FONT
	RC_TOKEN_FONTSET
	RC_TOKEN_FONT_NAME
	RC_TOKEN_BC_PIXMAP
	RC_TOKEN_PIXMAP_PATH
	RC_TOKEN_STYLE
	RC_TOKEN_BINDING
	RC_TOKEN_BIND
	RC_TOKEN_WIDGET
	RC_TOKEN_WIDGET_CLASS
	RC_TOKEN_CLASS
	RC_TOKEN_LOWEST
	RC_TOKEN_CTK
	RC_TOKEN_APPLICATION
	RC_TOKEN_THEME
	RC_TOKEN_RC
	RC_TOKEN_HIGHEST
	RC_TOKEN_ENGINE
	RC_TOKEN_MODULE_PATH
	RC_TOKEN_IM_MODULE_PATH
	RC_TOKEN_IM_MODULE_FILE
	RC_TOKEN_STOCK
	RC_TOKEN_LTR
	RC_TOKEN_RTL
	RC_TOKEN_COLOR
	RC_TOKEN_UNBIND
	RC_TOKEN_LAST
)

type RecentChooserError

type RecentChooserError uint64

Recent chooser error

const (
	RECENT_CHOOSER_ERROR_NOT_FOUND RecentChooserError = iota
	RECENT_CHOOSER_ERROR_INVALID_URI
)

type RecentChooserProp

type RecentChooserProp uint64

Recent chooser prop

const (
	RECENT_CHOOSER_PROP_FIRST          RecentChooserProp = 0
	RECENT_CHOOSER_PROP_RECENT_MANAGER RecentChooserProp = iota
	RECENT_CHOOSER_PROP_SHOW_PRIVATE
	RECENT_CHOOSER_PROP_SHOW_NOT_FOUND
	RECENT_CHOOSER_PROP_SHOW_TIPS
	RECENT_CHOOSER_PROP_SHOW_ICONS
	RECENT_CHOOSER_PROP_SELECT_MULTIPLE
	RECENT_CHOOSER_PROP_LIMIT
	RECENT_CHOOSER_PROP_LOCAL_ONLY
	RECENT_CHOOSER_PROP_SORT_TYPE
	RECENT_CHOOSER_PROP_FILTER
	RECENT_CHOOSER_PROP_LAST
)

type RecentFilterFlags

type RecentFilterFlags uint64

Recent filter flags

const (
	RECENT_FILTER_URI          RecentFilterFlags = 1 << 0
	RECENT_FILTER_DISPLAY_NAME RecentFilterFlags = 1 << iota
	RECENT_FILTER_MIME_TYPE
	RECENT_FILTER_APPLICATION
	RECENT_FILTER_GROUP
	RECENT_FILTER_AGE
)

type RecentManagerError

type RecentManagerError uint64

Recent manager error

const (
	RECENT_MANAGER_ERROR_NOT_FOUND RecentManagerError = iota
	RECENT_MANAGER_ERROR_INVALID_URI
	RECENT_MANAGER_ERROR_INVALID_ENCODING
	RECENT_MANAGER_ERROR_NOT_REGISTERED
	RECENT_MANAGER_ERROR_READ
	RECENT_MANAGER_ERROR_WRITE
	RECENT_MANAGER_ERROR_UNKNOWN
)

type RecentSortType

type RecentSortType uint64

Recent sort type

const (
	RECENT_SORT_NONE RecentSortType = 0
	RECENT_SORT_MRU  RecentSortType = iota
	RECENT_SORT_LRU
	RECENT_SORT_CUSTOM
)

type ReliefStyle

type ReliefStyle uint64

Relief style

const (
	RELIEF_NORMAL ReliefStyle = iota
	RELIEF_HALF
	RELIEF_NONE
)

type ReloadState

type ReloadState uint64

Reload state

const (
	RELOAD_EMPTY ReloadState = iota
	RELOAD_HAS_FOLDER
)

type ResponseType

type ResponseType int

Response type

const (
	ResponseNone        ResponseType = -1
	ResponseReject      ResponseType = -2
	ResponseAccept      ResponseType = -3
	ResponseDeleteEvent ResponseType = -4
	ResponseOk          ResponseType = -5
	ResponseCancel      ResponseType = -6
	ResponseClose       ResponseType = -7
	ResponseYes         ResponseType = -8
	ResponseNo          ResponseType = -9
	ResponseApply       ResponseType = -10
	ResponseHelp        ResponseType = -11
)

func ResponseTypeFromName

func ResponseTypeFromName(name string) ResponseType

func (ResponseType) String

func (r ResponseType) String() string

type ScrollStep

type ScrollStep uint64

Scroll step

const (
	SCROLL_STEPS ScrollStep = iota
	SCROLL_PAGES
	SCROLL_ENDS
	SCROLL_HORIZONTAL_STEPS
	SCROLL_HORIZONTAL_PAGES
	SCROLL_HORIZONTAL_ENDS
)

type ScrollType

type ScrollType uint64

Scroll type

const (
	SCROLL_NONE ScrollType = iota
	SCROLL_JUMP
	SCROLL_STEP_BACKWARD
	SCROLL_STEP_FORWARD
	SCROLL_PAGE_BACKWARD
	SCROLL_PAGE_FORWARD
	SCROLL_STEP_UP
	SCROLL_STEP_DOWN
	SCROLL_PAGE_UP
	SCROLL_PAGE_DOWN
	SCROLL_STEP_LEFT
	SCROLL_STEP_RIGHT
	SCROLL_PAGE_LEFT
	SCROLL_PAGE_RIGHT
	SCROLL_START
	SCROLL_END
)

type Scrollbar

type Scrollbar interface {
	Range

	Init() (already bool)
	GetHasBackwardStepper() (hasBackwardStepper bool)
	SetHasBackwardStepper(hasBackwardStepper bool)
	GetHasForwardStepper() (hasForwardStepper bool)
	SetHasForwardStepper(hasForwardStepper bool)
	GetHasSecondaryBackwardStepper() (hasSecondaryBackwardStepper bool)
	SetHasSecondaryBackwardStepper(hasSecondaryBackwardStepper bool)
	GetHasSecondaryForwardStepper() (hasSecondaryForwardStepper bool)
	SetHasSecondaryForwardStepper(hasSecondaryForwardStepper bool)
	Forward(step int) enums.EventFlag
	ForwardStep() enums.EventFlag
	ForwardPage() enums.EventFlag
	Backward(step int) enums.EventFlag
	BackwardStep() enums.EventFlag
	BackwardPage() enums.EventFlag
	GetSizeRequest() (width, height int)
	GetWidgetAt(p *ptypes.Point2I) Widget
	ValueChanged()
	Changed()
	CancelEvent()
	GetAllStepperRegions() (fwd, bwd, sFwd, sBwd ptypes.Region)
	GetStepperRegions() (start, end ptypes.Region)
	GetTroughRegion() (region ptypes.Region)
	GetSliderRegion() (region ptypes.Region)
	GrabFocus()
	GrabEventFocus()
}

Scrollbar Hierarchy:

Object
  +- Widget
    +- Range
      +- Scrollbar
        +- HScrollbar
        +- VScrollbar

The Scrollbar Widget is a Range Widget that draws steppers and sliders.

type ScrolledViewport

type ScrolledViewport interface {
	Viewport

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	GetHAdjustment() (value *CAdjustment)
	GetVAdjustment() (value *CAdjustment)
	SetPolicy(hScrollbarPolicy PolicyType, vScrollbarPolicy PolicyType)
	AddWithViewport(child Widget)
	SetPlacement(windowPlacement CornerType)
	UnsetPlacement()
	SetShadowType(t ShadowType)
	SetHAdjustment(hAdjustment *CAdjustment)
	SetVAdjustment(vAdjustment *CAdjustment)
	GetPlacement() (value CornerType)
	GetPolicy() (hScrollbarPolicy PolicyType, vScrollbarPolicy PolicyType)
	GetShadowType() (value ShadowType)
	VerticalShowByPolicy() (show bool)
	HorizontalShowByPolicy() (show bool)
	Add(w Widget)
	Remove(w Widget)
	GetChild() Widget
	GetHScrollbar() *CHScrollbar
	GetVScrollbar() *CVScrollbar
	Show()
	Hide()
	GetWidgetAt(p *ptypes.Point2I) Widget
	CancelEvent()
	GetRegions() (c, h, v ptypes.Region)
	GrabFocus()
	GrabEventFocus()
}

ScrolledViewport Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- ScrolledViewport

type SelectionMode

type SelectionMode uint64

Selection mode

const (
	SELECTION_NONE SelectionMode = iota
	SELECTION_SINGLE
	SELECTION_BROWSE
	SELECTION_MULTIPLE
	SELECTION_EXTENDED SelectionMode = SelectionMode(SELECTION_MULTIPLE)
)

type Sensitive

type Sensitive interface {
	Object

	GetWindow() Window
	CanFocus() bool
	IsFocus() bool
	IsFocused() bool
	IsVisible() bool
	GrabFocus()
	CancelEvent()
	IsSensitive() bool
	SetSensitive(sensitive bool)
	ProcessEvent(evt cdk.Event) enums.EventFlag
}

type SensitivityType

type SensitivityType uint64

Sensitivity type

const (
	SensitivityAuto SensitivityType = iota
	SensitivityOn
	SensitivityOff
)

type ShadowType

type ShadowType uint64

Shadow type

const (
	SHADOW_NONE ShadowType = iota
	SHADOW_IN
	SHADOW_OUT
	SHADOW_ETCHED_IN
	SHADOW_ETCHED_OUT
)

type SideType

type SideType uint64

Side type

const (
	SIDE_TOP SideType = iota
	SIDE_BOTTOM
	SIDE_LEFT
	SIDE_RIGHT
)

type SizeGroupMode

type SizeGroupMode uint64

Size group mode

const (
	SIZE_GROUP_NONE SizeGroupMode = iota
	SIZE_GROUP_HORIZONTAL
	SIZE_GROUP_VERTICAL
	SIZE_GROUP_BOTH
)

type SortType

type SortType uint64

Sort type

const (
	SORT_ASCENDING SortType = iota
	SORT_DESCENDING
)

type SpinButtonUpdatePolicy

type SpinButtonUpdatePolicy uint64

Spin button update policy

const (
	UPDATE_ALWAYS SpinButtonUpdatePolicy = iota
	UPDATE_IF_VALID
)

type SpinType

type SpinType uint64

Spin type

const (
	SPIN_STEP_FORWARD SpinType = iota
	SPIN_STEP_BACKWARD
	SPIN_PAGE_FORWARD
	SPIN_PAGE_BACKWARD
	SPIN_HOME
	SPIN_END
	SPIN_USER_DEFINED
)

type StartupMode

type StartupMode uint64

Startup mode

const (
	STARTUP_MODE_RECENT StartupMode = iota
	STARTUP_MODE_CWD
)

type StateType

type StateType uint64
const (
	StateNormal StateType = 1 << iota
	StateActive
	StatePrelight
	StateSelected
	StateInsensitive
)

func StateTypeFromString added in v0.1.4

func StateTypeFromString(name string) (state StateType)

StateTypeFromString returns the StateType equivalent for the given named string. If the name given is not a valid name, returns StateNormal.

func (StateType) HasBit added in v0.1.4

func (s StateType) HasBit(state StateType) bool

func (StateType) String added in v0.1.4

func (s StateType) String() (label string)

type StockID

type StockID string

Stock items represent commonly-used menu or toolbar items such as "Open" or "Exit". Each stock item is identified by a stock ID; stock IDs are just strings, and constants such as StockOpen are provided to avoid typing mistakes in the strings. Applications can register their own stock items in addition to those built-in to CTK.

Each stock ID can be associated with a StockItem, which contains the user-visible label, keyboard accelerator, and translation domain of the menu or toolbar item; and/or with an icon stored in a GtkIconFactory. See IconFactory for more information on stock icons. The connection between a StockItem and stock icons is purely conventional (by virtue of using the same stock ID); it's possible to register a stock item but no icon, and vice versa. Stock icons may have a RTL variant which gets used for right-to-left locales.

const (
	StockAbout          StockID = "ctk-about"
	StockAdd            StockID = "ctk-add"
	StockApply          StockID = "ctk-apply"
	StockBold           StockID = "ctk-bold"
	StockCancel         StockID = "ctk-cancel"
	StockClear          StockID = "ctk-clear"
	StockClose          StockID = "ctk-close"
	StockConvert        StockID = "ctk-convert"
	StockConnect        StockID = "ctk-connect"
	StockCopy           StockID = "ctk-copy"
	StockCut            StockID = "ctk-cut"
	StockDelete         StockID = "ctk-delete"
	StockDialogError    StockID = "ctk-dialog-error"
	StockDialogInfo     StockID = "ctk-dialog-info"
	StockDialogQuestion StockID = "ctk-dialog-question"
	StockDialogWarning  StockID = "ctk-dialog-warning"
	StockDirectory      StockID = "ctk-directory"
	StockDiscard        StockID = "ctk-discard"
	StockDisconnect     StockID = "ctk-disconnect"
	StockEdit           StockID = "ctk-edit"
	StockExecute        StockID = "ctk-execute"
	StockFile           StockID = "ctk-file"
	StockFind           StockID = "ctk-find"
	StockFindAndReplace StockID = "ctk-find-and-replace"
	StockGotoBottom     StockID = "ctk-goto-bottom"
	StockGotoFirst      StockID = "ctk-goto-first"
	StockGotoLast       StockID = "ctk-goto-last"
	StockGotoTop        StockID = "ctk-goto-top"
	StockGoBack         StockID = "ctk-go-back"
	StockGoDown         StockID = "ctk-go-down"
	StockGoForward      StockID = "ctk-go-forward"
	StockGoUp           StockID = "ctk-go-up"
	StockHelp           StockID = "ctk-help"
	StockHome           StockID = "ctk-home"
	StockIndent         StockID = "ctk-indent"
	StockIndex          StockID = "ctk-index"
	StockInfo           StockID = "ctk-info"
	StockItalic         StockID = "ctk-italic"
	StockJumpTo         StockID = "ctk-jump-to"
	StockJustifyCenter  StockID = "ctk-justify-center"
	StockJustifyFill    StockID = "ctk-justify-fill"
	StockJustifyLeft    StockID = "ctk-justify-left"
	StockJustifyRight   StockID = "ctk-justify-right"
	StockMediaForward   StockID = "ctk-media-forward"
	StockMediaNext      StockID = "ctk-media-next"
	StockMediaPause     StockID = "ctk-media-pause"
	StockMediaPlay      StockID = "ctk-media-play"
	StockMediaPrevious  StockID = "ctk-media-previous"
	StockMediaRecord    StockID = "ctk-media-record"
	StockMediaRewind    StockID = "ctk-media-rewind"
	StockMediaStop      StockID = "ctk-media-stop"
	StockNew            StockID = "ctk-new"
	StockNo             StockID = "ctk-no"
	StockOk             StockID = "ctk-ok"
	StockOpen           StockID = "ctk-open"
	StockPaste          StockID = "ctk-paste"
	StockPreferences    StockID = "ctk-preferences"
	StockProperties     StockID = "ctk-properties"
	StockQuit           StockID = "ctk-quit"
	StockRedo           StockID = "ctk-redo"
	StockRefresh        StockID = "ctk-refresh"
	StockRemove         StockID = "ctk-remove"
	StockRevertToSaved  StockID = "ctk-revert-to-saved"
	StockSave           StockID = "ctk-save"
	StockSaveAs         StockID = "ctk-save-as"
	StockSelectAll      StockID = "ctk-select-all"
	StockSelectColor    StockID = "ctk-select-color"
	StockSelectFont     StockID = "ctk-select-font"
	StockSortAscending  StockID = "ctk-sort-ascending"
	StockSortDescending StockID = "ctk-sort-descending"
	StockStop           StockID = "ctk-stop"
	StockStrikethrough  StockID = "ctk-strikethrough"
	StockUndelete       StockID = "ctk-undelete"
	StockUnderline      StockID = "ctk-underline"
	StockUndo           StockID = "ctk-undo"
	StockUnindent       StockID = "ctk-unindent"
	StockYes            StockID = "ctk-yes"
	StockZoom100        StockID = "ctk-zoom-100"
	StockZoomFit        StockID = "ctk-zoom-fit"
	StockZoomIn         StockID = "ctk-zoom-in"
	StockZoomOut        StockID = "ctk-zoom-out"
)

func ListStockIDs

func ListStockIDs() (list []StockID)

Retrieves a list of all known stock IDs added to an IconFactory or registered with StockAdd().

type StockItem

type StockItem struct {
	ID         StockID
	Label      string
	Modifier   ModifierType
	KeyVal     cdk.Key
	I18nDomain string
}

func LookupStockItem

func LookupStockItem(id StockID) (item *StockItem)

Retrieve a stock item by ID. Returns nil if item not found.

func LookupStockLabel

func LookupStockLabel(label string) (item *StockItem)

type Style

type Style interface {
	Object

	Init() (already bool)

	PaintArrow(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, arrowType ArrowType, fill bool, x int, y int, width int, height int)
	PaintBox(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintBoxGap(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, gapSide PositionType, gapX int, gapWidth int)
	PaintCheck(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintDiamond(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintExtension(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, gapSide PositionType)
	PaintFlatBox(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintFocus(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintHandle(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, orientation enums.Orientation)
	PaintHLine(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, x1 int, x2 int, y int)
	PaintOption(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintPolygon(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, points ptypes.Point2I, nPoints int, fill bool)
	PaintShadow(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintShadowGap(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, gapSide PositionType, gapX int, gapWidth int)
	PaintSlider(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int, orientation enums.Orientation)
	PaintSpinner(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, step int, x int, y int, width int, height int)
	PaintTab(window Window, stateType StateType, shadowType ShadowType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, width int, height int)
	PaintVLine(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, y1 int, y2 int, x int)
	PaintExpander(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, x int, y int, expanderStyle ExpanderStyle)
	// PaintLayout(window Window, stateType StateType, useText bool, area ptypes.Rectangle, widget Widget, detail string, x int, y int, layout PangoLayout)
	PaintResizeGrip(window Window, stateType StateType, area ptypes.Rectangle, widget Widget, detail string, edge WindowEdge, x int, y int, width int, height int)
}

Style Hierarchy:

Object
  +- Style

type StyleProperty added in v0.1.4

type StyleProperty string

func (StyleProperty) String added in v0.1.4

func (p StyleProperty) String() string

type StyleSheetMedia

type StyleSheetMedia struct {
	Conditions string
	Rules      []*StyleSheetRule
}

func (StyleSheetMedia) String

func (m StyleSheetMedia) String() string

type StyleSheetProperty

type StyleSheetProperty struct {
	Key   string
	Value string
	Type  tcss.TokenType
}

func (StyleSheetProperty) String

func (e StyleSheetProperty) String() string

type StyleSheetRule

type StyleSheetRule struct {
	Selector   string
	Properties []*StyleSheetProperty
}

func (StyleSheetRule) String

func (r StyleSheetRule) String() string

type StyleSheetSelector

type StyleSheetSelector struct {
	Name    string
	Type    string
	Class   string
	State   string
	Parents []string
}

func (StyleSheetSelector) Match

func (s StyleSheetSelector) Match(selector *StyleSheetSelector) (match bool)

func (StyleSheetSelector) String

func (s StyleSheetSelector) String() string
type SubmenuDirection uint64

Submenu direction

const (
	DIRECTION_LEFT SubmenuDirection = iota
	DIRECTION_RIGHT
)
type SubmenuPlacement uint64

Submenu placement

const (
	TOP_BOTTOM SubmenuPlacement = iota
	LEFT_RIGHT
)

type TextBufferTargetInfo

type TextBufferTargetInfo int

Text buffer target info

const (
	TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS TextBufferTargetInfo = -1
	TEXT_BUFFER_TARGET_INFO_RICH_TEXT       TextBufferTargetInfo = -2
	TEXT_BUFFER_TARGET_INFO_TEXT            TextBufferTargetInfo = -3
)

type TextDirection

type TextDirection uint64

Text direction

const (
	TextDirNone TextDirection = iota
	TextDirLtr
	TextDirRtl
)

type TextSearchFlags

type TextSearchFlags uint64

Text search flags

const (
	TEXT_SEARCH_VISIBLE_ONLY TextSearchFlags = 1 << 0
	TEXT_SEARCH_TEXT_ONLY    TextSearchFlags = 1 << iota
)

type TextWindowType

type TextWindowType uint64

Text window type

const (
	TEXT_WINDOW_PRIVATE TextWindowType = iota
	TEXT_WINDOW_WIDGET
	TEXT_WINDOW_TEXT
	TEXT_WINDOW_LEFT
	TEXT_WINDOW_RIGHT
	TEXT_WINDOW_TOP
	TEXT_WINDOW_BOTTOM
)

type TokenType

type TokenType uint64

Token type

const (
	TOKEN_EOF   TokenType = 0
	TOKEN_NONE  TokenType = 256
	TOKEN_ERROR TokenType = iota
	TOKEN_CHAR
	TOKEN_BINARY
	TOKEN_OCTAL
	TOKEN_INT
	TOKEN_HEX
	TOKEN_FLOAT
	TOKEN_STRING
	TOKEN_SYMBOL
	TOKEN_IDENTIFIER
	TOKEN_IDENTIFIER_NULL
	TOKEN_COMMENT_SINGLE
	TOKEN_COMMENT_MULTI
	TOKEN_LAST
)

type ToolbarChildType

type ToolbarChildType uint64

Toolbar child type

const (
	TOOLBAR_CHILD_SPACE ToolbarChildType = iota
	TOOLBAR_CHILD_BUTTON
	TOOLBAR_CHILD_TOGGLEBUTTON
	TOOLBAR_CHILD_RADIOBUTTON
	TOOLBAR_CHILD_WIDGET
)

type ToolbarSpaceStyle

type ToolbarSpaceStyle uint64

Toolbar space style

const (
	TOOLBAR_SPACE_EMPTY ToolbarSpaceStyle = iota
	TOOLBAR_SPACE_LINE
)

type ToolbarStyle

type ToolbarStyle uint64

Toolbar style

const (
	TOOLBAR_ICONS ToolbarStyle = iota
	TOOLBAR_TEXT
	TOOLBAR_BOTH
	TOOLBAR_BOTH_HORIZ
)

type TreeModelFlags

type TreeModelFlags uint64

Tree model flags

const (
	TREE_MODEL_ITERS_PERSIST TreeModelFlags = 1 << 0
	TREE_MODEL_LIST_ONLY     TreeModelFlags = 1 << iota
)

type TreeViewColumnSizing

type TreeViewColumnSizing uint64

Tree view column sizing

const (
	TREE_VIEW_COLUMN_GROW_ONLY TreeViewColumnSizing = iota
	TREE_VIEW_COLUMN_AUTOSIZE
	TREE_VIEW_COLUMN_FIXED
)

type TreeViewDropPosition

type TreeViewDropPosition uint64

Tree view drop position

const (
	TREE_VIEW_DROP_BEFORE TreeViewDropPosition = iota
	TREE_VIEW_DROP_AFTER
	TREE_VIEW_DROP_INTO_OR_BEFORE
	TREE_VIEW_DROP_INTO_OR_AFTER
)

type TreeViewFlags

type TreeViewFlags uint64

Tree view flags

const (
	TREE_VIEW_IS_LIST        TreeViewFlags = 1 << 0
	TREE_VIEW_SHOW_EXPANDERS TreeViewFlags = 1 << iota
	TREE_VIEW_IN_COLUMN_RESIZE
	TREE_VIEW_ARROW_PRELIT
	TREE_VIEW_HEADERS_VISIBLE
	TREE_VIEW_DRAW_KEYFOCUS
	TREE_VIEW_MODEL_SETUP
	TREE_VIEW_IN_COLUMN_DRAG
)

type TreeViewGridLines

type TreeViewGridLines uint64

Tree view grid lines

const (
	TREE_VIEW_GRID_LINES_NONE TreeViewGridLines = iota
	TREE_VIEW_GRID_LINES_HORIZONTAL
	TREE_VIEW_GRID_LINES_VERTICAL
	TREE_VIEW_GRID_LINES_BOTH
)

type TreeViewMode

type TreeViewMode uint64

Tree view mode

const (
	TREE_VIEW_LINE TreeViewMode = iota
	TREE_VIEW_ITEM
)

type UIManagerItemType

type UIManagerItemType uint64

Manager item type

const (
	UI_MANAGER_AUTO    UIManagerItemType = 0
	UI_MANAGER_MENUBAR UIManagerItemType = 1 << 0
	UI_MANAGER_MENU    UIManagerItemType = 1 << iota
	UI_MANAGER_TOOLBAR
	UI_MANAGER_PLACEHOLDER
	UI_MANAGER_POPUP
	UI_MANAGER_MENUITEM
	UI_MANAGER_TOOLITEM
	UI_MANAGER_SEPARATOR
	UI_MANAGER_ACCELERATOR
	UI_MANAGER_POPUP_WITH_ACCELS
)

type Unit

type Unit uint64

Unit

const (
	UNIT_PIXEL Unit = iota
	UNIT_POINTS
	UNIT_INCH
	UNIT_MM
)

type UpdateType

type UpdateType uint64

Update type

const (
	UpdateContinuous UpdateType = iota
	UpdateDiscontinuous
	UpdateDelayed
)

func (UpdateType) FromString

func (t UpdateType) FromString(value string) (enum interface{}, err error)

type VBox

type VBox interface {
	Box

	Init() bool
}

Basic vbox interface

type VButtonBox

type VButtonBox interface {
	ButtonBox

	Init() bool
}

type VScrollbar

type VScrollbar interface {
	Scrollbar

	Init() (already bool)
}

type Viewport

type Viewport interface {
	Bin

	Init() (already bool)
	GetHAdjustment() *CAdjustment
	SetHAdjustment(adjustment *CAdjustment)
	GetVAdjustment() *CAdjustment
	SetVAdjustment(adjustment *CAdjustment)
	SetShadowType(shadowType ShadowType)
	GetShadowType() (value ShadowType)
	GetBinWindow() (value Window)
	GetViewWindow() (value Window)
}

Viewport Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Viewport

The Viewport widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. Use Viewport to scroll child widgets such as Table, Box, and so on. If a widget has native scrolling abilities, such as TextView, TreeView IconView, it can be added to a ScrolledWindow with Container.Add. If a widget does not, you must first add the widget to a Viewport, then add the viewport to the scrolled window. The convenience function ScrolledWindow.AddWithViewport does exactly this, so you can ignore the presence of the viewport.

type Visibility

type Visibility uint64

Visibility

const (
	VISIBILITY_NONE Visibility = iota
	VISIBILITY_PARTIAL
	VISIBILITY_FULL
)

type Widget

type Widget interface {
	Object

	Init() (already bool)
	Destroy()
	Unparent()
	Show()
	Hide()
	ShowAll()
	AddAccelerator(accelSignal string, accelGroup AccelGroup, accelKey int, accelMods ModifierType, accelFlags AccelFlags)
	RemoveAccelerator(accelGroup AccelGroup, accelKey int, accelMods ModifierType) (value bool)
	SetAccelPath(accelPath string, accelGroup AccelGroup)
	CanActivateAccel(signalId int) (value bool)
	Activate() (value bool)
	Reparent(parent Container)
	IsFocus() (value bool)
	GrabFocus()
	GrabDefault()
	SetState(state StateType)
	SetSensitive(sensitive bool)
	CssFullPath() (path string)
	CssState() (state StateType)
	SetParent(parent Container)
	SetParentWindow(parentWindow Window)
	GetParentWindow() (value Window)
	SetEvents(events cdk.EventMask)
	AddEvents(events cdk.EventMask)
	GetToplevel() (value Widget)
	GetAncestor(widgetType cdk.CTypeTag) (value Widget)
	GetEvents() (value cdk.EventMask)
	GetPointer(x int, y int)
	IsAncestor(ancestor Widget) (value bool)
	TranslateCoordinates(destWidget Widget, srcX int, srcY int, destX int, destY int) (value bool)
	SetDirection(dir TextDirection)
	GetDirection() (value TextDirection)
	SetDefaultDirection(dir TextDirection)
	GetDefaultDirection() (value TextDirection)
	Path() (path string)
	ClassPath(pathLength int, path string, pathReversed string)
	GetCompositeName() (value string)
	SetAppPaintable(appPaintable bool)
	SetCompositeName(name string)
	SetScrollAdjustments(hAdjustment Adjustment, vAdjustment Adjustment) (value bool)
	SendExpose(event cdk.Event) (value int)
	SendFocusChange(event cdk.Event) (value bool)
	ChildFocus(direction DirectionType) (value bool)
	ChildNotify(childProperty string)
	FreezeChildNotify()
	GetChildVisible() (value bool)
	GetParent() (value Container)
	GetDisplay() (value cdk.Display)
	GetRootWindow() (value Window)
	GetScreen() (value cdk.Display)
	HasScreen() (value bool)
	GetSizeRequest() (width, height int)
	SizeRequest() ptypes.Rectangle
	SetSizeRequest(width, height int)
	SetNoShowAll(noShowAll bool)
	GetNoShowAll() (value bool)
	AddMnemonicLabel(label Widget)
	RemoveMnemonicLabel(label Widget)
	ErrorBell()
	KeynavFailed(direction DirectionType) (value bool)
	GetTooltipMarkup() (value string)
	SetTooltipMarkup(markup string)
	GetTooltipText() (value string)
	SetTooltipText(text string)
	GetTooltipWindow() (value Window)
	SetTooltipWindow(customWindow Window)
	GetHasTooltip() (value bool)
	SetHasTooltip(hasTooltip bool)
	TriggerTooltipQuery()
	GetWindow() (window Window)
	GetAppPaintable() (value bool)
	GetCanDefault() (value bool)
	SetCanDefault(canDefault bool)
	GetCanFocus() (value bool)
	SetCanFocus(canFocus bool)
	GetHasWindow() (value bool)
	GetSensitive() (value bool)
	IsSensitive() bool
	GetState() (value StateType)
	GetVisible() (value bool)
	SetVisible(visible bool)
	HasDefault() (value bool)
	HasFocus() (value bool)
	HasGrab() (value bool)
	IsDrawable() (value bool)
	IsToplevel() (value bool)
	SetWindow(window Window)
	SetReceivesDefault(receivesDefault bool)
	GetReceivesDefault() (value bool)
	GetTheme() (theme paint.Theme)
	GetThemeRequest() (theme paint.Theme)
	SetTheme(theme paint.Theme)
	HasState(s StateType) bool
	UnsetState(v StateType)
	GetFlags() WidgetFlags
	HasFlags(f WidgetFlags) bool
	UnsetFlags(v WidgetFlags)
	SetFlags(v WidgetFlags)
	IsParentFocused() bool
	IsFocused() bool
	CanFocus() bool
	IsDefault() bool
	CanDefault() bool
	IsVisible() bool
	HasEventFocus() bool
	GrabEventFocus()
	ReleaseEventFocus()
	GetTopParent() (parent Container)
	GetWidgetAt(p *ptypes.Point2I) Widget
	Draw() enums.EventFlag
}

Widget Hierarchy:

Object
  +- Widget
    +- Container
    +- Misc
    +- Calendar
    +- CellView
    +- DrawingArea
    +- Entry
    +- Ruler
    +- Range
    +- Separator
    +- HSV
    +- Invisible
    +- OldEditable
    +- Preview
    +- Progress

Widget is the base class all widgets in CTK derive from. It manages the widget lifecycle, states and style.

type WidgetFlags

type WidgetFlags uint64

Widget flags

const (
	NULL_WIDGET_FLAG WidgetFlags = 0
	TOPLEVEL         WidgetFlags = 1 << (iota + 2)
	NO_WINDOW
	REALIZED
	MAPPED
	VISIBLE
	SENSITIVE
	PARENT_SENSITIVE
	CAN_FOCUS
	HAS_FOCUS
	CAN_DEFAULT
	HAS_DEFAULT
	HAS_GRAB
	RC_STYLE
	COMPOSITE_CHILD
	NO_REPARENT
	APP_PAINTABLE
	RECEIVES_DEFAULT
	DOUBLE_BUFFERED
	NO_SHOW_ALL
	INVALID_WIDGET_FLAG
)

func (WidgetFlags) HasBit

func (f WidgetFlags) HasBit(flag WidgetFlags) bool

type WidgetHelpType

type WidgetHelpType uint64

Widget help type

const (
	WIDGET_HELP_TOOLTIP WidgetHelpType = iota
	WIDGET_HELP_WHATS_THIS
)

type Window

type Window interface {
	Bin
	cdk.Window

	Init() (already bool)
	Build(builder Builder, element *CBuilderElement) error
	AddStylesFromString(css string) (err error)
	ReplaceStylesFromString(css string) (err error)
	ApplyStylesTo(widget Widget)
	SetTitle(title string)
	SetResizable(resizable bool)
	GetResizable() (value bool)
	AddAccelGroup(accelGroup AccelGroup)
	RemoveAccelGroup(accelGroup AccelGroup)
	ActivateFocus() (value bool)
	ActivateDefault() (value bool)
	SetModal(modal bool)
	SetPosition(position WindowPosition)
	SetTransientFor(parent Window)
	SetDestroyWithParent(setting bool)
	IsActive() (active bool)
	HasToplevelFocus() (focused bool)
	ListTopLevels() (value []Window)
	AddMnemonic(keyval rune, target interface{})
	RemoveMnemonic(keyval rune, target interface{})
	RemoveWidgetMnemonics(target interface{})
	MnemonicActivate(keyval rune, modifier cdk.ModMask) (activated bool)
	ActivateKey(event cdk.EventKey) (value bool)
	PropagateKeyEvent(event cdk.EventKey) (value bool)
	GetFocus() (focus interface{})
	SetFocus(focus interface{})
	GetDefaultWidget() (value Widget)
	SetDefault(defaultWidget Widget)
	Present()
	PresentWithTime(timestamp int)
	Iconify()
	Deiconify()
	Stick()
	Unstick()
	Maximize()
	Unmaximize()
	Fullscreen()
	Unfullscreen()
	SetKeepAbove(setting bool)
	SetKeepBelow(setting bool)
	SetDecorated(setting bool)
	SetDeletable(setting bool)
	SetMnemonicModifier(modifier cdk.ModMask)
	SetSkipTaskbarHint(setting bool)
	SetSkipPagerHint(setting bool)
	SetUrgencyHint(setting bool)
	SetAcceptFocus(setting bool)
	SetFocusOnMap(setting bool)
	SetStartupId(startupId string)
	SetRole(role string)
	GetDecorated() (value bool)
	GetDeletable() (value bool)
	GetDefaultSize(width int, height int)
	GetDestroyWithParent() (value bool)
	GetMnemonicModifier() (value cdk.ModMask)
	GetModal() (value bool)
	GetPosition(rootX int, rootY int)
	GetRole() (value string)
	GetSize() (width, height int)
	GetTitle() (value string)
	GetTransientFor() (value Window)
	GetSkipTaskbarHint() (value bool)
	GetSkipPagerHint() (value bool)
	GetUrgencyHint() (value bool)
	GetAcceptFocus() (value bool)
	GetFocusOnMap() (value bool)
	HasGroup() (value bool)
	Move(x int, y int)
	ParseGeometry(geometry string) (value bool)
	ReshowWithInitialSize()
	SetAutoStartupNotification(setting bool)
	GetOpacity() (value float64)
	SetOpacity(opacity float64)
	GetMnemonicsVisible() (value bool)
	SetMnemonicsVisible(setting bool)
	GetDisplay() (dm cdk.Display)
	SetDisplay(dm cdk.Display)
	GetVBox() (vbox VBox)
	GetNextFocus() (next interface{})
	GetPreviousFocus() (previous interface{})
	FocusNext() enums.EventFlag
	FocusPrevious() enums.EventFlag
	GetEventFocus() (o interface{})
	SetEventFocus(o interface{})
}

Window Hierarchy:

Object
  +- Widget
    +- Container
      +- Bin
        +- Window
          +- Dialog
          +- Assistant
          +- OffscreenWindow
          +- Plug

In the Curses Tool Kit, the Window type is an extension of the CTK Bin type and also implements the cdk.Window interface so that it can be utilized within the Curses Development Kit framework. A Window is a TOPLEVEL Widget that can contain other widgets.

type WindowEdge

type WindowEdge uint64
const (
	WindowEdgeNone WindowEdge = iota
	WindowEdgeNorthWest
	WindowEdgeNorth
	WindowEdgeNorthEast
	WindowEdgeWest
	WindowEdgeEast
	WindowEdgeSouthWest
	WindowEdgeSouth
	WindowEdgeSouthEast
)

func (WindowEdge) FromString

func (e WindowEdge) FromString(value string) (enum interface{}, err error)

type WindowPosition

type WindowPosition uint64

Window position

const (
	WinPosNone WindowPosition = iota
	WinPosCenter
	WinPosMouse
	WinPosCenterAlways
	WinPosCenterOnParent
)

type WindowType

type WindowType uint64

Window type

const (
	WindowTopLevel WindowType = iota
	WindowPopup
)

func (WindowType) FromString

func (t WindowType) FromString(value string) (enum interface{}, err error)

type WindowTypeHint

type WindowTypeHint uint64
const (
	// A normal toplevel window.
	WindowTypeHintNormal WindowTypeHint = iota
	// A dialog window.
	WindowTypeHintDialog
	// A window used to implement a menu.
	WindowTypeHintMenu
	// A window used to implement a toolbar.
	WindowTypeHintToolbar
	// A window used to implement a splash screen
	WindowTypeHintSplashscreen
	//
	WindowTypeHintUtility
	// A window used to implement a docking bar.
	WindowTypeHintDock
	// A window used to implement a desktop.
	WindowTypeHintDesktop
	// A menu that belongs to a menubar.
	WindowTypeHintDropdownMenu
	// A menu that does not belong to a menubar, e.g. a context menu.
	WindowTypeHintPopupMenu
	// A tooltip.
	WindowTypeHintTooltip
	// A notification - typically a "bubble" that belongs to a status icon.
	WindowTypeHintNotification
	// A popup from a combo box.
	WindowTypeHintCombo
	// A window that is used to implement a DND cursor.
	WindowTypeHintDND
)

func (WindowTypeHint) FromString

func (t WindowTypeHint) FromString(value string) (enum interface{}, err error)

type WithFakeWindowFn

type WithFakeWindowFn = func(w Window)

Directories

Path Synopsis
cmd
go-charmap command
go-ctk command
go-dialog command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL