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
1-May-2006
[3511x2]
oh .. well, I just wasn't sure about the licensing for prerebol and 
whether it had to be downloaded from rebol.com
or was freely redistributable
Robert
1-May-2006
[3513x2]
If there is a licensing issue, let's ask Carl.
But IIRC it's included in rebol.org as well?
Graham
1-May-2006
[3515]
not the latest
Ashley
1-May-2006
[3516]
I'd rather, as mentioned before, extract the bits needed (#include 
processing) from prebol.r and prerebol.r into the one script. No 
licencing issues and only a single script to maintain.
Robert
1-May-2006
[3517]
Good idea.
Anton
1-May-2006
[3518]
I was thinking that, too. Probably your include needs are not complex.
Graham
2-May-2006
[3519x3]
In reverting these changes to area, I came across this problem
** Script Error: sizes has no value
** Where: context
** Near: margin: as-pair sizes/slider + 2
I guess I must be mix and matching from different versions of rebgui 
...
Anton
2-May-2006
[3522]
How is that possible ? I've just gone into the SVN repository directory 
with rebol and typed:
	do %rebgui-ctx.r
	display "" [area]
Graham
2-May-2006
[3523x3]
I think I am using an older version of rebgui ...
not the one from the svn.
So, I need now to track down the older source for the area widget
Anton
2-May-2006
[3526]
Use SVN, then you can see the changes. Or are you locked to an older 
version ?
Graham
2-May-2006
[3527x4]
I'm sortof locked into an older version as I put some changes in 
to it .. more error trapping, extra fields in widgets etc.  I guess 
I'll have bit the bullet.
I updated my version to latest, ran the create-distribution script, 
and then tour.r
Script: "RebGUI widget tour" (30-Apr-2006)
** Script Error: unit-size has no value
** Where: init
** Near: as-pair unit-size * 1.5 unit-size
anyone got a checked version working with tour.r?
Ashley
2-May-2006
[3531]
Works for me, I think its your version of tour.r that's the problem 
(should be 0.4.2).
Graham
2-May-2006
[3532x10]
Yes, you were corrrect Ashley.
Would you check in a version of Tour.r into the SVN ( and the images 
as well ) ?
When trying to set the value of a radio group, I usually got an error 
about pf being none
so, I had this in my radio-group definition
down [
								pf: face/parent-face
								either all [ found? pf pf/data <> face/data ][
									;	deflag old
									old: pf/data
									if old [
										clear skip pf/pane/:old/effect/draw 7
										show pf/pane/:old
									]
									;	flag new
									pf/data: face/data

         insert tail face/effect/draw compose [pen (colors/true) fill-pen 
         (colors/true) circle (as-pair sizes/cell * 1.5 sizes/cell * 2.5) 
         (sizes/cell - 1)]
									show face
									pf/action pf
								][ ;; GC

          insert tail face/effect/draw [pen leaf fill-pen leaf circle (as-pair 
          sizes/cell * 1.5 sizes/cell * 2.5) (sizes/cell * 1.5)]
										show face
										face/action face
								]
I didn't make any notes, but it checks to see if pf is none or not, 
and if none, does the alternate action.
I didn't see a way of creating layouts with no borders, so, in rebgui-display.r, 
line 50, I added this to the list of refinements
/options

 opts [block!]	"Window options [no-title no-border resize] (must be: 
 block word)"
and at line 112, changed the block to read
either dialog [
		unless no-hide [
			hide-popup ; workaround until /away and parent options work
		]
		show-popup view-face
	][
		either options [
			view/new/options view-face opts
		][
			view/new view-face
		]
	]
Robert
2-May-2006
[3542]
Did you uploaded those patches as well?
Graham
2-May-2006
[3543x2]
No, I haven't sought an account.
I'd rather people vet my code first .. I'm just not too familiar 
with the rebgui internals.
Henrik
2-May-2006
[3545]
does rebgui have a toolbar widget?
Graham
2-May-2006
[3546]
There is one in the tour.r so I guess so.
Henrik
2-May-2006
[3547]
ok
Graham
2-May-2006
[3548]
How would one provide function keys that are globally accessible? 
 I want to make F1 a help key that is context sensitive ( sensitive 
to which pane has focus etc )
Anton
3-May-2006
[3549x3]
In VID you would just assign a key to the window face:
view layout [key #"^t" [print system/view/focal-face/var] my-field: 
field do [focus my-field] fld2: field]
(with some difficulty getting F1 to work maybe)
Graham
3-May-2006
[3552]
Does anyone use function keys in their applications these days?
Anton
3-May-2006
[3553]
My apps are generally small, and I consider function keys as an optimization, 
which means my apps usually reach a usable state before I get round 
to adding function keys, and so I never get round to adding them. 
:) I have one or two apps which use them, I think.
Graham
3-May-2006
[3554]
If Ashley couple pipe in here as to how this might be done, that 
would be appreciated.
Anton
3-May-2006
[3555x5]
Well, the event arrives first in the window feel, so look in there:
>> win: display "" [] ; now press escape
>> probe win/feel
make object! [
    redraw: none
    detect: func [face event][
        switch event/type [
            key [edit/process-keystroke face event]
            move [mouse-offset: event/offset] ...

hence
>> probe get in ctx-rebgui/edit 'process-keystroke
So, the bottom of process-keystroke handles all other keys than tab 
or space, and it looks in the keycodes facet of the window to cause 
an action.
This is a bit hacky but it works:
win: display "" [text "hello" #"t" [print "hi"]]   win/keycodes/1: 
'f1   do-events
display is obviously creating the keycodes block (of key face pairs), 
so I've just changed the first character #"t" into 'f1 and it magically 
works.
Graham
3-May-2006
[3560]
Hey, that's great.