World: r3wp
[!RebGUI] A lightweight alternative to VID
older newer | first last |
Ashley 29-Nov-2010 [8878] | Odd, I just tested with b117 and ran tour.r without a problem. |
GrahamC 29-Nov-2010 [8879] | We're running different builds I guess |
Awi 13-Jan-2011 [8880x5] | I am using build 117 (public) for creating a reservation application. I noticed a tremendous slow down on hovering above buttons created at the beginning, but hovering at the buttons created at the end is fast. Here is a code sample: |
REBOL [] do %rebgui.r seat-layout: copy [] loop 16 [ insert tail seat-layout compose/deep [panel 50 data []] for row 1 15 1 [ foreach col [A B - D E] [ insert tail last seat-layout compose/deep [button 7x5 blue (rejoin [row col]) [alert face/text]] ] insert tail last seat-layout [return] ] ] display "test scroll panel" compose/deep [ calendar scroll-panel 152x100 #HW data [after 4 (seat-layout)] calendar ] do-events | |
If you move your cursor quickly over the calendar on the left, it will leave a trail while focusing, it gets worse when you try to select a button in the scroll panel. But the right calendar is not affected. | |
Strangely, when you scroll the panel to bottom right, everything is back to normal in that condition, but when you scroll back to top left, things are the same again. Any hints how to fix this? | |
This trailing hover problem is not visible in build 218, but I need drop- and edit-list for my app, and these two are broken in b218. Thanks for the help! | |
Ashley 13-Jan-2011 [8885] | On a Mac, no problem. On WinXP it appears that the events are being generated faster than they can be processed. Good test case, I've never seen this before! ;) I don't have an immediate fix, but this is one more reason for me to get the 2.x series released. Are drop- and edit-list the only roadblocks for you? |
GrahamC 13-Jan-2011 [8886] | eh?? Is RebGUI alive again? |
Ashley 13-Jan-2011 [8887] | Depends on how big the roadblocks are. It's easier to fix *-list than port the 2.x event handling back to 117! ;) |
Awi 14-Jan-2011 [8888x6] | Ashley, that would be very cool. But with b217/8 I also experienced another strange thing when popping up a window on button click. Sometimes some texts in the window are blank, sometimes it's displayed correctly. The window consists of several panels, fields and buttons. It's reproducible consistently, I'm trying to make a sample code for this. |
This don't happen in b117 (the same code, except I had to replace 'question' to 'confirm' and 'ctx-rebgui/layout/only' to 'layout/only') | |
After an exhaustive testing, by luck I found out the problem. It was the table. The bug is pretty strange tough. Here is the test case: | |
REBOL [] do %rebgui.r seat-layout: copy [] for slot 1 16 1[ insert tail seat-layout compose/deep [panel 50 data []] for row 1 15 1 [ foreach col [A B - D E] [ insert tail last seat-layout compose/deep [button 7x5 blue (rejoin [row col]) [display "test" [text "see me?"]]] ] insert tail last seat-layout [return] ] ] display "test scroll panel" compose/deep [ table options ["id" left .2 "name" right .8] data [1x2 "A to B" 3x4 "C to D" 5x5 "E to F"] return calendar scroll-panel 152x100 #HW data [after 4 (seat-layout)] ] do-events | |
If you run the code, clicking any button will show a new window with the text "see me?". But once you select the first table entry, clicking on the button will show you an empty window. The only cure is to hover on the second or third entry. Hovering is enough to fix the not drawn text problem. | |
But once you start clicking on the calendar, the text will be hidden again. Another hovering on the second or third table entrywill bring it back again. This only happens to text and fields. Text in buttons are not affected. | |
Awi 15-Jan-2011 [8894x6] | I found another problem with b218: when there is a spinner style in display, the confirm and alert requestor's button do not works: |
display "test scroll panel" [ myspinner: spinner options [$0 $10 $1] data $5 button "confirm" [confirm "yes/no works?"] button "alert" [alert "OK works?"] ] do-events | |
Sorry for reporting only bugs, I like the 2.x series so much, it's much faster, no slow scrolling, I do really hope this version gets stable and usable. Currently it's the only usable GUI for me with nice graphic. | |
Here I found another bug with the text-list style. When your list is longer than the box (means you have to scroll), deleting the item at the bottom caused some calculation mismatch in redraw. This don't happen when you start deleting from the top. Here is the test case: | |
do %rebgui.r display "test scroll panel" [ tl-rute: text-list data [ "a" "b" "c" "d" "e" "f"] button red "-" [ if tl-rute/selected [ remove find tl-rute/data tl-rute/selected tl-rute/redraw ] ] ] do-events | |
Delete "f", then delete other items, you will start to see "none" displayed in the list. This don't happen if you start by deleting other than "f" items. | |
GrahamC 15-Jan-2011 [8900] | usually there are methods to do this .. certainly there is for table/remove-row n |
Awi 15-Jan-2011 [8901x2] | RebDOC says nothing about deleting rows in text-list. Yes there is add-row and remove-row in table. |
But the table in 2.x has the habit to prevent drawing text :-), that's why I moved my code to text-list, avoiding tables. | |
Awi 17-Jan-2011 [8903] | Ashley & Graham, just want to let you know that my reservation program using b218 is finished, and has been working perfectly. Many thanks for your work on RebGUI and all the support. Hopefully I can join the effort soon and give some work back to the community. (Currently I only have drop-list2 and text-list2, but both are incomplete and based on incomplete b218, so I think sharing them will do more confusion than help). |
GrahamC 17-Jan-2011 [8904] | Maybe we should have moved RebGUI to github instead so people could fork and post their changes ... I guess we could still do so if Ashley restarts development. |
Awi 17-Jan-2011 [8905] | Yes good idea, and if I'm not asking too much, just a small documentaion explaining the basic concept of 2x RebGUI, to get people (me) started. Currently my only reference is RebDOC and tour.r and diff-ing with 117. For example I wanted to bring the b117 panel style (no border, silver background) back, I looked for some hours, and give up. Even some short points in this AltMe thread would be helpful. For example I found out how to do append-widget in 2.x through searching in google and found the chat history in altme. |
GrahamC 17-Jan-2011 [8906] | Yeah ... the docs are in this channel for the tricky stuff. But Ashley has assumed that R3 was going to quickly replace R2 hence the lack of movement here. |
Awi 17-Jan-2011 [8907] | I also assumed that since like 2008 :-) Some things like this project cannot wait, and RebGUI and Rebol2 are more than good enough for almost every case in my project. And I think if Rebol3 and r3-gui are out someday, I'll just rewrite my apps. |
GrahamC 17-Jan-2011 [8908] | Agreed. |
Awi 6-Feb-2011 [8909x3] | Found another bug in b218: when using rate and feel, Ok button in alerts no longer working, the same with Yes/No buttons in confirm. Here is a code sample: do %rebgui.r display "rate feel test" [ lbl: label "label with rate feel" rate 1 feel [ engage: func [f a e] [if a = 'time [print "awi"]] ] btn "test alert" [alert "can you close me?"] btn "?" [? lbl] btn "unset lbl/rate" [lbl/rate: none show lbl] btn "set lbl/rate" [lbl/rate: 1 show lbl] ] do-events |
Nice thing is, when I turn off "rate", it works again, so currently I have a workaround, thanks God, I'm very close to shipping as I found this bug :-) | |
Basically what I'm doing is reading/monitoring a serial port using rate/feel. Since Rebol does not have a timer, the only thing I can think of is using rate/feel, which works very nicely as long as you don't "wait". "wait'" will kill your "thread" as the next timer event kicks again. | |
Awi 17-Feb-2011 [8912x4] | I just want to share my modifications of the chat widget in b177, I needed a slimmer chat. It should also fix the resize issue: REBOL [] slim-chat: make baseface [ options: { USAGE: chat2 120 data ["Bob" blue "My comment." yello 14-Apr-2007/10:58] DESCRIPTION: Three column chat display as found in IM apps such as AltME. Messages are appended, with those exceeding 'limit not shown. OPTIONS: [limit n] where n specifies number of messages to show (default 100) [id n] where n specifies id column width (default 10) [user n] where n specifies user column width (default 15) [date n] where n specifies date column width (default 25) } size: 200x100 pane: [] data: [] edge: default-edge action: make default-action [ on-resize: make function! [face] [ poke face/pane/2/para/tabs 2 face/pane/1/size/x - sizes/slider - (sizes/cell * any [select face/options 'date 25]) face/redraw/no-show ] ] height: 0 ; actual pixel height of all messages (-1 ensures first message is offset to hide it's edge rows: 0 ; number of messages limit: none ; last n messages to display append-message: make function! [ user [string!] user-color [tuple! word! none!] msg [string!] msg-color [tuple! word! none!] date [date!] /no-show row /local p y t1 t2 t3 ] [ ; cache current tab stops p: self t1: pick pane/2/para/tabs 1 t2: pane/1/size/x - sizes/slider - (sizes/cell * any [select p/options 'date 25]) p: self ; get height of message y: max sizes/line 4 + second size-text make baseface [ size: as-pair p/size/x - sizes/slider + 1 10000 text: msg font: default-font para: para-wrap ] insert tail pane/1/pane reduce [ make baseface [ offset: as-pair -1 height - 1 size: as-pair t2 21 span: all [p/span find p/span #W #W] text: user edge: make default-edge [size: 0x1] font: make font-top [color: either word? user-color [get user-color] [user-color] style: 'bold] color: either word? msg-color [get msg-color] [msg-color] ] make baseface [ offset: as-pair -1 height - 1 + 20 size: as-pair p/size/x - sizes/slider + 1 y text: form msg color: either word? msg-color [get msg-color] [msg-color] edge: make default-edge [size: 0x1] font: default-font para: para-wrap ] make baseface [ offset: as-pair t2 - 1 height - 1 size: as-pair (sizes/cell * any [select p/options 'date 25]) + sizes/slider + 1 21 span: all [p/span find p/span #W #X] text: form either now/date = date/date [date/time] [date/date] edge: make default-edge [size: 0x1] font: make font-top [style: 'bold align: 'right] color: either word? msg-color [get msg-color] [msg-color] ] ] height: height + y - 1 + 20 if ((length? pane/1/pane) / 3) > limit [ y: pane/1/pane/2/size/y + pane/1/pane/1/size/y - 2 remove/part pane/1/pane 3 foreach [u m d] pane/1/pane [ u/offset/y: u/offset/y - y m/offset/y: m/offset/y - y d/offset/y: d/offset/y - y ] height: height - y ] unless no-show [ insert tail data reduce [user user-color msg msg-color date] pane/1/size/y: height pane/3/ratio: pane/3/size/y / height show p ] show pane/1 ; !!! this cleans up artifacts but "eats" other widgets redraw events !!! ] set-user-color: make function! [id [integer!] color [tuple! word! none!] /local idx] [ if any [zero? id id > rows] [exit] poke data id * 5 - 3 color if limit > (rows - id) [ idx: either rows > limit [(id + limit - rows) * 3 - 2] [id * 3 - 2] pane/1/pane/:idx/font/color: either word? color [get color] [color] show pane/1/pane/:idx ] ] set-message-text: make function! [id [integer!] string [string!] /local idx] [ if any [zero? id id > rows] [exit] poke data id * 5 - 2 string if limit > (rows - id) [ idx: either rows > limit [(id + limit - rows) * 3 - 1] [id * 3 - 1] insert clear pane/1/pane/:idx/text string redraw ] ] set-message-color: make function! [id [integer!] color [tuple! word! none!] /local idx] [ if any [zero? id id > rows] [exit] poke data id * 5 - 1 color if limit > (rows - id) [ idx: either rows > limit [(id + limit - rows) * 3 - 1] [id * 3 - 1] pane/1/pane/:idx/color: either word? color [get color] [color] show pane/1/pane/:idx ] ] redraw: make function! [/no-show /local row] [ clear pane/1/pane height: 0 rows: (length? data) / 5 row: max 0 rows - limit: any [select options 'limit 100] foreach [user user-color msg msg-color date] skip data row * 5 [ append-message/no-show user user-color msg msg-color date row: row + 1 ] pane/1/size/y: height pane/3/ratio: either zero? height [1] [pane/3/size/y / height] unless no-show [show self] ] init: make function! [/local p] [ unless options [options: copy []] p: self limit: any [select options 'limit 100] ; chat pane (1) insert pane make baseface [ offset: as-pair 0 sizes/line size: p/size - as-pair sizes/slider sizes/line span: all [p/span find p/span #W #W] pane: [] ] ; heading (2) insert tail pane make gradface [ offset: -1x-1 size: as-pair p/size/x sizes/line text: "Chat" span: all [p/span find p/span #W #W] font: make font-button [align: 'left] para: make default-para [tabs: [0 0]] ] ; set header tabs poke pane/2/para/tabs 1 sizes/cell * (any [select options 'user 15]) poke pane/2/para/tabs 2 size/x - sizes/slider - (sizes/cell * any [select options 'date 25]) ; vertical scroller insert tail pane make slider [ offset: as-pair p/size/x - sizes/slider sizes/line - 2 size: as-pair sizes/slider p/size/y - sizes/line + 2 span: case [ none? p/span [none] all [find p/span #H find p/span #W] [#XH] find p/span #H [#H] find p/span #W [#X] ] action: make default-action [ on-click: make function! [face] [ if height > face/size/y [ face/parent-face/pane/1/offset/y: (height - face/size/y * negate face/data) + sizes/line show face/parent-face ] ] ] ] pane/3/init action/on-resize self ] ] |
And here is a screenshot: http://uploadpad.com/files/Chat.png | |
To use this, just save it as slim-chat in rebgui/widgets, and then do create-distribution.r. It's fully syntax-compatible with the existing chat widget. | |
I forgot, you will need to add #include %widgets/slim-chat.r in rebgui-widgets.r | |
GrahamC 17-Feb-2011 [8916] | indonesian? |
Awi 17-Feb-2011 [8917] | yes :-) |
Awi 25-Feb-2011 [8918x3] | another minor bug in rebgui, I just mentioned it here so it's not lost: REBOL [] do %rebgui.r counter: 0 muline: copy "" display "button color not reset" [ btn "start timer" [ if tgl/text = "wait" [wait 0] print "hi" ] tgl: toggle data ["wait" "no-wait"] ] do-events |
when a button does some activities, in this case 'wait', the button's color changed to the pushed state, but never gets back to it's original color. | |
it's b218 | |
Gabriele 21-Mar-2011 [8921] | calling WAIT inside a vid face action is not really supported by REBOL. In practice, there are cases where you may need to do this, but it is always a bit tricky. |
Awi 21-Mar-2011 [8922x2] | Thanks for the information Gabriele, I've been using this inside vid face action to wait for a data from serial port. Until now I have not encountered any issue. But maybe I'm just lucky. |
What I needed is actually only the timer action of a face to process an internal command queue, and while doing this I read some data from serial port. If rebol had a timer object, I don't need the face anymore. But afaik there is no timer in rebol, since it does not support multithreading yet, with exception of the face timer. | |
Gabriele 24-Mar-2011 [8924] | Timers are not really related to multithreading. If you only need a timer, you can just use WAIT with a time! or integer! value. Also, one way to work around problems that may happen when using WAIT inside a face action is to disable the event port, then WAIT, then enable it again. Eg, in your above code, replace the WAIT 0 with: saved: system/ports/wait-list system/ports/wait-list: [] wait 0 system/ports/wait-list: saved It may be better though to add the serial port to the wait list and handle things differently - I can't say without knowing more about your program. |
Awi 24-Mar-2011 [8925x2] | That solved this issue, thanks for the hint. |
On the timer topic, I needed a recurring event that fires every second, where I can do some processing, without blocking the main thread while waiting until the next event. In .Net I can achieve that using a timer object. | |
GrahamC 16-Apr-2011 [8927] | Ashley, any suggestions on how to detect inactivity so that I can log a user out of the application? |
older newer | first last |