r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Graham
3-Jun-2006
[5133x5]
Does date plotting working in q-plot?
this doesn't look at all like it should

translate-draw: func [
	height [integer!]
	blk [block!]
	/local dr p
][

 parse blk [some ['draw set dr block! (parse dr [some [p: pair! (p/1: 
 as-pair p/1/x height - p/1/y) | skip]]) | skip]]
	blk
]

view layout [
	origin 0
	bx: box 400x400 black effect translate-draw 400 [
		draw [
			pen red
			line 50x50 350x50
			pen blue
			line 50x50 50x350
			pen yellow
			line 50x50 100x200 200x150 300x250 350x225
			pen white
			text aliased 10x350 "Y axis"
			text aliased 320x40 "X axis"
		]
	]
]
Oopss...
wrong one ..
do %q-plot.r


date-data: [ 6-Apr-1993 11-Apr-1993 15-Apr-1993 27-Apr-1993 11-May-1993 
25-May-1993 22-Jun-1993 27-Jul-1993 7-Oct-1993 15-Feb-1994 4-Oct-1994]
y-data: [ 2.3 3.2 3.4 3.8 4.45 5.0 6.6 7.53 8.7 9.4 11.1]
val: 6

view quick-plot [
	800x600
	x-data [(date-data)]
	line [(y-data)]
	x-axis (val) border
	x-grid (val)
]
Henrik
3-Jun-2006
[5138]
view layout [box red key 'f5 [print "how do I capture F-keys?"]]
Gabriele
3-Jun-2006
[5139]
view layout [button "F5 Button" keycode 'f5 [print "got F5"]]
Henrik
3-Jun-2006
[5140]
thanks
Volker
6-Jun-2006
[5141]
from plugin-2, launching *.r with doubleclick, locally: i usually 
right-click, choose "open with/others" and get a checkbox to make 
rebol default. Although when installing fresh, rebol is already there.
Robert
18-Jun-2006
[5142x3]
Ok, from RebGUI group, as it's not just related to RebGUI:


I have the following problem from time to time on my system and always 
on the system of one of my testers.


On my system: I start my app, the gui comes up and I click the first 
widget and the app falls back to the console. Without an error. This 
happens as do-events returns.


The same problem is on the other system, but here I only can do one 
click on a widget.
I really couldn't specify it more narrow. I have the same effect 
on my system, when my app exited with an error. I hack in UNVIEW 
and than restart it, I alway return to the console immediatly. Doing 
it once again, UNVIEW and restart, than it works.

If I use UNVIEW two times, it works immediatly.
Has anyone an idea what the problem might be, or even how we could 
track it down?
Volker
18-Jun-2006
[5145x2]
probe first system/view 
probe get in system/view/event-port 'awake 
make system/view [source wake-event] 
system/view/wake-event: func [port /local event no-btn] bind [
    event: pick port 1 
print remold [event/type event/offset event/key] 
    if none? event [

        if debug [print "Event port awoke, but no event was present."] 
        return false
    ] 
    either pop-face [

        if in pop-face/feel 'pop-detect [event: pop-face/feel/pop-detect 
        pop 
            -face event
        ] 
        do event 
        found? all [
            pop-face <> pick pop-list length? pop-list 
            (pop-face: pick pop-list length? pop-list true)
        ]
    ] [
        do event 
        empty? screen-face/pane
    ]
] system/view 
echo on 
print "con" 
view layout [button "test" [probe "test"]]
For tracking.
Robert
18-Jun-2006
[5147]
Thx. So I just add this code before my app and see what's spit out?
Volker
18-Jun-2006
[5148x5]
Yes.
This is called from system/view/event-port/awake. when it returns 
false, the do-events should terminate.
so i guess it returns false on some occasions. maybe something triggers 
a none-event, that would trigger it.
then we patch it to check for a face in system/view/screen-face/pane
would be my guess. maybe he has some tool which sends something unusual 
to windows, which wakes rebol but  is not recognised, so none.
Robert
18-Jun-2006
[5153x2]
Here is what I get:
[time 73x39 none]
[time 73x39 none]
[time 73x39 none]
[down 73x39 none]
company-selected
[time 73x39 none]
[time 73x39 none]
[time 73x39 none]
[time 73x39 none]
[up 73x39 none]
>>
So, where company-selected is printed, my code is executed.
Volker
18-Jun-2006
[5155x2]
Hmm. i made a bug, the 
  print remold [event/type event/offset event/key]
only works if 'event is not none ..
But you get no error, do-events simply returns?
can you probe do-events? as it is a 'wait, maybe it returns someweird 
port.
Robert
18-Jun-2006
[5157]
yep
Volker
18-Jun-2006
[5158x3]
print[type? event]
if event! = type? event[ 
print remold [event/type event/offset event/key] 
]
when i close the window here, do-events returns the event-port
(above as fix for thewake-event)
Robert
18-Jun-2006
[5161]
can you please post the complete snippet?
Volker
18-Jun-2006
[5162x2]
system/view/wake-event: func [port /local event no-btn] bind [
    event: pick port 1
print[type? event]
if event! = type? event[ 
print remold [event/type event/offset event/key] 
]
    if none? event [

        if debug [print "Event port awoke, but no event was present."] 
        return false
    ] 
    either pop-face [

        if in pop-face/feel 'pop-detect [event: pop-face/feel/pop-detect 
        pop 
            -face event
        ] 
        do event 
        found? all [
            pop-face <> pick pop-list length? pop-list 
            (pop-face: pick pop-list length? pop-list true)
        ]
    ] [
        do event 
        empty? screen-face/pane
    ]
] system/view 
echo on 
print "con" 
view/new layout [button "test" [probe "test"]]
probe do-events
Robert
18-Jun-2006
[5164]
Hmm... I now have added to records to my app and since then it works. 
What could cause do-events to exit?
Volker
18-Jun-2006
[5165x7]
usually some port returning false
claiming to be closed. seems to happen sometimes even is the port 
is not in the wait-list.
IIRC. but did not investigate further.
thats why the probe of do-eents would be interesting.
or some internal bug..
if you  added data and it works, sounds like something memory-related. 
changed memory-layout, other part is hit.
Maybe that guy where it always fails could be interesting for RT?
Gabriele
19-Jun-2006
[5172]
do you have any ports in the wait-list, with an awake function that 
is not returning false? note that if you return none it does not 
work, only with false wait will continue waiting.
Robert
19-Jun-2006
[5173x4]
I use Ashley's SQLite stuff, but don't expect it to use any ports. 
Than I use RebGUI (don't know if this uses any ports).


I used Volker's snippet and while it spits our messages, the app 
works. As soon as I remove the code, it fails again.
I add the probe do-events and here is the result:
probe do-events

make port! [
    scheme: 'event
    host: none
    port-id: none
    user: none
    pass: none
    target: "events"
    path: none
    proxy: none
    access: none
    allow: none
    buffer-size: none
    limit: none
    handler: none
    status: none
    size: none
    date: none
    url: none
    sub-port: none
    locals: none
    state: make object! [
        flags: 4719107
        misc: none
        tail: 0
        num: 1
        with: "^/"
        custom: none
        index: 0
        func: 12
        fpos: 0
        inBuffer: none
        outBuffer: none
    ]
    timeout: none
    local-ip: none
    local-service: none
    remote-service: none
    last-remote-service: none
    direction: none
    key: none
    strength: none
    algorithm: none
    block-chaining: none
    init-vector: none
    padding: none
    async-modes: none
    remote-ip: none
    local-port: none
    remote-port: none
    backlog: none
    device: none
    speed: none
    data-bits: none
    parity: none
    stop-bits: none
    rts-cts: true
    user-data: none
    awake: func [port][wake-event port]
]
does this help in any way?
Can I probe the wait-list?
Volker
19-Jun-2006
[5177x5]
scheme: 'event
that is the event-port
seems the wake-eventreally returns something wrong.
for tracing, can you change the prints to appends to some log-block? 
so that the printing does not interfere?
What happens if you call do-events again? if that works, something 
like
  while[same? system/view/event-port do-events][]
as workaround?
Robert
19-Jun-2006
[5182]
Looks like we (Cyphre and I) found it. Seems to be a problem in combination 
with RebGUI and Anamonitor in that the event system is somehow patched. 
I will test it further and let you know.