World: r3wp
[!RebGUI] A lightweight alternative to VID
older newer | first last |
Graham 25-Oct-2007 [6879x5] | I'm putting in some background text as an image as a prompt to users, but it would be nice to clear the background image as soon as the user click types anything like those search fields in browsers |
like this field effect (to-image layout/tight [ backdrop white text "enter search term" ] font-color 230.230.230 ) [ aspect ] | |
I'm sure there's a native rebgui way of doing this rather than using 'layout ! | |
(to-image layout/tight [ backdrop white text "enter search term" font-color 230.230.230 ] ) | |
and have it restored when we clear the field | |
Ashley 25-Oct-2007 [6884] | How about: field %a.png effect [fit] on-focus [face/image: none true] on-unfocus [face/image: load %a.png true] |
Graham 25-Oct-2007 [6885] | Looks logical - I'll give it a go. |
Graham 26-Oct-2007 [6886] | It's getting a bit awkward now .. I have to set the image at startup, restore it on an unfocus event, and then restore it again if I clear the field. I think I need to store the image in the field itself .. perhaps as a new type of field widget |
JohanAR 30-Oct-2007 [6887] | How come things I create end up four times the size I specify? button "Test" 10x10 maroon [print face/size] prints 40x40 when I click it... |
btiffin 30-Oct-2007 [6888] | Johan; RebGUI doesn't use pixels (well it does, but ...) It uses a unit-size that can be set with the request-ui function. See http://www.dobeash.com/RebGUI/user-guide.html#section-3.3for some details. |
JohanAR 30-Oct-2007 [6889x2] | Sounds reasonable :) Is there any way to circumvent this for items that need a specific pixel size, in my case a picture? |
And a related question.. Is it possible to resize the window when my picture is changed, so that the new picture doesn't get resized to the previous one's size? | |
btiffin 30-Oct-2007 [6891] | Well, RebGUI allows for widget design but that can seem complicated at first. Another method is judicious use of the span attributes and surrounding widgets with box elements set up like elastic widgets that will take/give all the space during a resize. Or wait till Ashley reads this and responds as he always has the best and simplest advice. :) |
Graham 30-Oct-2007 [6892x2] | Is there a way for 'display to just return the layout without viewing ? |
like display/only ... | |
btiffin 30-Oct-2007 [6894] | Umm...check ctx-rebgui/layout but the source for display does some other nifty things other than just create the face. |
Graham 30-Oct-2007 [6895x2] | Is there a way to set a backdrop to a display? |
I tried setting lo/pane/1/image but that sets the image to the first widget in the layout | |
Ashley 31-Oct-2007 [6897x3] | display "" [ |
button 10x10 do [face/image: my-image face/effect: 'fit] ] | |
Is there a way for 'display to just return the layout without viewing? a: ctx-rebgui/layout/only [button 10x10] | |
Graham 31-Oct-2007 [6900] | what's the code for the layout backdrop? |
Ashley 31-Oct-2007 [6901x2] | Is there any way to circumvent this for items that need a specific pixel size, in my case a picture? image defaults to size -1x-1 which means *not* specifying a size will default it to the image size. Is it possible to resize the window when my picture is changed, so that the new picture doesn't get resized to the previous one's size? This should get you going: display "" [ button [face/parent-face/size: 320x240 show face/parent-face] ] Note that in this case the size *is* in pixels as you are modifying a face object directly (as opposed to specifying a wudget's *unit* size). Hope that helps. |
code for the layout backdrop? As above: display "" [ button 10x10 do [face/image: my-image face/effect: 'fit] ] or: display "" [ button 10x10 do [face/image: load %my-image.png face/effect: 'fit] ] | |
Graham 31-Oct-2007 [6903x2] | Ok, thanks |
Isn't there a dirty? flag in Vid to check to see if an area widget has been altered? | |
Graham 5-Nov-2007 [6905x2] | Ashley, we talked about this before. I am looking for a way to spell check in a popup or static window attached to the area that is being checked, and to double click on the choice, have it replace the highlighted text, and then move on to the next text which is then highlighted. I got it working except for the part of highlighting the next word that is suspect. It highlights and then immediately loses the highlight .. perhaps something to do with the double click and focus system? |
So, you lose the context in which you are spell checking the current word | |
Ashley 5-Nov-2007 [6907] | I remember looking at this and concluding that ctx-edit.r would have to be changed rather dramatically to allow this ... it has to do with the order in which set-focus and show are called. Several minor hacks I experimented with (mainly in set-focus) just didn't cut it. I put it in the "too hard" basket but may revisit this now that the long-running (for me at least) pick-list bug has been fixed; and I also have a few users asking about this as well. |
btiffin 5-Nov-2007 [6908] | I'd 'here here' on that one. I've been mucking with a RebGUI based editor and getting a Find/Replace dialog working has been an excercise in hackery that I'm not a huge fan of. (Much chasing of tail and subverting of code that I have too much respect for to allow the hackery.) |
JohanAR 6-Nov-2007 [6909] | Any easy and good looking way to get a return key press (in a text field) to trigger an ok-button? |
btiffin 6-Nov-2007 [6910] | Johan; Try display "test" [f1: field [b1/action/on-click b1 none] b1: button "Ok" [print "The action"]] You may need to check with on-key if you want to restrict it to just "Enter", I'm not real sure what activities cause the action for fields to fire. (Could be focus/unfocus...have to experiment) and note this will not "click" the button, just evaluate it's on-click action code. This advice is just in-the-meanwhile. Ashley will no doubt have thee easy and good looking solution. :) |
Graham 6-Nov-2007 [6911] | Just wondering if it's better to allow one to copy text from an alert .. often they're error messages, and users like to copy them and email them. |
Micha 9-Nov-2007 [6912x2] | how to change this code ? display "test" [ area button "yes" button "no"] . button "yes" have to be under button "on" |
so as on this image http://jacek.x10hosting.com/test.jpg | |
Graham 9-Nov-2007 [6914x2] | you culd try using a panel |
area panel -1x-1 none data [ button "yes" return button "no" ] | |
Micha 9-Nov-2007 [6916] | thanks |
Micha 10-Nov-2007 [6917x2] | how to show image ? |
dispray [ panel: panel white 80x12 data [ ] button "img1" on-click [ panel/image: load %img1.png] button "img2" on-click [ panel/image: load %img2.png] ] | |
Robert 10-Nov-2007 [6919x4] | Micha, a "show panel" is missing after setting /image |
And, you shouldn't use the key-word PANEL as variable name. | |
And, I don't think that PANEL has an /IMAGE ;-) | |
my-pic: image ... my-pic/image: load %img1.png show my-pic | |
JohanAR 13-Nov-2007 [6923] | rebgui ver 93 seems to crash when a drop-list is double clicked |
Graham 13-Nov-2007 [6924x3] | reported in Sept. Ashley suggested I think adding the dbl-action facet to the choose function in ctx-widgets.r will 'fix' the problem, as in: choose: make function! [ ... ][ ... popup: make face-iterator [ ... alt-action: none dbl-action: none ] ... ] |
as he never saw this, perhaps it's not in SVN yet | |
He meant rebgui-widgets.r | |
DanielSz 13-Nov-2007 [6927x2] | My rebgui UI gets unresponsive while some code is running. Since rebol doesn't have threads, I wonder what solution you'd recommend. Does the trick of assigning a rate of 0 to a GUI element work in RebGUI? Or would you perhaps separate the offending code and use "launch" to run a separate rebol process? Or maybe you know some other magic that I don't? |
The code that blocks the UI is a ftp file upload, which to the best of my knowledge is done synchronously, hence the blocking. | |
older newer | first last |