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

World: r3wp

[!RebGUI] A lightweight alternative to VID

MaxV
27-Aug-2010
[8766x2]
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
Ashley
14-Sep-2010
[8798]
That's all VID-specific, NA for RebGUI.
Graham
14-Sep-2010
[8799x2]
Ashley, given that the last code changes to RebGUi were a year ago 
.. waiting for R3GUI to appear, do you still feel that there is no 
point in improving/fixing RebGUI?
Even if we get a stable R3GUI in the next year, people won't stop 
overnight using R2
Ashley
14-Sep-2010
[8801]
It's even worse than that, the true "cut-over" for many won't occur 
until we have a stable R3 SDK! ;)


Having 2 versions of RebGUI (b117 and b218) that are each 95% done, 
but each with their own bugs and quirks is not an ideal situation 
... so I'm [again] looking to complete the 2.x series and finally 
obsolete b117 ... but R3, as always, is so close ...
Graham
14-Sep-2010
[8802x2]
I think R3GUi is not really relevant to the development of RebGUi 
...
Although not vapourware,  R3 has had a deleterious effect on R2 3rd 
party support
Ashley
14-Sep-2010
[8804x2]
re: button colors. A QAD fix for b117 follows:


Edit rebgui.r and make the following changes to the button widget 
starting on line 1260:

	- Add a new attribute ... old-color: none
	- Add the following to the init function ... old-color: color

 - Change color references ... replace "colors/theme-dark" with "face/old-color" 
 (leave the "color = colors/theme-dark" ref though)
has had a deleterious effect on R2 3rd party support

 ... agree, no-one wants to invest time into something that could 
 be obsolete at any time. If I 100% knew that we wouldn't have a stable 
 R3 SDK (for Mac, WIndows and Linux) for n months then I could make 
 a rational investment of time ...
MaxV
15-Sep-2010
[8806]
My question is: where is the font problem in RebGUi on Linux?
Ashley
16-Sep-2010
[8807]
And my answer is it's not a RebGUI problem. Try the following code 
on 2.7.7.3.1 (Windows):

	view center-face make face [effect: [draw [text "xxx"]]]


You should see 3 black x's in the top left corner of a new window. 
Now try this on 2.7.7.2.5 (Mac) ... a blank window appears. I suspect 
the same thing happens on Linux. This is not a dialect problem (VID 
or RebGUI) but an issue with REBOL/View AGG font support on non-windows 
platforms.

Also note that while the following works on Windows:


 view center-face make face compose/deep [effect: [draw [font (make 
 face/font [name: "Verdana" size: 18]) text "xxx"]]]


path-qualifying the font name on Mac (and I suspect Linux) still 
does not work:


 view center-face make face compose/deep [effect: [draw [font (make 
 face/font [name: "/Library/Fonts/Verdana" size: 18]) text "xxx"]]]
Maxim
16-Sep-2010
[8808x2]
don't you need to give a file! type for path qualification?
(I can't test it)
Ashley
16-Sep-2010
[8810]
string! only ... http://www.rebol.com/docs/view-face-content.html#section-3
Maxim
16-Sep-2010
[8811x2]
did you try adding the file extension to the path qualification on 
osx/linux?
(maybe it doesn't have one and I'm just being annoying  ;-)
Ashley
16-Sep-2010
[8813]
Yep, tried that (the 2nd example above should read "/Library/Fonts/Verdana.ttf").
Graham
16-Sep-2010
[8814x2]
Hmm... I don't recall having font issues with draw on Linux
MaxV, does this work for you ?  http://www.compkarori.com/vanilla/display/AGG