aboutsummaryrefslogtreecommitdiff
path: root/examples/working-shared/gtk.ey
blob: 4e5b652997fd771223851f00f5da2be54b1203d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"lib/ffi.ey" include
"lib/ffi/gtk.ey" include

{ γbutton_new_with_label } "β" deffd
{ -2201 0 0 0 γsignal_connect_data } "<-" deffd

ffi .gtk "γ" via
"org.gtk.example" 0 γapplication_new ==app
app "activate" { dump dump
  app γapplication_window_new ==win
  win "Window" γwindow_set_title
  win 200 200 γwindow_set_default_size

  γORIENTATION_HORIZONTAL γbutton_box_new ==box
  win 10 γcontainer_set_border_width

  γgrid_new ==grid
  win grid γcontainer_add

  βHello World! 
    { dump dump "Hello World!" dump } <-clicked
  grid -01 0 0 1 1 γgrid_attach

  βFinish
    { dump dump win γwidget_destroy } <-clicked
  grid -01 1 0 1 1 γgrid_attach

  γtext_view_new ==txt
  txt 0 γtext_view_set_editable
  txt 0 γtext_view_set_cursor_visible
  txt γtext_view_get_buffer
    sys .file "φ" via "gtk.ey" φopen 65536 φread φclose 
    γtext_buffer_set_text

  0 0 γscrolled_window_new ==scroll
  scroll txt γcontainer_add
  scroll 1 γwidget_set_hexpand
  scroll 1 γwidget_set_vexpand
  grid scroll 0 1 2 1 γgrid_attach

  win γwidget_show_all
} 0 0 0 γsignal_connect_data
app 0 "" γapplication_run
app γobject_unref

"Killing threads with fire" die

# vim: syn=elymas