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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Anton
4-Jun-2005
[1121x2]
I think this may work (not sure, can't test):
sdk?: is-this-sdk? ; <--- need to find out a real flag

set 'edit	do #either [sdk?][#include %rebgui-edit.r][%reb-gui-edit.r]

set 'widgets	do #either [sdk?][#include %rebgui-widgets.r][%rebgui-widgets.r]

set 'requestors do #either [sdk?][#include %rebgui-requestors.r][%rebgui-requestors.r]

set 'display	do #either [sdk?][#include %rebgui-display.r][%rebgui-display.r]
sdk?: #do [true] false
ChristianE
4-Jun-2005
[1123]
Ashley, you may have a look at this modified LED stuff:
Anton
4-Jun-2005
[1124]
ah heck, that won't work....
ChristianE
4-Jun-2005
[1125x3]
;	15-Mar-2005 Pascal Lefevre
	;	27-Apr-2005 Pascal Lefevre

    ;    4-Jun-2005 Christian Ensel (minor color and shape suggestions)
	led: make face [
		size:	-1x4

  effect:	[draw [pen edge-color fill-pen window-color box 0x0 0x0]]
		font:	default-font
		para:	make default-para [origin: as-pair base-size 2]
		feel:	make default-feel [
			redraw: func [face act pos /local colors] [
				if act = 'show [
                    colors: reduce case [
						any [face/data = 1 face/data = true]  [
                            [btn-text-color btn-text-color]
                        ]
                        any [face/data = 0 face/data = false] [
                            [edge-color btn-up-color]
                        ]
                        true [
                            [edge-color white]
                        ]
                    ]
                    face/effect/draw/2: colors/1
                    face/effect/draw/4: colors/2
				]
			]
		]
		init:	does [
			if word? data [data: to logic! data]

   if negative? size/x [size/x: 1000000 size/x: 4 + para/origin/x + 
   first size-text self]
			effect/draw/6/y: unit-size 
			effect/draw/7: as-pair unit-size * 3 unit-size * 2,5
		]
	]
I gave the LEDs a slightly different shape to make them look different 
from the check boxes, to make it clearer that they are informative 
only and not meant to accept user interaction.

I dropped my previous color suggestions in favour of using only colors 
you've allready featured.
The "one color - different shades" approach really should do for 
most users, I think.
Anton
4-Jun-2005
[1128x2]
CTX-REBGUI: context [

	...

	edit: none
	widgets: none
	requestors: none
	display: none
		
	#do [edit: do #include %rebgui-edit.r]
	if none? edit [edit: do %rebgui-edit.r]
	#do [widgets: do #include %rebgui-widgets.r]
	if none? widgets [widgets: do %rebgui-widgets.r]
	#do [requestors: do #include %rebgui-requestors.r]
	if none? requestors [requestors: do %rebgui-requestors.r]
	#do [display: do #include %rebgui-display.r]
	if none? display [display: do %rebgui-display.r]
	...

]


CTX-REBGUI: context [

	...

	edit: none
	widgets: none
	requestors: none
	display: none
		
	smart-do: func ["helper function to reduce repetition"
		ignored [issue!] block [block!]
	][
		if none? get first block [do replace copy block [#include][]]
	]
	smart-do #do [edit: do #include %rebgui-edit.r]
	smart-do #do [widgets: do #include %rebgui-widgets.r]
	smart-do #do [requestors: do #include %rebgui-requestors.r]
	smart-do #do [display: do #include %rebgui-display.r]
	...

]
Oops! I think smart-do will not work (because preprocessor lines 
are removed ?) Ugg.. Anyway try the first way...
BrianH
4-Jun-2005
[1130]
The preprocessor is freely available, even to those that don't license 
the SDK. You could just have everybody use it whether they use the 
SDK or not, and have one code base.
Colin
4-Jun-2005
[1131]
Very impressive demo. When I run it from rebview1247031.exe, then 
I fill the  Field\Password box, like just type in lots of characters, 
as I move the cursor over the field labels, they disappear. I can 
do this to all the tab field labels.  The words wont reappear until 
I start deleting the password characters and I move the cursor over 
the labels again.
Graham
4-Jun-2005
[1132x7]
Is there any reason why the text in a password field can not be selected 
with the mouse?
Nor, can it be restored with ctrl-z
Where's this memory leak arising from?
Running latest view .. and tour.r reports 6766kbs when I start it 
.. and doing nothing at all, memory use keeps climbing.  HIt 10000kbs 
at 30 mins or so before I killed it.
jumps up 8 or 9 kbs each time
not related to this leak is it .. http://www.rebol.net/cgi-bin/rambo.r?id=3593&
 which is apparently fixed in the latest releases ( according to 
Gab )
though I still see it as per  this http://www.rebol.net/cgi-bin/rambo.r?id=3557&
Ashley
4-Jun-2005
[1139]
Earlier builds of RebGUI used the following code to minimise the 
problem:

	context [
		show*: :show
		set 'show func [face [object! block!]] [show* face recycle]
	]

which kind of points to the GC as the problem.
Graham
4-Jun-2005
[1140]
I see.. so if you wait long enough, it gets collected
Vincent
4-Jun-2005
[1141]
On GC/memory leak : the events system allocates this memory - disabling 
events stop this leak, and changing the timers rate change the allocation 
rate. The trigger to release the memory is quite high, so it's takes 
a long time to be collected. Regardless of 'stats memory usage indication, 
it seems that Windows only gets the memory back when the REBOL windows 
are minimized.
Graham
4-Jun-2005
[1142]
So, unattended, this could crash windows?
Ashley
4-Jun-2005
[1143]
With regards to #includes (from Anton's examples above), the following 
is about the best workable solution I can come up with at the moment:

	ctx: #include %include.r
	if issue? ctx [ctx: do %include.r]
Volker
4-Jun-2005
[1144x2]
Not a memory leak. Typical gc-behavior to improve performance. you 
would not going to empty your trashcan everytime you throw something 
in, you collect only once a day, no? expect some mb to be allocated 
that way, if it goes more then 5-8mb over initial value something 
is wrong. should maybe stated in a FAQ somewhere, confuses all people.
switch on recycle/torture, thats what happens if you empty the trashcan 
immediate.
Graham
4-Jun-2005
[1146]
4mb seems a lot just doing "nothing" ...
Volker
4-Jun-2005
[1147x3]
gains speed. have a look on how much your os spends to file-buffering 
in comparison.
its <5% of typical memory, <100% of minimal footprint, <30% of 15mb-app.
but maybe we could have a switch to set that size, for stealth-mode.
Ashley
4-Jun-2005
[1150]
Question for the bind experts out there. Given two files (named %include.r 
and %test.r respectively):

	REBOL []

	context [
		a: "A"
		b: does [print reform ["Value:" a]]
		c: does [print reform ["Value:" d]]
	]

	REBOL []

	RebGUI: context [
		d: "D"
		ctx: #include %include.r
		if issue? ctx [ctx: do %include.r]
	]

	RebGUI/ctx/b
	RebGUI/ctx/c


How do I bind %include.r to the RebGUI context such that it can see 
'd (as the #include successfully allows).
Volker
4-Jun-2005
[1151x2]
ctx: do bind load %include.r 'self
another option is to embedd a smaller and faster "prebol" in rebgui 
and build everything on startup, then doing it altogether.
Chris
5-Jun-2005
[1153x3]
; Here's a solution to the dual-use 'load:

load-include: func [include [any-block!]][

    either parse inlcude reduce [to-issue 'include file!][load include/2][include]
]


; It acts like 'load, except returns a prebolled block, or loads 
a prebol file:

load-include [#include %include.r]
REBOL []

load-include: func [include [any-block!]][

    either parse inlcude reduce [to-issue 'include file!][load include/2][include]
]

RebGUI: context [
	d: "D"
	ctx: do bind load-include [#include %include.r] 'self
]

RebGUI/ctx/b
RebGUI/ctx/c
And yes, there are typos there, Windows doesn't seem to keep up with 
my keyboard.
Volker
5-Jun-2005
[1156x7]
prebol: func [code "changes code" /local p f] [
	parse code rule: [
		any [
			p: #include set f file! (
				p: change/part p load f 2
			) :p
			| into rule
			| skip
		]
	]
	code
]
; changes code, use copy/deep if needed

t1: now/precise
save %test.r [The embedded stuff]
p: prebol [Hello [World #include %test.r here] we are ]
print[difference now/precise t1]
can you benchmark this? seems to be fast enough. than you can use
do prebol [ .. ]
as main-script
(remove the "changes code" in header, moved to comment..)
has bug, does not prebol subfiles correctly.
prebol: func [code /local p f rule] [
	if file? code [code: load code]
	parse code rule: [
		any [
			p: #include set f file! (
				p: change/part p prebol load f 2
			) :p
			| into rule
			| skip
		]
	]
	code
]
; changes code, use copy/deep if needed

t1: now/precise
save %test.r [The embedded and #include %test2.r stuff]
save %test2.r [Subembedded]
p: prebol probe [Hello [World #include %test.r here] we are]
print [difference now/precise t1 newline mold p]
then in sdk
 prebol: func[code][code]
and you are done too. (not tested)
last version in %short-prebol.r on developer
shadwolf
5-Jun-2005
[1163]
Ashley roadmap: 1) set of widget complet (what widgets are in it 
?)  2) functionnality of this set (what they do how we use them ?) 
3) esthetic of the widgets is dicted by the low people working on 
RebGUI and the nececity to make a simplier set of widgets. The fact 
that AGG was not official have make diffucut to put in line a good 
estetical consept. As REbGUI philosophy is to be light and easy  
we can't make a lot of heavy imge insertion and image drawing
Graham
5-Jun-2005
[1164]
the table widget says one can select a row, but it doesn't do that 
for me.
Ashley
5-Jun-2005
[1165x2]
Not implemented yet.
Here is a preview of what the roadmap will look like: http://www.dobeash.com/it/rebgui/roadmap


Not withstanding the fact that all the blanks need to be filled in, 
if there is anything else you believe should be covered / included 
then just holla.
Graham
5-Jun-2005
[1167x2]
request-dir
which I see is now implemented in the latest views
shadwolf
5-Jun-2005
[1169x2]
AS I propose to orgenise the devs we need as we are in stage one 
to have the overall list of the widgets that ashley wants to have 
in rebgui. We can make it on dokuiki rebolfrance.info a little table 
with widgets name | widget description | author that takes in charge 
the dev of this widget | dev stage % | integrated to rebgui |
for example for listview this will be: listview | multi column full 
resizable and multi widgets type support | Shadwolf | 98% | NO