Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Aug 10 2020 02:42
    @qtxie FEAT: GTK: support draw block on window face. red/red@a01fc56
  • Aug 04 2020 02:22
    @qtxie Merge remote-tracking branch 'origin/master' into GTK red/red@1696f2a
    @dockimbel FEAT: adds some comments to the lexer inner loop code. red/red@02776dc
    @dockimbel FEAT: adds a default lexer logging function in system/lexer/tracer. Usage: transcode/trace <input> :system/lexer/tracer red/red@b345eb5
    @dockimbel FEAT: improves any-path! recognition for scan/fast. red/red@9fbddcb
    @greggirwin Merge pull request 4588 from theSherwood/quick-test_typo FIX: quick-test typo in code handling --binary red/red@9179f7d
    @dockimbel FEAT: forbids / and : in literal issue! and refinement! values. red/red@833e133
    @greggirwin Merge pull request 4589 from theSherwood/funny_time_value_2134 TESTS: issue 2134 (funny time! values) red/red@e78a62d
    @dockimbel FIX: reports error on loading ":word:" and ":word::" invalid literals. red/red@272c9ff
    @qtxie FIX: fill-pen doesn't restore after PUSH command in DRAW. red/red@3065290
    @theSherwood TESTS: issue 2134 (funny time! values) red/red@a63f04f
    @theSherwood TESTS: issue 2134 (funny time! values) red/red@ab5b133
    @theSherwood FIX: quick-test typo in code handling --binary red/red@73c7afd
    @greggirwin Merge pull request 4584 from theSherwood/confusing_errors_4119 TESTS: regression-test-red.red - issue 4119 red/red@171adb6
    @theSherwood TESTS: issue 4119 (Confusing error message on encountering $ inside block) red/red@3322a14
    @qtxie Merge remote-tracking branch '9214/map' red/red@262836e
    @qtxie FEAT: supports issue! and refinement! as key in map. red/red@8a80bc3
    @greggirwin Merge pull request 4581 from theSherwood/load_tag_3669 TESTS: loading a tag! - issue 3669 red/red@6f0b632
    @greggirwin Merge pull request 4582 from theSherwood/parsing_corrupted_float_4250 TESTS: float-test.red - issue 4250 red/red@9fcb7cf
    @theSherwood TESTS: issue 3669 (Missing escape char ^ when loaded TAG with it inside) red/red@1ba2c20
    @theSherwood TESTS: regression-test-red.red - issue 4119 red/red@4b6c81b
    @theSherwood TESTS: float-test.red - issue 4250 red/red@ed53deb
    @theSherwood TESTS: loading a tag! - issue 3669 red/red@c5f6def
    @9214 FEAT: refactor some of the typeset macros. red/red@fc0ac74
    @9214 Resolve merge conflict. red/red@e9cfa5e
    @9214 TESTS: add hashing test to MONEY! test suite. red/red@b40720b
    @9214 FEAT: extend support of MAP! keys to MONEY!. red/red@351fee6
    @9214 FEAT: add hashing support for MONEY!. red/red@67c0b9e
    @9214 FEAT: define supporting macros. red/red@97cc422
    @9214 Sync with the upstream. red/red@e9329e9
    @9214 Merge branch 'master' into map red/red@d4fd032
    @dockimbel FIX: issue! values with colon were loaded as set-words by the new lexer. red/red@ea1d139
    @dockimbel FIX: allows colon in issue! values in compiler. red/red@20418d3
    @dockimbel FIX: some negative time! values not loaded properly. red/red@7f2db9b
    @qtxie FIX: issue 4564 (in drop-down & drop-list when clicking outside the face) red/red@a1d1495
    @dockimbel FEAT: minor code reformatting. red/red@4e9d770
    @bitbegin FIX: support more delimeter-match for console engine red/red@363d45c
    @dockimbel FIX: do not percent-encode emails on MOLDing. red/red@37366bb
    @dockimbel FEAT: minor improvements in PE linker. red/red@30fc7b0
    @dockimbel FEAT: commented link-version fields in PE header. red/red@d3af82f
    @dockimbel FEAT: forces PE checksum field calculation if /Library module is available in the toolchain's interpreter. red/red@d894182
    @dockimbel Merge branch 'PE-patches' red/red@e03c26b
    @dockimbel FEAT: minor improvement to precalc-entry-point function in PE. red/red@396f4d7
    @dockimbel FIX: set the PE linker version field to same value as VS2019 linker's. It was previously set to 1.0, which caused some Windows functions (like CryptCATAdminCalcHashFromFileHandle()) to return ERROR_BAD_EXE_FORMAT. red/red@46ede9c
    @dockimbel FEAT: minor fixes and improvement for PE executables generation. red/red@84689e1
    @dockimbel FIX: additional fix for issue 4505. red/red@b452716
    @qtxie FIX: issue 4554 (2x slower face construction than before) red/red@3a79cbf
    @hiiamboris FIX: leaking OS handle eats memory when converting face to image red/red@a75be54
    @qtxie FIX: properly set font in the gui-console. red/red@48eb6f7
    @qtxie FIX: Win: offset-to-caret may return wrong value with UCS-4 string. red/red@804829a
    @qtxie FIX: flickering when selecting editable line on gui-console. red/red@27f6649
    @dockimbel FEAT: completes lexer changes for allowing sticky words to literals with leading # character. red/red@b35c630
    @dockimbel FIX: better loading of words made of multiple slash characters by compiler. red/red@1e07fbe
    @qtxie FIX: issue 4530 (Wrongly encode some unicode codepoints). red/red@dc825a5
    @9214 FIX: extend support of MAP! keys to new datatypes. red/red@07cb1d5
  • Jul 06 2020 08:34
    @qtxie Merge branch 'gtk_input2' into GTK red/red@1088a3a
    @qtxie FEAT: IM candicate window follows the caret. red/red@fa1d3b2
    @qtxie FEAT: GTK: support key event with unicode point > 10000h in view. red/red@b3ce9ed
    @qtxie FEAT: now can use IME to input in the gui-console. red/red@0d90b66
    @bitbegin test4 red/red@43d83a6
    @bitbegin test3 red/red@e358094
    @bitbegin tests2 red/red@7ad60ae
    @bitbegin test red/red@139d7bd
    @bitbegin FIX: support input method for rich-text red/red@5c3e9e8
  • Jul 04 2020 02:49
    @bitbegin FIX: sort files for gtk3 include red/red@07557a3
    @bitbegin FIX: add missing files for camera widget red/red@51711c7
  • Jul 03 2020 08:16
    @bitbegin FIX: don't support yuyv422 for now red/red@a2a1088
    @bitbegin FIX: if there no camera image, use last one for draw event red/red@8e2172f
    @bitbegin FIX: filter the meta capture device red/red@669ef28
    @bitbegin FEAT: improve select-camera red/red@67948be
    @bitbegin FEAT: support init-camera and select-camera red/red@db71cc9
    @bitbegin FIX: rename camera file name red/red@6f4f06a
    @bitbegin FEAT: collect camera devices red/red@250ab46
    @bitbegin FEAT: capture camera picture red/red@9ff3c77
    @bitbegin FIX: crash when use pthread_cancel red/red@6f352a4
    @bitbegin FEAT: draw camera picture to gtk3 red/red@a6a101b
    @bitbegin FEAT: add camera device to view backend red/red@af2587e
    @bitbegin FIX: rename camera device red/red@268f534
    @bitbegin FEAT: attach a widget to camera device red/red@baadf0a
    @bitbegin FEAT: add trylock/unlock for camera device red/red@f51c298
    @bitbegin FEAT: add a callback to process camera buffer red/red@1f076a6
    @bitbegin FEAT: add mutex/cond for camera red/red@0b567db
    @bitbegin FIX: don't use stream red/red@14cb54b
    @bitbegin FEAT: create camera thread red/red@da8ea62
    @bitbegin FEAT: camera open/close red/red@6bbf5b0
    @bitbegin FEAT: set stream on for v4l2 red/red@b119626
    @bitbegin FEAT: add close for camera red/red@bbebbea
    @bitbegin FEAT: init v4l2 for camera red/red@67e893b
  • Jun 26 2020 07:23
    @bitbegin FIX: compile failed after merge master red/red@cdfb371
    @bitbegin Merge remote-tracking branch 'origin/master' into GTK red/red@a16b746
    @qtxie FIX: issue 4551 (on-enter on macOS not working). red/red@21e6d37
    @dockimbel FIX: set the "File OS" field in PE resources to a more modern value. red/red@58ef838
    @dockimbel FIX: PE SizeOfHeaders value was not rounded up to a multiple of FileAlignment. The issue appeared when .rsrc section was added, overflowing the default size. red/red@458ddb1
    @dockimbel FEAT: allows literals starting with # to stick to word literals tail. red/red@22a523f
    @dockimbel FIX: refinement! literals ending with a colon loaded as words. red/red@37801d2
    @dockimbel FEAT: accepts comma and quote characters in literal URLs. red/red@bb32462
    @dockimbel FIX: SCAN on construction syntax literals always returning error! type. red/red@5e5c01a
    @dockimbel FIX: moves CR character from C_LINE to C_BLANK lexer class. Fixes wrong lines counting in lexer. red/red@3334490
    @dockimbel FIX: moves some error checkings from map! construction to lexer code. Allows to generate a proper lexer ERROR event. red/red@2142264
    @dockimbel FIX: scanning some invalid paths leads to freezing. E.g.: scan "a/ " red/red@4d864b1
    @dockimbel FIX: assertion failing on some illegal char! values loading. red/red@7f4723b
    @qtxie FIX: an extra key event triggered when using IME on Windows. red/red@bd5f1e4
    @qtxie FIX: compilation error on macOS due to last commit. red/red@bda45b5
    @qtxie FIX: properly select emoji characters in the gui-console. red/red@fdb31e8
    @qtxie FIX: about error in the gui-console. red/red@ca4e905
    @qtxie FIX: COLOR_FONT flags causes problem on Win7. red/red@66571de
    @dockimbel FEAT: reports an error when a map! literal has an integer prefix. red/red@a4581f0
    @dockimbel FIX: leading +/- sign in time! literals now correctly loaded. red/red@4784e84
    @qtxie FEAT: enables color font in the gui-console on Win10. red/red@71feb89
    @dockimbel FIX: issue 4505 ([Core] [Regression] interpreter started consuming a lot of RAM) red/red@8efeaf1
    @qtxie FIX: issue 4521 ([Console] PRINT output is missing a newline before closing ] delimiter). red/red@2ffb932
    @dockimbel FIX: replaces fix made by commit 14905b558ef3e27b53c4d59d23afbb32d114cb8b. red/red@fe9091e
    @dockimbel FIX: multiple fixes related to literal file values starting with %%. red/red@7509ffd
    @qtxie FIX: assertion failed in series-test.red red/red@a34a784
    @qtxie FIX: crashes when moving hash. red/red@ab510e9
    @qtxie FIX: issue 4511 (CHANGE arbitrarily thrashes hash! table) Also fix issue 3536 red/red@44d06d9
    @dockimbel FIX: avoids double ERROR lexer event triggering on non-matching closing delimiter. red/red@14905b5
    @dockimbel FIX: right type not always reported in lexer CLOSE event. E.g.: "[(]" red/red@ecb2312
    @dockimbel FEAT: propages exclusion of CR from quoted string literals to compiler's lexer. red/red@b7920cb
    @dockimbel FIX: properly separates sticky refinement! literals. red/red@1520894
    @dockimbel FEAT: minor code reformatting. red/red@14e656f
    @dockimbel FEAT: allows lowercase letters to represent escaped non-printable characters in compiler's lexer. red/red@d895b79
    @dockimbel FEAT: process C0 control characters as separate lexical class behaving as values separators. C0 control characters now behaves similarly to whitespaces. red/red@aeb0e27
    @dockimbel FIX: allows lowercase letters to represent escaped non-printable characters. red/red@84ec787
    @dockimbel FIX: do not allow LF or CR characters in double-quoted string literals anymore. red/red@9a6b7ea
    @dockimbel FIX: wrong loading of NUL character literal forms. red/red@a34d552
    @qtxie FIX: issue 4509 ([Regression] GUI Console started echoing lines) red/red@7fb276f
    @dockimbel FEAT: in lexer's ERROR event, now the type argument is set to the partially recognized token type. red/red@afc35c2
    @dockimbel FEAT: avoids generating a SCAN lexer event if scanning resulted in a syntax error. An ERROR event is previously generated in such case. red/red@afa1812
    @dockimbel FEAT: adds SCAN and LOAD lexer events for curly braced string literals. red/red@4590466
    @qtxie FIX: gui-console error after CTRL+L red/red@4a0183b
    @qtxie FIX: additional fix for issue 4427 read on urls doesn't apply CRLF->LF translation red/red@3eb847f
    @dockimbel FIX: lexer corrupting memory or crashing on LOAD event after failing to validate a token. red/red@0525eb1
    @dockimbel FEAT: more accurate report of curly-braced strings starting position in some lexer events. red/red@3d23acd
    @dockimbel FEAT: allows words to start with a caret character. red/red@d1f015b
    @qtxie FEAT: better handling of the text input in some cases. view/no-wait [button "PRINT" [print "text"]] red/red@a19e6dd
    @qtxie FEAT: tab key for completion only. red/red@32d548b
    @qtxie FIX: refreshing the gui-console when printing in another window. view/no-wait [button "PRINT" [print "text"]] red/red@84672bb
    @qtxie TESTS: adds test for issue 4494 red/red@a941f07
    @qtxie FIX: issue 4502 (SORT randomly arranges images). red/red@5e05811
    @dockimbel FIX: regression in string lexing causing test "573" to fail. red/red@e7a3b33
    @dockimbel FIX: set-path! type not reported properly in lexer CLOSE event. red/red@5c878da
    @dockimbel FIX: lexer callback triggers ERROR event twice on unclosed {...} strings. red/red@b08d8e3
    @dockimbel FIX: regression on LOAD tests. Caused by commit: 76c7d44014b4b2057df42e2799c6f0f8a340dd56 red/red@df5ae42
    @dockimbel FIX: PRESCAN and OPEN lexer events did not report right delimiter range for map! literals. red/red@e863bd8
    @dockimbel FIX: SCAN now returns NONE on empty input instead of crashing. red/red@76c7d44
    @dockimbel Merge branch 'master' of github.com:red/red red/red@cc402ec
    @dockimbel FEAT: better report of path syntax error range in lexer callbacks red/red@16b2cdf
    @qtxie FIX: issue 4497 ([View] CRASH with pane change & auto-sync off). red/red@5c03732
    @dockimbel FEAT: adds an extra SCAN lexer event triggering on leading word in paths. red/red@a69e27d
    @dockimbel FEAT: minor improvement to delimiters checking from console's input. red/red@9064404
    @dockimbel FEAT: simplifies delimiters handling in console input. red/red@7806053
    @qtxie FIX: issue 4494 (strange literal form of cyclic HASH!). red/red@fe9a283
    @qtxie Merge branch 'master' of https://github.com/red/red red/red@03044da
    @qtxie FIX: issue 4490 ([View] Stack overflow when one forgets to copy the font). red/red@575de8e
    @bitbegin FIX: open/close event should allow to load when match delimiters red/red@5a6dd57
    @9214 FIX: refactor conditional usages of typeset macros. red/red@1ab13be
    @bitbegin FIX: refactor cascaded delimiters match red/red@0df0fcf
    @x8x FEAT: Temporarly ignore ARM tests results, set max execution time to 15 minutes. red/red@217c43e
    @x8x Merge pull request 4475 from x8x/travis-ci-fix-timeout FEAT: improve Travis-CI notification on failure red/red@f246514
    @qtxie FIX: issue 4481 ([Draw] Line stops after 1000 coordinates) red/red@addc4b3
    @qtxie FIX: issue 4486 (Crash when inserting a face into window's pane). red/red@7f48a30
    @dockimbel FIX: interpreter crashing in infix evaluation after GC pass relocates global context values buffer. To reproduce the crash: https://gist.github.com/dockimbel/6d72971079a480a555482660677ad97e red/red@81ffa66
    @dockimbel FIX: interpreter crash after GC pass when global context is relocated. Crash exposed by this script: https://gist.github.com/dockimbel/6d72971079a480a555482660677ad97e red/red@c2f0d89
    @dockimbel Merge branch 'master' of github.com:red/red red/red@2417a84
    @dockimbel FIX: allows money! values with prefix unit in paths. red/red@e0e961b
    @dockimbel FIX: lexer input pointer can go beyond input end for file! tokens. red/red@37ac632
    @bitbegin FIX: transform not work for prepend mode on Windows red/red@19619de
    @qtxie FIX: GUI console becomes unresponsive after printing very long text. red/red@733af32
    @x8x FEAT: improve Travis-CI notification on failure red/red@63e7829
    @qtxie TESTS: adds test for issue 4432 red/red@2106a82
    @dockimbel FIX: some PE section names were incorrectly set for shared libraries. red/red@0cb889b
    @dockimbel FIX: better fix for lexer-based highlighting in console. See commit 59192c2db309f8c2a0fe6cbba4bc0bf83e51db95. red/red@36857eb
    @qtxie FIX: issue 4467 ([View] FIELD is limited with WRAP on) red/red@a3afc9e
    @qtxie FIX: assertion failure in mark-buffers in lexer. red/red@79109f2
    @qtxie FIX: error when return false in prescan stage. red/red@59192c2
    @dockimbel FIX: issue 4470 (Syntax Error : Invalid decimal) red/red@f939d7f
    @dockimbel FIX: dead function removal. red/red@22bc8a8
    @dockimbel FIX: minor fixes to compiler's lexer. red/red@9ee89e6
    @dockimbel FIX: regression in list-dir caused by integer division rule change. red/red@54a9781
    @qtxie FIX: use prescan in the highlighter of the gui-console. red/red@cfb6d30
  • May 31 2020 14:56
    @bitbegin FIX: area's font can't be changed red/red@b7fa9e7
    @bitbegin FIX: need update handle! after change-font view [ f: text "xdfg" 200x80 font [size: 10] return button "+" [ f/font/size: f/font/size + 1] ] red/red@f26be82
  • May 30 2020 08:58
    @bitbegin FIX: button default use wrap text red/red@4f093f2
  • May 30 2020 08:38
    @bitbegin FIX: button default use center align red/red@2df03aa
  • May 30 2020 08:20
    @qtxie FEAT: use default height only if face height shorter than it. red/red@d79ddd3
  • May 30 2020 07:29
    @bitbegin FIX: don't draw circle/ellipse if any radius = 0 to avoid cairo warning red/red@cdc8589
  • May 29 2020 12:33
    @bitbegin FIX: set area's caret color with font-color red/red@5622480
  • May 29 2020 08:03
    @bitbegin FIX: transform not work for prepend mode on gtk3 red/red@8b7bff8
    @bitbegin FIX: remove no used export red/red@9cf0a97
  • May 26 2020 09:00
    @bitbegin FIX: improve grad pen for start position red/red@b8c8385
  • May 26 2020 08:15
    @bitbegin FIX: label's default wrap is on red/red@07f6fbb
  • May 25 2020 13:35
    @bitbegin FIX: select text-list not right red/red@781113f
    @bitbegin FIX: on-over not right on text red/red@1c004ba
  • May 24 2020 06:50
    @bitbegin FIX: improve draw commands for gtk3 red/red@eb44b10
  • May 22 2020 06:41
    @bitbegin FIX: draw pattern lost alpha channel red/red@56cfe4e
  • May 21 2020 03:17
    @bitbegin FEAT: first support draw pattern red/red@4ffdef4
    @bitbegin FIX: improve draw brush bitmap red/red@b4c8a4e
  • May 20 2020 08:10
    @bitbegin FIX: clear current point for circle and triangle red/red@d577b3b
    @bitbegin FIX: need set pen-color now red/red@a2581f8
    @bitbegin FEAT: first support bitmap pen/pen-fill for gtk3 red/red@4607458
    @bitbegin FIX: shape and clip transform not right red/red@bd138d2
    @bitbegin FIX: remove unnecessary cairo save red/red@afc6719
Craig Brown
ok sent

i am on linux ubuntu 18.04.03 LTS

root@ubuntu-2gb-nbg1-1:/usr/local/bin# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:    bionic

root@ubuntu-2gb-nbg1-1:/usr/local/bin# ls
red-064.dms  red2019.dms  red.dms
root@ubuntu-2gb-nbg1-1:/usr/local/bin# red.dms 
Unable to init server: Could not connect: Connection refused

(console-2021-3-16-29645:1717): Gtk-WARNING **: 17:43:54.824: cannot open display: 

Red 0.6.4 works correctly. When I try to run red-16mar21-0051dff08 (I renamed red.dms) it gives me error above
It's a remote server without a monitor connected to it

GTK needs a GUI. If your machine isn't running a desktop, then that may be an issue. If it is running a desktop, you may have to export DISPLAY, something like this: export DISPLAY=:0
Gregg Irwin
R2 had similar issues if no X-Windows system was available.
@rebred You can try to use red.dms --no-view in this case. Don't forget to delete the old caches (folder ~/.red) before running this command.
@qtxie it worked ! thanks a lot!!
Craig Brown

strange gtk error:

Red [ needs 'view ]
getpanel: function [ md ] [ compose/deep [ panel 55x55 30.30.30 with [ offset: (md) ] [] ] ]
view [ 
    panel 400x600 [] on-down [ 
        probe event/offset
        append face/pane layout/only getpanel event/offset


(console-2021-3-28-10126:39690): Gtk-CRITICAL **: 15:12:40.593: gtk_widget_grab_focus: assertion 'GTK_IS_WIDGET (widget)' failed

any idea what could be causing this?

Maciej Łoziński
i encounter it very often, and don't know what's causing this. anyway, I didn't notice any harm from it :-)
Craig Brown
@loziniak in this case it's blocking any further interaction. Started happening after an allocation crash that could be prevented by wait 1 before appending to a panel/face... think I'll just restart, its been acting weird all day.
Gregg Irwin
If anyone knows GTK well, @qtxie could use a lieutenant to help with issues.
@snotbubble Pushed a fix. Though there is another issue in layout/only, it also sets the offset to 10x10.
>> get in first layout/only getpanel 200x200 'offset
== 10x10
Craig Brown

@qtxie got it thanks! Now for the actual problem:

Red [ needs 'view ]
getpanel: function [ i bgc ] [ 
    compose/deep [ panel 200x55 30.30.30 loose with [ color: (bgc) ] extra [ idx: (i) ] [ ] draw [] ]
view [
    aa: panel 400x600 [ text "click to add panel" ] on-down [ 
        clear face/pane
        repeat n 10 [
            rc: to-tuple reduce [ (min 80 random 120)  (min 80 random 120) (min 80 random 120) ] 
            append face/pane layout/only getpanel n rc    
        foreach-face face [
            unless none? face/extra/idx [
                face/offset/y: to-integer ((face/extra/idx - 1) * (face/size/y + 10)) + 10

click repeatedly in the panel bg...

*** Runtime Error 1: access violation
*** at: 0807FDE3h

its almost certainly the empty draw [] that's causing it

is there a safer way to make panels with empty draws? I'm using it to draw/clear a highlight border on select.

Maciej Łoziński
Hi! I can't run Red on headless Linux. Despite having libgtk-3-0:i386 installed, I get an error:
$ ./red-12apr21-630069f9e --no-view --cli
Unable to init server: Could not connect: Connection refused

(console-2021-4-12-26611:12814): Gtk-WARNING **: 14:27:35.576: cannot open display:
Oldes Huhuman
What about compiling cli version without view module?
@loziniak You may need to delete the cache to trigger the compilation.
$ rm ~/.red/console-*
$ ./red-12apr21-54b646f22 --no-view
@snotbubble I can reproduce the crash in release mode, but not in debug mode. Seems related to GC. If it's caused by empty draw [], then view [panel draw []] should make it crashes.
@snotbubble Add recycle/off before running the script will fix it.
It also crashes on Windows. After several hours debugging, no luck to find out what's wrong. Recorded as an issue: red/red#4876
Craig Brown

@qtxie awesome works fine now with recycle/off

will keep an eye on the memory usage, but doesn't look too bad when making/destroying faces.

François Jouen
Hi GTK Team: some positive tests for using Red on Raspberry PI OS.Just a problem for loading files.
Any idea?
@ldci request-file doesn't work or it works but has warning?
François Jouen
@qtxie It worls alone but not inside function such as openImage: does [tmp: request-file unless none? tmp [img: load temp]]
OK. I'll have a look at it.
François Jouen
@qtxie This code works on Linux but not with Raspeberry PI OS
Red [
    Title:   "Draw tests "
    Needs:     'View

img: make image! reduce [512x512 white]

loadImage: does [
    tmp: request-file
    unless none? tmp [
        img: load tmp
        canvas/image: img

view win: layout [
        title "Image Tests"
        button "Load"         [loadImage ]
        button 60 "Quit"     [Quit]
        canvas: base 512x512 img
François Jouen
@qtxie After PI. OS update always a warning but code is running:)
Craig Brown
Having a strange problem with text-list data becoming entangled with auto-generated faces. Is there something I'm doing incorrectly that would cause this?
Posting here incase its a gtk issue.
Sorry for the long example. Select list items, edit in field below, then do the same for the 2nd list. I get entangled data...
Red [ needs 'view ]
doup: true
mkp: func [ ] [
    n: copy []
    append n [ below ]
    repeat i 2 [
        append n compose/deep [ 
            (to-set-word rejoin [ "list" (i) ]) text-list 280x80 data [ "one" "two" ] select 1 on-change [
                ;print [ "list on-change triggered and doup is" doup ]
                if doup [
                    doup: false
                    (to-set-path rejoin [ "edit" (i) " text" ]) (quote face/data/(face/selected))
                    doup: true
            (to-set-word rejoin [ "edit" (i) ]) field 280x30 on-change [
                ;print [ "field on-change triggered and doup is" doup ]
                if doup [
                    if (quote face/text) <> "" [
                        doup: false
                        (to-set-path rejoin [ "list" (i) " data" "(list" (i) "/selected)" ]) face/text
                        doup: true
            pad 0x30
    probe n
view/tight [ 
    title "face from func test - onchange"
    aa: panel 300x320 30.30.30 [ ]
    do [ append aa/pane layout/only mkp ]    
Craig Brown

more ui woes, text-list below is updated by changes to its data from one fied, but not another:

Red [ needs 'view ]
a: [ "one" "two" "three" ]
doup: true
view [ 
    panel 200x500 [ 
        text "list block 'a'^/changes field below"
        aa: text-list 180x100 data a select 1 on-change [ if doup [ doup: false bb/text: a/(aa/selected) doup: true ] ]
        pad 0x30
        text "changes a/(listbox/selected)^/via on-change which^/auto-updates the listbox^/but not the field below"
        bb: field 180x30 with [ text: "one" ] on-change [ if doup [ a/(aa/selected): face/text probe a ] ]
        pad 0x30
        text "this is linked to a/2^/but doesn't update fields^/above"
        cc: field 180x30 with [ text: a/2 ] on-change [ probe a ]

Is there any documentation that explains when widgets can or can't be updated by the data they use?

Toomas Vooglaid
@snotbubble My guess is, it's a feature of reactive system, that you have to reference data source you want to trigger the reaction. In your case, it's enough to use a/2: face/text (or even a/2: a/2) in cc's on-change actor.
Craig Brown
Thanks Toomas. So in this example a text-list's data is included in the reactive system while a field's text isn't and has to be set explicity.
Toomas Vooglaid
I don't know the low-level details of reactive system, just sharing guess based on observations. I think @hiiamboris can enlighten us on this.
let's see

About the 2nd snippet (didn't run the 1st yet).

A series can only be owned by a single object currently. In this case data transfers ownership to aa of both a and it's subseries. Then text takes ownership of aa/2 only from aa and gives it to cc. So aa won't see the changes in a/2 anymore but it will see changes in a, that's why your a/thing: other-thing works, but the other one not.

In 1st snippet you need text-list 280x80 data copy/deep [ "one" "two" ] because you're assigning the same block to both lists, which is clearly gonna go south.
Toomas Vooglaid
But, @hiiamboris , why does a/2: a/2 work in cc's on-change?
Aa.. that's because a is still owned by aa?
Because it's a change in a itself, yes.
Toomas Vooglaid
Ok, thanks, got it!
Hope Craig gets it too :)
Craig Brown
Hey I'm just faking it till I make it here... I'll sink in eventually :D
So with the 1st problem, the series [ "one" "two" ] as it exists in the function is whatever is duplicated in the output block... even though it has no name (like theblock: [ "one" "two" ])
Craig Brown
and with the 2nd example: the best thing would be to decouple everything (copy instead) and change stuff explicitly via on-change, unless I want only one widget to be implicitly linked with the data (a)?
Craig Brown
awesome thanks for clearing that up!
Craig Brown

having trouble attaching on-wheel to text

Red [ needs 'view ]
txtscroll: object [
     on-wheel: function [face event] [ print [ "we're scrollin..." ] ]
    on-down: function [face even] [ print [ "click works" ] ]
view/tight [
    panel 50x50 [
        below center
        t: text "10"
    do [ t/actors: txtscroll probe t/actors ] 

bug or feature??

IIRC wheel doesn't work on GTK at all (bug)
Oldes Huhuman
It does nothing under Windows either.
Craig Brown
Got it thanks. No wheel-on-text.
works fine on W10 for me
if you're on W7, you might need to focus it to receive wheel events (different wheeling model there)