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

World: r3wp

[!REBOL3 GUI]

Nicolas
16-Jan-2011
[5255]
Content isn't bad, but I think local is more descriptive.

http://www.rebol.com/r3/docs/gui/styles.html#section-19

The faced block is similar to facets block, but makes them local 
to each instance of the face. Now, they can be modified without effecting 
any other faces that are of the same circle style.
Nicolas
17-Jan-2011
[5256x2]
Faced is awful. Content has the same meaning and is less jargony. 
Maybe it's better.
I meant that content has the same meaning as local.
Henrik
17-Jan-2011
[5258]
FACED is supposed to be long gone. Maybe that's not the case for 
the current release?
Pekr
17-Jan-2011
[5259x2]
I think that in the new release FACED is really gone. Nicolas points 
to RT's docs, which imo refer to Carl's GUI, not RMA's one.
Hmm, so I did some tests, and here's my observation:


- I still have to complain, that in order to MAKE PANEL, I have to 
use function MAKE FACE, even if function of corresponding name exists, 
and was made useless for such purpose :-( Easy things SHOULD be easy 
to do


- The suggested code of pan: make-face 'hpanel [columns: 1] is self-explanatory, 
but then SWITCH-PANEL function does not work. And the possibilities 
are:
                     - this function is obsolete
                     - this function was not adapted to new stuff

                     - make-face does not create sufficient/expected output


The problem is in the following code - I have two panels - m = main, 
p = child:


view [m: hpanel [text "test"] options [init-size: 200x200] button 
"switch" do [switch-panel m p 'fly-right]] 

p: make-face 'hpanel [columns: 1]
insert-panel-content p [button "hello"]
view p ;- check it ....

It crashes on switch-panel, because:

>> p/gob/offset
== 571x384

>> margin: get-facet m 'margin
== [0x0 0x0]

>> p/gob/offset: get-facet m 'margin
** Script error: cannot set offset in path p/gob/offset:


So - does make-face create incompatible structure? Is 'switch-panel 
supposed to work? And if not, how do I support those fly effect for 
switching panels? Just don't push me to manually use insert-panel-content 
and tonnes of similar functions?
Ladislav
17-Jan-2011
[5261x2]
SWITCH-PANEL is not supposed to work, since it was not adapted yet, 
not having high enough priority.
(in the above example you see, that the margin uses two pairs, while 
gob/offset is just one)
Pekr
17-Jan-2011
[5263x5]
I know, I thought I would adapt switch-panel, but dunno if it would 
be usefull.
I would also like to understand your working plan - why are some 
usefull features removed at all? I can understand, that if things 
break, you set some priority to fix them, or not. But both make-panel 
and switch-panel just worked, whereas now they are replaced but tonnes 
maybe fine-grained functions = better flexibility, but also removing 
visual effects.


I still hope, that having switch-panel is possible, using new *-panel-content 
functions, and that transition effects are still possible ....
Once again - simple things should be simple to do, and simple even 
in my code - when I make-panel, I make panel, not a face. When I 
switch-panels, I just switch panels, so no need for user to care 
about panel content handling funcitons imo ....
OK, I will adapt ... the intention is to make demo working on RMA's 
GUI. We will see, how it turns out down the road ... I am slow, because 
I still have little knowledge of GUI itself, pluse I am really not 
a programmer :-)
... but -better to do something, than nothing ...
Henrik
17-Jan-2011
[5268]
it's possible that you have to use different methods than what Carl 
used. many functions were dismantled and rebuilt to support higher 
granularity and this process is not entirely complete yet. in the 
end, it should be just about as easy to build the demo using RM Asset's 
version as well as Carls, except for more solid behavior.
Pekr
17-Jan-2011
[5269]
Yes, it is just my general opinion is, that higher modularity could 
be hidden from user, if possible. But as I said - I now have an idea, 
that something like switch-panels should be rather easy to be rewritten 
using new functions ... I got simply confused, as I found the switch-panel 
function in the distro, so I assumed it should work. Now I will be 
more carefull ...
Henrik
17-Jan-2011
[5270]
transition effects: that may have to wait as animation is low priority, 
but when it becomes possible, you may well have much better options 
for doing real animation.
Pekr
17-Jan-2011
[5271x3]
OK
Should text style work?

text [bold "Toggle button..."] gives me:


Script: "R3 GUI - Development Test Script" Version: 0.1.2 Date: none

** User error: {TO-TEXT - syntax error at: [bold "Toggle button..."] 
...}
Got to go - but - is there anything like vpanl alignment? I got first 
form of demo kind of working (buttons), but the content is aligned 
to the bottom. Also - pressing buttons does not work so far either:


** GUI ERROR: Cannot parse the GUI dialect at: panel 240.100.80 title 
Alert grou
p doc Button pressed! scroller
Ladislav
17-Jan-2011
[5274x2]
But both make-panel and switch-panel just worked, whereas now they 
are replaced but tonnes maybe fine-grained functions = better flexibility, 
but also removing visual effects.

 - are you not able to read? SWITCH-PANEL is not replaced by anything
Carl's comment after a "preliminary peek": "It seems that the design 
is going well, and this team is very REBOLish in their methods and 
concepts.  So, I am not worried."
Pekr
17-Jan-2011
[5276x2]
preliminary peak
 = Carl did some recent revision? :-)
If so, good he is catching-up back to R3 stuff!
Kaj
17-Jan-2011
[5278]
He also reviewed CureCode
Pekr
17-Jan-2011
[5279]
I am still probably not understanding, how to properly use panel-content 
functions. Second consecutive run of following code causes a stack 
overflow ...

lay: [button "OK"]

child: make-face 'vpanel [columns: 1]
set-panel-content child lay
view child
Ladislav
17-Jan-2011
[5280x3]
how exactly am I supposed to reproduce it?
Err, that [columns: 1] is an anachronism, we replaced it by [break-after: 
1] (for a hpanel, break-after specifies, how long the rows are, while 
for a vpanel, how long the columns are)
so, the [columns: 1] is ignored
Pekr
18-Jan-2011
[5283x6]
Ladisla - thank, that was it. I mean - break-after fixed it.  With 
above - columns, to simply reproduce it, just view child, close the 
window, and call view child once again ... it breaks to console after 
a while with stack overflow. Well, now I know that 'columns is not 
used anymore, but you might try to look at it, if you have time, 
to see why it causes stack overflow ...
Hmm, nothing seems to be fixed ...
Could you try following code? You can eventually replace 'vpanel 
by 'hpanel [break-after: 1]. With vpanel, it just causes stack overflow, 
with hpanel, it kind of displays panel, but try to resize the window 
and see the mes ...


REBOL []

do %r3-gui.r3

lay: [

		when [load] do [print "Load trigger!"]
		clicker
		button "Do" alert "Button pressed!"

  button "Big Quit Button" maroon options [max-size: 2000x50] quit
		bar
		text "Toggle button..."
		t1: toggle "Toggle" of 'tog
		button "Set False" set 't1 false
		button "Set True"  set 't1 true
		toggle "Mirror" attach 't1
		toggle "Mutex" of 'tog
		bar
		text "Radios and check boxes"
		radio "Set above toggle on"  set 't1 true
		radio "Set above toggle off" set 't1 false
		bar
		check "Checkbox attached to above toggle" attach 't1


]

child: make-face 'vpanel []
set-panel-content child lay
view child
Well, I stop my tries to port a demo now. My take is, that following 
primitive code should work easily, when repeated for the second time, 
but it does not:

lay: [button "OK"]

child: make-face 'hpanel [break-after: 1]
set-panel-content/no-show child lay
view child


My take is, that either make-face is not creating a structure needed 
later, or 'parse-panel is buggy, or I don't know what :-)

** Internal error: stack overflow

** Where: reduce switch parse to-text reduce parse to-draw all update-subgobs 
fo

reach update-subgobs show-native show-native show-native show-native 
show-native

 show-native show-native show-native show-native show-native show-native 
 show-na

tive show-native show-native show-native show-native show-native 
show-native sho

w-native show-native show-native show-native show-native show-native 
show-native

 show-native show-native show-native show-native show-native show-native 
 show-na

tive show-native show-native show-native show-native show-native 
show-native sho
w-native show-native show-native show-native s...
eh, excuse me, couldn't following code be causing an infinite loop? 
:-)

show-native: :show
show: funct [gob][
;	print "SHOW>>>>"
;	set 'gcnt 0
;	t: now/time/precise
	update-subgobs gob
;	print ["updated:" gcnt "GOB(s) in " now/time/precise - t]
;	t: now/time/precise
	show-native gob	
;	print [now/time/precise "SHOW call in" now/time/precise - t]
;	gob
]
The only place show-native is called separately from is - 'hide-tooltip 
...
Ladislav
18-Jan-2011
[5289x3]
who wrote the above SHOW function?
(I was unable to reproduce the stack overflow)
I was able to not only repeat the VIEW CHILD twice, but even ten 
times without any stack overflow
Pekr
18-Jan-2011
[5292x2]
I don't know, it is taken from your latest build?
I just hope I don't have mess on my HD :-(, I have several versions 
here to study, even Carl's one ...
Ladislav
18-Jan-2011
[5294]
I am certainly not using that one here, will have to discuss it with 
Cyphre
Pekr
18-Jan-2011
[5295x3]
it's taken from the source/view-show.r3
I am just wondering - it will cause a stack overflow at each show 
call. I wonder - show is not called the first time? How is that it 
crashes the second time?
I will unpack the sources again ...
Ladislav
18-Jan-2011
[5298]
aha, sorry, you may have the correct one
Pekr
18-Jan-2011
[5299]
hmm, it really seems to be in r3-gui-src.zip ...
Ladislav
18-Jan-2011
[5300]
But, anyway, it is strange, that I am unable to reproduce your findings
Pekr
18-Jan-2011
[5301x4]
ok, then I have maybe messed r3-gui.r3 .... will unpack the latest 
one ...
hmm, it's in there too ...
show-native: :show
show: funct [gob] [
    update-subgobs gob
    show-native gob
]
ok, moving home from work, later ...