World: r3wp
[View] discuss view related issues
older newer | first last |
btiffin 2-Jan-2009 [8454] | I stand corrected then. ;) |
james_nak 2-Jan-2009 [8455] | Question, I've been writing an app that shuffles through a lot of images but one at a time (same single image in layout) . I notice that what appears to be happening is that each time an image is loaded, more memory is consumed. I am not using load-image but maybe I should with the /clear refinement. Any thoughts? |
Steeve 2-Jan-2009 [8456] | should not happen... perhaps are missing some recycles in you script...or maybe you forgot to unset some faces in your layout. |
amacleod 3-Jan-2009 [8457] | I'm going to be converting a bunch of images to binary for storage in a db (sqlite). What is with the base 64 option? Is there an advantage or need in my case? I'll be compressing them also... |
Sunanda 3-Jan-2009 [8458] | Base 64 in REBOL is, basically, a type of ASCII represention. It can stand a certain amount of damage (like whitespace being inserted -- imagine it is sent as an email) and can still be reconstructed: str: "abcdefabcdef" ;; a string s64: enbase str ;; enbased to base-64 by default replace/case/all s64 "W" " W " ;; whitespace polluted in transit str = to-string debase s64 ;; do we get it back intact? |
Geomol 3-Jan-2009 [8459] | amacleod, I don't think, there's much of a idea in using base 64 to store images locally, as they will grow in size. The format is good for sending binary data over the internet. |
amacleod 3-Jan-2009 [8460] | I'll also be storing on a server using mySQL. |
Gregg 3-Jan-2009 [8461] | The size increase can be significant if you're storing a lot of big images. Why not just store the binary data raw? |
amacleod 3-Jan-2009 [8462] | Makes sense... when I upload an image to the db how do I go about it? Do I load it into a variable first? |
Gregg 3-Jan-2009 [8463] | Depends on the interface to the DB. I haven't use sqlite. If it's just in a file, you'll need to read it first (unless the DB layer does that, kind of like VID does). Of course, storing files in the files system and just putting the name in the DB is another option. If you have a lot of big images, the DB can grow very quickly, and many DBs aren't particularly designed for BLOB storage. |
Chris 3-Jan-2009 [8464] | I don't know how it is stored in the DB, but it is bound to the DB as hex (base16) and stored as a 'Blob'. As far as I'm aware, Ashley's driver will do this for you: sql ["INSERT INTO mytable VALUES (?)" #{ABCD}] |
btiffin 3-Jan-2009 [8465] | Careful with SQLite and big blobs. A blob can be SQLITE_MAX_LENGTH (usually a billion) but SQLITE_MAX_SQL_LENGTH defaults to a million. A single line of SQLite may limit the size of blobs to under 1 million. See http://www.sqlite.org/limits.htmlfor deets. |
Nicolas 7-Jan-2009 [8466] | I want to be able to catch alt-key down and caps lock down and caps lock up and things like that. Can I use external libraries to do these things? |
Maarten 7-Jan-2009 [8467] | I think you want to use the system port for that - assuming you use windows. Cross-platform... I don't know. |
Nicolas 7-Jan-2009 [8468] | Where can I learn about windows/unix keyboard events and how to access them with rebol ports? |
Cyphre 8-Jan-2009 [8469x2] | Nicolas, the problem with catching key events using system port is that it works only when Rebol console window is opened. (at least under Windows) |
I hope I (or someone else) convince Carl to fix that for the next release of R2 as I know the system port could be useful for other things that key events in Rebol/View. | |
Maxim 8-Jan-2009 [8471x2] | YESSSS please. |
its for advanced users, only they will use it anyways... so its not going to impede the basic simplicity of rebol | |
Nicolas 13-Jan-2009 [8473x2] | does update write the whole file or does it just alter the file? |
I'm trying to make an interface that updates a file on every keystroke | |
BenBran 14-Jan-2009 [8475] | In this snippit of code how to I change the text color to white? ... make btn-face [ offset: 80x10 size: 130x38 effect: [fit] text: "fit" ] ... |
Steeve 14-Jan-2009 [8476] | what is in btn-face ? anyway... if the text is not inserted in a draw block, this should work: font: make font [color: white] |
BenBran 15-Jan-2009 [8477] | Thank you Steeve, that worked just fine. |
BenBran 26-Jan-2009 [8478] | I'm working on taking the output of a console program to a view. Its formatted nice for the console but I can't seem to get the text spaced correctly for the text-list box such as teletype or monotype.... any suggestions? myData: read %./ lo: [text-list 640x480 data to-block myData] view/options/title layout lo [resize] "Files" ;; characters do not line up vertically but look fine in console thanks in advance. |
DideC 26-Jan-2009 [8479] | myData: read %./ lo: [text-list 640x480 data to-block myData font [name: "courier new"]] view/options/title layout lo [resize] "Files" |
Anton 26-Jan-2009 [8480] | or my-data: read %./ window: center-face layout [text-list 640x480 font-name font-fixed data my-data] view/options/title window 'resize "Files" |
DideC 27-Jan-2009 [8481] | Yes: I know that there was a shorcut for fixed font but I foget the word. Anton answer is more OS compatible ! |
BenBran 27-Jan-2009 [8482] | Thank you! both worked as advertised. |
Thorsten 1-Feb-2009 [8483] | Hi, i was was wondering if anybody already tried to make a toolbar, which is collapsible like the windows systembar. For quite a while i am thinking about a small word processor with such a toolbar. It should be invisible when the mouse is not over it. I want to try it with R2 and R3, but R3 is in focus, and need a little jumpstart. Can anybody help?? |
Gregg 1-Feb-2009 [8484] | I've done an appbar that sits on the desktop. It doesn't use the officel APPBAR APIs, just emulates the slide on/off bit. It's not perfect, but not horrific either. Basically, I have a timer and target locations, FSM driven. When in a given state, and an event occurs, it sets the target position and then moves towards it on each timer tick. When the window deactivates (using insert-event-func to catch that), slide off. When it activates, slide on. It's not perfect, because you can't do it on a mouse hover, and I haven't tried to make it work on multiple montors. With my new setup, it slides off the center monitor and onto the left edge of the right monitor. :-\ |
BenBran 2-Feb-2009 [8485] | I'm working with resizing fields. Setting the size of the field would be a good start. Figuring how to size the text-list on a window resize event would be a bonus. I took a sample from the docs and modifed slightly. REBOL [] displayData: ["A very long entry that will exceed the default width of the field that is displaying it."] view/options/title layout [ lines: text-list 640x480 bold font-size 14 font-name font-fixed data to-block displayData [ ;; not sure how to auto-size the text-list either see-it/text: first lines/picked ;; how do I size this field show see-it ;; maybe its done here ] ;; see-it: info ;; or here? ] [resize] "Test" Thanks again in advance. |
Henrik 2-Feb-2009 [8486x3] | Basically you need to perform the resizing as an event function of the window using insert-event-func and set up sizes manually for each element that you wish to resize. However this is very tedious in the long run and very un-rebolish as there are absolutely no functions to handle resizing in standard VID/View. So BrianH and I wrote a prototype for a resize engine, which we hoped would be part of REBOL/View 2.7.7. Brian is probably against spreading it as it's not debugged and complete, but I want to give it to you anyway, because I use it and it works fairly well, at least much better than the nightmare of manual resizing. |
http://rebol.hmkdesign.dk/files/resize/vid-resize.r | |
A couple of examples in the bottom. You need to add some resizing hints for each element you want to resize, but we'll get to that. | |
BenBran 2-Feb-2009 [8489] | Thanks Henrik. I'll take a look. |
Anton 3-Feb-2009 [8490] | http://anton.wildit.net.au/rebol/gui/demo-resize-text-list.r |
Micha 4-Feb-2009 [8491] | i need help . i run rebol 2.7.6 on ubuntu desktop - i get error : ** User Error: Bad face in screen pane! ** Near: size-text self |
kcollins 4-Feb-2009 [8492] | Micha, I think you just need to install additional fonts. The following links may be helpful: http://mail.rebol.net/maillist/msgs/42419.html https://wiki.ubuntu.com/Fonts#EnablingBitmapped Fonts |
Micha 4-Feb-2009 [8493] | thanks |
Oldes 21-Feb-2009 [8494x2] | How to clear image cache used by VID? |
in which context is the 'image-cache ? | |
amacleod 21-Feb-2009 [8496] | Just discussed something along those lines in vid+ Anton suggests setting to none |
Oldes 21-Feb-2009 [8497x2] | ech.. it's local in load-image function, sothe only way is ugly: |
error? try [load-image/clear %foo] | |
Anton 21-Feb-2009 [8499x3] | clear second second :load-image |
(an alternative way, still ugly, of course.) | |
amacleod: Oldes is talking about the LOAD-IMAGE function (not LOAD), with the image cache block only to be found in the LOAD-IMAGE function body, so we can't just set to NONE, here, unfortunately. (See the source of load-image.) | |
amacleod 21-Feb-2009 [8502] | I'll have aa look thanks, Anton. |
amacleod 23-Feb-2009 [8503] | How do I get the window to resize withthe image face? pic1: load %pic.jpg pic_size: 200x200 view/new lay: layout [pic: image pic1 pic_size] wait 2 unview lay pic/size: 50x50 view/new lay |
older newer | first last |