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

World: r3wp

[View] discuss view related issues

Maxim
24-Jun-2009
[8992]
yes biut then it redraws the gui so its really slow.


I finally cornered it unfortunately this is a work around to a bug, 
and it slows down the process.


basically, you need to set the old-offset so its totally beyond the 
size of your window at current offset, this way, the redraw func 
doesn't try to reuse the saved area (it should have to since its 
a window, and its offset isnt affecting the display).  the draw back 
is that it has to reblit all the window, but it still doesn't have 
to redraw it, so its still faster than not using changes at all, 
the bigger the more complex the window, the bigger the gain.  but 
large windows will be affected by the slowness of view blitting.
Henrik
8-Jul-2009
[8993]
I want to use parent-face correctly during INIT, instead of having 
it set during VIEW. I know that INIT is run during layout, but there 
may not be enough information available to correctly specify parent-face 
at that point. Has anyone worked on this?
Anton
8-Jul-2009
[8994x2]
My first retort is "of course there is!" (enough information for 
layout to set parent-face). Layout first makes the panel face it 
will return, referred to by 'new-face, near the beginning of its 
code body. It subsequently populates the pane of new-face with new 
subfaces built from the spec block. At this time, layout has the 
great opportunity to set parent-face for each one, but it doesn't. 
So, there exists the possibility for us to patch layout to do so.
The patch will be small, but of course, complicated to figure out.
Maxim
10-Jul-2009
[8996x2]
the parent-face is set on a call to show.  AFAIK.  the reason is 
simple, when you build your layout, you can potentially change the 
face you put the layout into before showing it.
you can include it within the with block facet if you know it at 
that time.  init is called after the layout is done (all calls to 
facet words and multi are done).
Henrik
10-Jul-2009
[8998]
I normally have a different solution for setting parent-face on any 
layout before SHOW, but it still happens some time after LAYOUT. 
I wanted it to be set earlier here, as an inspiration from VID3.4, 
where you can find a previous face during initialization, such as 
to attach a scroller to a panel without having the user needing to 
specify it directly in the layout.


I made some changes to LAYOUT, added a refinement to specify which 
parent-face exists for the pane. This is possible, because LAYOUT 
is not recursive and is called whenever one pane needs to be laid 
out. The idea was then to set parent-face before INIT.


This worked well for faces that are not at the base level for the 
window, but how do you specify the parent-face for base level faces, 
as the window face does not yet exist? I have dropped the idea again, 
because the solution is too convoluted. Besides it wouldn't be possible 
to attach to faces that come after the scroller, so you have exceptions, 
which is not good.


Scroller attachment now happens on first use of the scroller instead.
Maxim
10-Jul-2009
[8999x3]
glayout solves all of that  ;-) and its all running over VID and 
does very few hacks...
really, you should look into glayout, you are the kind of user which 
would "get" it very quickly and you'd be very happy about it.
your advanced styles work in glayout... I've converted the toolbar 
in 15 minutes last time I tried...
Henrik
10-Jul-2009
[9002]
I'll see what can be used, thanks.
Maxim
10-Jul-2009
[9003x2]
Glayout is a complete system though... its hard to take things out 
since its takes charge of VID and expects all of it to be there. 
 the layout depends on the api, which depends on the few patches, 
etc.
but it still use the normal VID stylesheet for example for changing 
your styles... I like to see it like an invisible drop-in for VId 
which replace the layout engine and adds A LOT of needed functionality.
Henrik
10-Jul-2009
[9005]
your glayout-demo.r in rebol.org has no author listed
Maxim
10-Jul-2009
[9006x2]
really? that is strange...
Glayout has been updated a few times... I really should update the 
version on rebol.org.   a few little layout tweaks and many new features 
added since that version...
Henrik
10-Jul-2009
[9008]
good idea. I have a hard time finding it via google.
Maxim
10-Jul-2009
[9009]
you have trouble finding glayout?
Anton
10-Jul-2009
[9010]
Henrik: "This worked well for faces that are not at the base level 
for the window, but how do you specify the parent-face for base level 
faces, as the window face does not yet exist?"

-- Yes it does. It is called new-face, and is created right near 
the top of layout, and returned (of course) at the bottom.
Maxim
10-Jul-2009
[9011]
but my current version has a display bug in the button looks when 
pressed... I keep changing the looks for every application, so it 
doesn't get fixed in the main lib.
Henrik
10-Jul-2009
[9012x2]
A quick search on "rebol glayout" reveals the rebol.org version, 
the docs for REBOL's own LAYOUT and some mailing list posts about 
glayout.
There is a single link to STEEL which gives me a 404.
Maxim
10-Jul-2009
[9014x6]
which is why it hasn't  been updated for a while.  the one on rebol.org 
is the last official release.
its just old, but works with the rebol demo, (also on rebol.org)
it works well, it just doesn't have some of the latest features and 
very specific layout fixes.
rebol demo
 I meant  "glayout demo"
if you download the glayout demo, it will download the glayout and 
slim, for you..
(when you run it, of course)
Henrik
10-Jul-2009
[9020x2]
Anton, I think I tried that, but that screws up other things: Parent-face 
in LAYOUT is set to none for some reason, and I'm betting it's because 
VIEW does something here. Anyhow, setting parent-face separately 
works perfectly, so I'm keeping that for a while.
Maxim, does glayout.r contain a complete style set or is it separate?
Maxim
10-Jul-2009
[9022x4]
it includes many of the basic VID styles as default...   near the 
end of the file, you will will see a big style block.  which basically 
adds the glayout framework on top of the previous master VID stylesheet.
it has group styles, including scrollpane which automatically adds 
V/H scrollbars for nested content.
you will be amazed at how similar it is to R3 view... (by what I 
have seen of it.)
if not in looks, in layout engine capabilities.
Anton
10-Jul-2009
[9026x2]
Henrik, oh well. But I figured out a clever hack you can place in 
init to set parent-face.
window: layout [my-face: box with [append init [parent-face: does 
[parent-face: does [get last second :layout] none] none]]]
my-face/parent-face = window ;== true
amacleod
10-Jul-2009
[9028]
maxim, Are you close to revealing your new website?
Henrik
11-Jul-2009
[9029x2]
Anton, it looks like I'll have to try setting parent-face again. 
I have another situation with the resize engine that really requires 
init to have parent-face set. Grr...
nope... no good. reverted to different strategy. it gives more overhead, 
but it will have to do.
Anton
11-Jul-2009
[9031]
Henrik, what strategy are you using?

I was thinking you could redefine layout, since you have collected 
a fair few GUI functions and styles together. When it comes down 
to it, it layout doesn't do what you want, redefine it. (And I am 
guilty of not doing this for so many years too.)
Henrik
11-Jul-2009
[9032]
Anton, I've not had the energy to take a look at what can be changed 
with LAYOUT, so what I do is try to stay within reasonable limits 
of what it can do and stay away from radical changes.


One thing to change, if it were, would be that INIT would be less 
limited, if it was run as a separate pass after initial layout instead 
of right when the face is created, but this may cause problems for 
styles that use INIT to alter the size and offset for the face, as 
well as produce subfaces that need to be initialized first. Also 
LAYOUT is not recursive and INIT may be run at very different times. 
At this time, INIT is limited, but you have a pretty good idea of 
when it's run.


In VID3.4 this is not a problem, since there is both an init and 
post-init action possible, so if I were to get rid of this problem 
in the right way, I might end up rewriting over 100 kb of well-functioning 
code.
Anton
12-Jul-2009
[9033x2]
Hmm.. well why not add a post-init to layout ? This would not affect 
any existing code, so you could migrate to it at your leisure.
(Why don't I add it myself ? Well, I might just do that.)
Henrik
12-Jul-2009
[9035]
well why not add a post-init to layout

 you can't add it to layout. it has to be done after all layout is 
 done.
Anton
12-Jul-2009
[9036]
Ah.. I'll have to think about that.
Maxim
15-Jul-2009
[9037]
amacleod: unfortunately life has been throwing fast balls at me for 
the last several weeks ... things like recurring water problems on 
my home, making all of my life really complicated and time consuming. 
 

I also tried something with remark which hasn't lead to useable code 
yet... so I am about backtrack to earlier versions and use that while 
I work on the next generation stuff.  


the next gen stuff is closer to Research than Development than I 
had predicted.  I thought it was much easier to leverage the technology 
within the web site/page cycle... but efficiency and elegence principles 
(in form and function) are hard to get right when merging persistent 
and volatile systems.
amacleod
15-Jul-2009
[9038]
That seems to be the way of software dev..


I've been two weeks away from release of my project for about 5 months 
now...
Anton
25-Jul-2009
[9039]
I got this working this last night. Modeled somewhat on Openoffice 
Writer / Insert Special Character dialog.
do http://anton.wildit.net.au/rebol/util/character-map.r
Henrik
25-Jul-2009
[9040]
Pretty good. :-)
Graham
26-Jul-2009
[9041]
Has anyone written a tree based object browser ?  Anamonitor is the 
only object browser I know of ...