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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Graham
16-Aug-2010
[8748x3]
In 117, you can't seem to tab into a table eg.
 

 display "" [ field field table options ["column" left 1.] data [ 
 "ab" "cd" ]] do-events


but you can in the svn version .. what change has to be made to allow 
this?
set-focus is different ...
ok, include table into the tabbed block and use the set-focus from 
the svn works so far
RickH
21-Aug-2010
[8751]
Hi, 


Am just moving over here from TCL-land and would like to try RebGUI. 
However, there seems to be two versions: one downloadable from the 
Dobeash site (rel #117) and on resident in SVN (#218).


Which is the one with which to go; and if the version on SVN, what 
is the method to down load an use?

Any assistance would be appreciated.

Rick
Graham
21-Aug-2010
[8752x2]
Don't use 118 .. the only one working is 117
The SVN version is incomplete and was a rewrite which was not finished
RickH
21-Aug-2010
[8754]
thanks, again.
Gregg
21-Aug-2010
[8755x2]
And of course, VID is still valid as well.
VID is the native REBOL GUI dialect. If you're just getting started, 
and doing basic UIs, it's worth a look.
Graham
22-Aug-2010
[8757x2]
I've posted my lookup-field as per my video here 

http://rebol.wik.is/RebGUI/Lookup-field


It uses a lot of code from the edit-list which I don't quite grok! 
 So, there's a bug which requires you to initialize the field with 
a backspace first.
So, I can feed this widget 18,000 entries which I don't think you 
can with the edit-list.
MaxV
26-Aug-2010
[8759]
Hello everybody, I have a problem with Linux:  DRAW   choose a font 
that give problem displaying:

example: ['text "Hello word!"]
view layout [ box 100x100 effect [draw example ]]

on linux it gives a blank window.
I added:

example: ['text "Hello word!"]
if (pick system/version 4) = 4 [
	fnt1: make face/font [ 
		name: "/usr/share/fonts/truetype/freefont/FreeSans.ttf"
		size: 12
		]
	os: "linux"
	]
if os = "linux" [ insert example reduce ['font fnt1]	]
view layout [ box 100x100 effect [draw example ]]

This solution is good, but using REBGUI  it doesn't work anymore.
What can I do?
Ladislav
26-Aug-2010
[8760x3]
Actually, this group is inappropriate, you should use View, or Linux
(I suppose that you are mistaking VID and RebGUI)
aha, sorry, I did not find out you actually used RebGUI, sorry
Ashley
26-Aug-2010
[8763]
Max, fonts should work the same between View, VID and RebGUI. Please 
provide a small snippet of RebGUI code that demonstrates the problem.
MaxV
27-Aug-2010
[8764x4]
Ok
do %rebgui.r
example: ['text "Hello word!"]
display "Example" [
	aaa_stats: box 50x50 effect [  draw example ]
	]
do-events
It doesn't display anything.
Do you know a solution?
Graham
27-Aug-2010
[8768x3]
On windows you get a nearly invisible "hello world"
but your problem is linux isn't it?
example: [pen black text "Hello word!"]
display "Example" [
	aaa_stats: box 50x50 effect [  draw example ]
	]
do-events
Anton
27-Aug-2010
[8771]
No, he solved the problem with Linux by providing an absolute filepath 
to the font.

The problem is trying to use VID's LAYOUT (and maybe also VID's VIEW) 
after initialising RebGUI.

If I remember correctly, RebGUI unsets 'LAYOUT, or redefines it for 
its own use. So it won't work anymore as you expect with VID.
MaxV
27-Aug-2010
[8772]
Exactly, any suggestion?
Anton
27-Aug-2010
[8773x2]
Well, it's not going to be easy to mix them. Ashley made the decision 
early in RebGUI development to specifically unset (the majority of?) 
the built-in VID functions. I think primarily to reclaim memory use, 
but maybe also to avoid mixing code. (I didn't really like this decision, 
myself.)
You could probably modify the RebGUI sources so it doesn't do that, 
or ~maybe~ redefine the VID functions yourself (I think more challenging). 
Every time there is a RebGUI update, you'd have to remodify the RebGUI 
sources, so I wouldn't be inclined to do that myself. It depends 
how badly you want them to coexist.
NickA
27-Aug-2010
[8775x3]
You can use VID styles with the 'style word:
rebol []
do %rg
example: "Hello world!"
display "Example" [
    style 20x20 data [
        box blue example
    ] 
]
do-events
rebol []
do %rebgui.r
example: [pen black text "Hello word!"]
display "Example" [
    style 20x20 data [
        box blue effect [draw example]
    ] 
]
do-events
Ashley
27-Aug-2010
[8778]
RebGUI (b117 and later) does *not* redefine layout. It does however 
redefine alert, confirm and many of the request-* functions.

The fact that starting a fresh console session and entering:


 view layout [box black 100x100 effect [draw [pen white text "Hello"]]]


no longer works on the linux and Mac ports of REBOL is I believe 
a REBOL/VIew bug (despite a workaround that may work for VID but 
not RebGUI).
Graham
27-Aug-2010
[8779x2]
It's a bug in that the font directories are unknown in linux
so it should work in rebgui as well as the draw dialect is unchanged 
in rebgui
Anton
28-Aug-2010
[8781]
Oops, sorry Ashley, I was wrong about RebGUI unsetting LAYOUT. (It's 
been a long time since I tried RebGUI.)

MaxV, tell us the rebol version you are using (system/version) and 
the RebGUI version.
Show us the full code which does not work with RebGUI.

I noticed your second example (using RebGUI) did not include the 
code which sets the font path.
Just to be sure, can you confirm you tried it together?
shadwolf
28-Aug-2010
[8782]
nickA didn't provided a font information in his draw block plus he 
didn't gived a different color... plus R2 VID sux with fonts and 
specially under linux.
MaxV
30-Aug-2010
[8783x3]
I tried Nick code, but I obtain 
** Script Error: style has no value
All my code is:
Rebol []
do %rebgui.r
fnt1: make face/font [ 
		name: "/usr/share/fonts/truetype/freefont/FreeSans.ttf"
		size: 12
		]
example: ['text "Hello word!"]
insert example ( reduce ['font fnt1 ])
display "Example" [
	aaa_stats: box 50x50 effect [  draw example ]
	]
do-events
REBOL/View 2.7.7.4.3 5-Jan-2010


Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 
UTC 2010 i686 GNU/Linux
NickA
4-Sep-2010
[8786]
I haven't tried loading fonts in draw on Linux, but the rest of this 
works (the color is changed by the draw command "pen red"):

Rebol []
do %rebgui.r
font1: make face/font [
    ; name: "/usr/share/fonts/truetype/freefont/FreeSans.ttf"
    size: 11
    style: [italic bold]
]
example: compose [
    font (font1)
    pen red
    text "Hello World!"
]
display "Example" [
    style 20x20 data [
        box snow 100x100 effect [
            draw example
        ] 
    ]
]
do-events
MaxV
6-Sep-2010
[8787]
** Script Error: style has no value
** Where: layout
** Near: style 20x20 data [
    box snow 100x100 effect [
        draw example
    ]
]
NickA
7-Sep-2010
[8788]
MaxV,  this works perfectly for me on Ubuntu 10.04.1, using your 
rebol.deb installer - I ran Ubuntu directly from the CD created using 
the most recent Ubuntu download, installed REBOL using your Ubuntu 
package, and ran this script.  Perhaps your version of RebGUI is 
different than mine?  This version loads rebgui.r from an http:// 
link:

rebol []
do http://re-bol.com/rebgui.r
font1: make face/font [
    name: "/usr/share/fonts/truetype/freefont/FreeSans.ttf"
    size: 11
    style: [italic bold]
]
example: compose [
    font (font1)
    pen red
    text "Hello World!"
]
display "Example" [
    style 20x20 data [
        box snow 100x100 effect [
            draw example
        ] 
    ]
]
do-events
quit
MaxV
10-Sep-2010
[8789x3]
YES! It's the Rebgui version that is different.
I use Version 218
You use version 117
NickA
10-Sep-2010
[8792]
117 is the latest stable version
MaxV
13-Sep-2010
[8793]
Well, 117 has some bugs that 218 hasn't. For example colored buttons 
turn grey after passing over them.
Graham
13-Sep-2010
[8794]
and don't change back?
MaxV
14-Sep-2010
[8795]
NO! :-(
Maxim
14-Sep-2010
[8796x2]
note that some view faces support the face/colorS which is a block 
with two colors.


if you only set the face/color, when ever a feel looks up the colors 
block, it will effectively overwrite the color... try it for your 
specific case (I don't use rebgui, so I can't test)
same for face/texts, face/fonts, face/images