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

World: r3wp

[View] discuss view related issues

Anton
12-Jul-2009
[9034]
(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 ...
Henrik
26-Jul-2009
[9042x2]
I was actually thinking about writing an object browser, but not 
directly a tree-based one.
is there a way around having to focus a face in order to use the 
scroll wheel above it?
Anton
26-Jul-2009
[9044x5]
Graham, a generic object browser should not be limited to hierarchic 
tree structure. Will you have any circular references?
Henrik, scroll-wheel: yes there is. See my scroll-wheel-handler:

do http://anton.wildit.net.au/rebol/gui/demo-scroll-wheel-handler.r
Basically, I make an event handling function, called 'scroll-wheel-handler, 
open a window, then

	insert-event-func :scroll-wheel-handler
	do-events
	remove-event-func :scroll-wheel-handler
The event handler captures scroll-wheel events, looks where the mouse 
is, finds the face which it is over (a recursive function), determines 
if it is scrollable, and sends the scroll-wheel events to the that 
face's engage, just as if it had been focused.
(Complicated, huh? But I'm proud.)
Henrik
26-Jul-2009
[9049]
Thanks
Gregg
26-Jul-2009
[9050]
Graham, I worked on one a long time ago, with Ammon Johnson. We did 
it like Smalltalk, or the OS X Finder, rather than a tree.
Graham
26-Jul-2009
[9051x3]
Gregg .. was it ever published?
Anton .. no circular references
Basically these are XML files that are being turned into Rebol objects 
that I wish to browse.
Gregg
26-Jul-2009
[9054]
I think we put it out on one of the IOS servers, Developer maybe, 
but not sure where else.  

I can dust it off and send it to you if you want.
Graham
26-Jul-2009
[9055]
Sure ... or post it to rebol.org ?
Anton
27-Jul-2009
[9056x2]
I made something quite similar recently; an expanding/collapsing 
dir-tree viewer, like the dir panel of a file browser. Each directory/file 
has to be an object, because I store some state along with it, like 
collapsed/expanded, and other interesting attributes can be stored 
in there in future, when I get around to collecting the info. The 
purpose of the app is basically to create an image of a directory 
structure, which can be saved to disk, viewed magnified etc. to give 
an overview of directory structure.
I'll clean it up to publish later.
Graham
27-Jul-2009
[9058]
So, you modify the object you're viewing to keep states?
Anton
27-Jul-2009
[9059x6]
No, as I scan the filesystem, I build the dir/file structure and 
an "associated info" object alongside each one, so it looks like 
this:


 dir-attrs: context [...]  ; <-- All associated directory info goes 
 here.

 file-attrs: context [...] ; <-- All associated file info goes here.
	file-structure: [
		(make dir-attrs [...]) %subdir/ [
			(make file-attrs [...]) %bfile
			(make file-attrs [...]) %cfile
		]
		(make file-attrs [...]) %afile
	]
So we can see the top level has one subdirectory and one file, and 
the subdirectory contains two more files.
I store info in the dir-attrs and file-attrs objects like collapse/expanded.
Actually, I think the real answer to your question is "yes", because 
I build a block/object structure, and I modify parts of it (the objects) 
to manage my additional states.
I think what you have in your situation, with objects built from 
XML, is different than mine. I take advantage of being able to use 
blocks in my structure which allows me to insert my additional associated 
info. With your object hierarchy, it's problematic to add your own 
extra fields for state because the XML, of course, might already 
have those field names as part of its data, so there's possibility 
for collision there.

However, (as I see in my notes,) I was strongly considering for my 
purposes a structure like this:
		file-structure: [
			%OHS/ [
				%adir/ [
				]
				%afile
			]
		]
		associated-file-info: [
			%OHS/ make object! [...]
			%OHS/adir/ make object! [...]
			%OHS/afile make object! [...]
		]
(with duplication of all the paths as a negative consequence), but 
this idea could work better with XML objects.
Henrik
27-Jul-2009
[9065]
Anton, have you studied what POP-DETECT in SYSTEM/VIEW/WAKE-EVENT 
is about? The function for it exists in SYSTEM/VIEW/POP-FACE/FEEL. 
To me it looks like a workaround to get DETECT to work in INFORMs.
Henrik
29-Jul-2009
[9066]
Maybe I've had too little coffee, but I can't figure out why no text 
is displayed here:

view center-face make face [text: "test"]

but 'size-text returns 22x15
Gabriele
29-Jul-2009
[9067]
the top level face is the window face. text is for the window title.
Henrik
29-Jul-2009
[9068]
ah, that's right. I wonder then if that's what is causing problems 
with SIZE-TEXT for a specific face I'm making. SIZE-TEXT consistently 
returns pixel sizes that only fit if the font size is around 10 or 
11.
Henrik
2-Aug-2009
[9069]
where exactly are iterated faces evaluated? is that internal in view?
Dockimbel
2-Aug-2009
[9070]
AFAIK, it's internal in View.
Henrik
2-Aug-2009
[9071]
Thanks
Henrik
3-Aug-2009
[9072]
When reading through the View Reference, it's not clear what happens, 
when you return an integer from the iteration function. I can see 
the iteration function is run again with that value as input, but 
I can't tell where it's run. I had hoped to redraw single lines in 
a list with a simple mouse over, but I guess you need to do something 
unknown to provoke the redraw.
Using SHOW in the function causes an infinite loop.
Anton
4-Aug-2009
[9073x2]
The answer to all these kinds of questions/problems with iterated 
pane functions, I, and beforehand others like Romano and Gabriele, 
discovered, after much investigation, is not to use a pane function 
at all, but instead, make real faces in your window and manage them 
yourself. It turns out to be simpler and easier to code, and with 
events, it is more powerful, reliable and has fewer limitations etc.
So... the pane function may be interesting to investigate, but you 
may also just waste a lot of your time.
Henrik
4-Aug-2009
[9075x2]
Anton, yeah, I might drop it, although I figured out a solution to 
that problem there are many other problems. However right now I'm 
investigating SHOW-POPUP and HIDE-POPUP, trying to see if I can control 
many popups for a menu system.
trying to figure out now when exactly it is that View displays a 
button for the window in the task bar and when it doesn't.
BenBran
5-Aug-2009
[9077]
I purchased the Rebol-Command and am trying to integrate it with 
my existing work.  The 'Local' folder is pointing to 'c:\documents 
and settings\blah\blah....   My old version was pointing to c:\rebol\local 
 thats where I want it to point.  Is there a way to force it there? 
 TIA
Anton
5-Aug-2009
[9078]
Analyse:
Put this in your  user.r  file:

	print ["system/options/home:" mold system/options/home]

A probable fix for you (insert into user.r):

	system/options/home: %/c/rebol/
BenBran
5-Aug-2009
[9079]
Thank you.  After a rest and some more digging I found a few ways 
to fix.  The most obvious - which I overlooked - was a prompt during 
the installation.   I like everything in one root folder.  Much easier 
to sync between home/work/laptop etc.  Just to be extra safe, I added 
the code you proposed.  Thanks again.
Anton
6-Aug-2009
[9080]
Actually, I only set system/options/home in my user.r because I'm 
on linux which doesn't have a registry.

On Windows, you can find the registry key which sets system/options/home 
by searching for "rebol" in the registry. (I don't remember what 
it is exactly, but it's easy to find.)
BenBran
7-Aug-2009
[9081]
Finally found it.  For anyone else that would like to know where 
this key is located:  It  is HKEY_CURRENT_USER / SOFTWARE / REBOL 
/ VIEW / SANDBOX   There are two keys 'Home' and 'Sandbox'  I found 
for now the best setting for my environment is to set them both to 
C:\rebol\bin

I think that forces everything to run out of the bin and lower directories. 
 The 'home' key I believe tells rebol where to find the 'desktop' 
parameters.
Pekr
21-Aug-2009
[9082]
Is there an easy way of how to resize an image? I tried:

i1: load %my-img.png
i2: make image! 82x63 i1

but the image is black :-)
Henrik
21-Aug-2009
[9083]
DRAW or use effect [fit] in view