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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Normand
4-Jun-2008
[7549]
Hi, folks.  I am getting back to an application I developped with 
RebGui in 2006.  I did download the last one from SVN, but the app 
no longer works under the current version of RebGui.  I get a lot 
of error messages about show-text, even the most simple ones, like 
--> show-text Fmsg "Warning --  Unable to read Products, Phone&Meet 
and Notes.  No file to read." <--.  Looking at docs, I still see 
the show-text function; there is still some appearances in some docs, 
but there are not much.  Maybe it is deprecated now?  I see set-text, 
but it talks about attributes of text, not its content.  So not shure 
it is the one to use now.  I would need to show the app soon, but 
hesitate to retarget the code, seing the frequency of the error message 
** Script Error: show-text has no value.  Inexistant function, bad 
assignement (for unknown reasons), or something else.  For me, hard 
to know now. From the 2006 epoch, is there a lot of change.  The 
app still get drawn a bit, though.  Thanks for an answer that would 
me out of problem.
Graham
4-Jun-2008
[7550]
show-text: :set-text
Normand
4-Jun-2008
[7551]
Thanks ; I converted show-text to set-text; show-values to set-values; 
show-title to set-title; show-focus to set-focus; the demo works 
back.
Graham
14-Jun-2008
[7552]
I see a number of on handlers.  Is there a way to have a on-drag 
handler as well for dragging objects?
Graham
15-Jun-2008
[7553x3]
Using Henrik's images
wait-images: copy []
  bg: make image! [20x20]
  forall bg [change bg 0.0.0.255]
  colors: copy []
  for i 8 1 -1 [
    dr: copy [pen none fill-pen black translate 15x8]
    for j 0 7 1 [append colors 0.0.0.255 - (j * 35)]
    for j 0 7 1 [
      append dr compose/deep [
        fill-pen (pick colors (j + i) // 8)
        rotate 45
        translate 3x3
        circle 2x2
      ]
    ]
    append wait-images draw copy bg dr
  ]
anim wait-images rate 10
Henrik
15-Jun-2008
[7556]
cool
Graham
15-Jun-2008
[7557]
yep, cool :)
Pekr
15-Jun-2008
[7558]
Hello. One of my friends, not even a probrammer, jut Perl user, was 
asked to prepare solution for their production line. They will need 
to cover more than 100 Terminals with touch screens. He is a friend 
of Bobik and mine, so Perl, Python, and REBOL alternatives were possible. 
I have the pleasure to aanoucne, that REBOL + RebGUI was choosen.


While app is rather primitive - few fields on the left, numeric + 
few alphabetic keys on the right, connecting to mySQL, the environment 
is also very restrictive - Terminals (don't remember the model) are 
older ones, 24MB of RAM, no hardisk, P300 performance. The solution 
boots Linux from network and RebGUI app is loaded ... only 1MB or 
RAM is left, so the solution is so so ...


I would like to ask, if RAM consumption could be improved with encapping 
app with rebface for e.g.?
Henrik
15-Jun-2008
[7559]
probably a little bit, since you can select what to include. I suppose 
VID can be removed if RebGUI is going to be the GUI for the application.
Ashley
16-Jun-2008
[7560x2]
Graham, very clever ... that's almost worth a widget in its own right.
Pekr, using rebface instead of rebview will make a big difference 
as rebface excludes VID and all help text is stripped out. On OS/X 
I get the following:

REBFACE
>> stats

== 2085621
>> recycle
>> stats
== 1911437

REBVIEW
>> stats
== 6260880
>> recycle
>> stats

== 4810174


You can also create a custom RebGUI build that excludes widgets you 
don't intend using (see http://trac.geekisp.com/rebgui/browser/create-distribution.r
) which will save a few more bytes. Lastly, make sure your app does 
not use any unneeded images (e.g. a background image when a simple 
draw effect might suffice).


Even with these measures you'll only be left with about 3MB free 
... but 3MB is better than 1MB.
Pekr
16-Jun-2008
[7562]
Thanks Ashley, appreciated!
Pekr
18-Jun-2008
[7563x3]
What do I need to "include", when doing rebface + rebgui? rebface.exe 
tour.r does not work ...
LOL - RTFM :-) http://www.dobeash.com/RebGUI/cookbook.html#section-2
hmm, no luck with linux SDK, there is one workaround, which seems 
to prevent us from rebface usage :-(
Graham
21-Jun-2008
[7566]
What's the approved way of setting the focus so that the caret is 
at home?

set in area 'caret 1
set-focus/caret area 

??
Ashley
22-Jun-2008
[7567x2]
Pekr, try the following (after the do/#include of %rebgui.r):

	ctx-rebgui/layout [text "?"]
Graham, yes.
Pekr
23-Jun-2008
[7569]
so, after some testing, which I am confused a bit about, it seems 
that RebGUI is not all that memory savy. For simple hello world example 
based upon rebface, it consumed even more memory than VID.
BrianH
23-Jun-2008
[7570x3]
Is that also the case for rebface builds of RebGUI?
(sorry, missed it)
I'm not aware of any R2 GUI framework that is not a memory hog, but 
my standards are probably off.
Pekr
23-Jun-2008
[7573]
IIRC RebGUI was supposed to be more memory savy, which does not seem 
to be the case. What is also interesting is, that rebol 1.2.47 consumed 
less memory ...
Graham
24-Jun-2008
[7574]
I'm experimenting a little now, but with multiple resizable panels, 
I think it might be easier to generate layouts on the fly rather 
than keep a static layout that one updates various fields.
Robert
24-Jun-2008
[7575]
Petr, you will have a baseline memory consumption but it's not going 
up a lot. So make your app more complex ;-)
Graham
25-Jun-2008
[7576x3]
think this might be classed as a bug in the layout 


display "" compose [ button "testing" 15.1 button "again"] do-events

the first button does not display if there is a decimal size
Because Rebgui uses a  default pixel size that can be eg. 4, you 
can't easily get pixel precision in layouts.
correction .. the second button does not display
Pekr
25-Jun-2008
[7579]
Robert - there still has to be a leak in REBOL! Even if you try primitive 
hello world example, you start with 6MB of RAM, you do nothing, and 
after do-events it grows 3 - 4 MB, slowly, but constantly!
Ashley
25-Jun-2008
[7580]
Out of interest, the memory figures on OS/X using rebface are:

	rebface	1.8Mb
	VID		3.2Mb after loading %view.r
	RebGUI	3.5Mb after loading %rebgui.r


but these are for the respective defaults (VID apps often require 
additional patches/fixes and styles, RebGUI apps rarely use *all* 
the default widgets). I should also add that RebGUI (or indeed VID) 
have ever been fully profiled and optimized.
Pekr
25-Jun-2008
[7581]
So the correct route is to build custom rebgui.r, including only 
widgets I am using?
Graham
25-Jun-2008
[7582]
Is there a way we can "robustify" rebgui so that we trap all errors??

make object! [
   code: 312
   type: 'script
   id: 'cannot-use
   arg1: 'multiply
   arg2: 'decimal!
   arg3: none
   near: [freedom * face/data]
   where: 'wake-event
]
btiffin
25-Jun-2008
[7583x2]
Yep;
go: does [display ...]
while [[error? err: try [go]] [alert mold err  go]
Along those lines... I haven't got the code in front of me
[[ ]] should be [ ]  ... umm, mental methane
Graham
25-Jun-2008
[7585x2]
Hmm.. I already trap the errors ... I would much prefer that they 
didn't happen!
ie. they are trapped inside the rebgui code and dealt with there.
Graham
26-Jun-2008
[7587]
I've put a check in the engage event to see if face/data is none?, 
and if so, make it 0.  In case someone like me has set it directly 
to none ...
Graham
28-Jun-2008
[7588x2]
this is my new appointments display ... is there a way I can drag 
the buttons around? http://screencast.com/t/ou1MwDdS
so I can move an appt from one slot to another
[unknown: 5]
28-Jun-2008
[7590]
Looks good Graham.
Brock
28-Jun-2008
[7591]
Cyphre has a drag-panel style that allows drag and drop of various 
objects on a window.
Graham
28-Jun-2008
[7592]
Does it work with Rebgui?
Brock
29-Jun-2008
[7593]
I don't know.  I just remember he had the style.  Don't know how 
well it works as I've never used it, let alone with RebGUI
Graham
30-Jun-2008
[7594]
I've got some custom panels that I have a resizing routine written 
for them.  how do I trigger that to run when the main window resizes?
shadwolf
7-Jul-2008
[7595]
graham i like your app it's very beautyfull  ^^
Graham
7-Jul-2008
[7596]
Thanks shadwolf :)
Pekr
7-Jul-2008
[7597]
Graham - nice interface - what widget is used for the scheduler displaying 
time slots?
Graham
7-Jul-2008
[7598]
no widget .. it's all created on the fly