Re: Mac Standalone Bug

2010-06-30 Thread Justin Sloan
True, in 4.0 I disabled destroyStack but it still happens.  The work
around was to write a resizing routine on preOpenStack for all objects
to get the to fit correctly within the stack.  This slows down the
spped at which the stack opens on initial launch but is otherwise
unnoticed.

 - Justin
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Menu Checkmarks

2010-06-26 Thread Justin Sloan
I am trying to check and uncheck a menu item, specifically a Word Wrap menu 
option.  I tried several things but can't seem to get it to work.

set the hilite of menuItem 10 of menu Edit of group MenuBar to false

set the checkmark of menuItem 10 of menu Edit of group MenuBar to false

set the value of menuItem 10 of menu Edit of group MenuBar to !nWord Wrap

set the label of menuItem 10 of menu Edit of group MenuBar to !nWord Wrap

Any thoughts?___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Line Numbers in Text Editor

2010-06-26 Thread Justin Sloan
Richard,

Fantastic primer on handling line numbers in Rev! Thank you!  It's amazing how 
something seemingly so simple can have such a huge impact.

That is what I love about programming, the elegance of creative solutions.


 - Justin


On Jun 26, 2010, at 7:23 PM, Richard Gaskin wrote:

 Justin Sloan wrote:
  I am planning to implement line numbers in a proprietary text editor
  that I wrote for in-house use.  Problem is, I don't know how I am
  going to implement it. I thought about using a parallel text field,
  but there has to be an easier way.  Any of you genius devs have any
  ideas?
 
 I forked the MC IDE's script editor many years ago to add, among other 
 things, line numbers.  It was at the time the only script editor for Rev 
 which had line numbers, and having implemented this advanced technology g 
 I can share with you a couple tips I learned:
 
 The line numbers are displayed in a separate field to the left of the editor 
 field, kept in synch with scrollbardrag handlers in each.  Being a script 
 editor I also have another field in between them for marking breakpoints, but 
 you probably won't need that for other types of editing.
 
 I chose a separate field for the line numbers because it seemed a more 
 with-the-grain approach than attempting to put anything in the editor field 
 except for the script itself.  In Rev, a script is just a block of text, so 
 my mandate for my editor was to maintain as close a relationship as possible 
 between what you see and what the engine expects.  So the script is dumped 
 into a field, with no caches or other intermediaries to complicate the 
 scripter's relationship with the engine. WYGIWE - what you got is what 
 exists. ;)  I have a McCabe algo for Rev (see note on RevCloud below) so I'm 
 sensitive to the impact of complexity in a code base.
 
 At first I went the route most other text editors use, in which the line 
 number field is populated dynamically to show only the lines present in the 
 editor field.  But I found that when I got beyond a few thousand lines the 
 time it takes the engine to render the line number field became a performance 
 drag on my typing.  So I went with having pre-populated numbers, which isn't 
 so bad since you can still see how many lines you have in your script by just 
 scrolling to the end and look at the last line number across from the last 
 line of script.
 
 But even pre-populating the line number field was not without some challenge, 
 since putting in 10,000 lines of numbers would not be sufficient for some 
 scripts, and added a lot of bulk to the editor stack file.
 
 So the final solution I went with was leaving the field blank when the stack 
 is saved, and populating it on preOpenStack with the number of lines of the 
 script + 5000.  Since this is a one-time performance hit when the stack 
 opens, the impact on performance isn't nearly as noticeable as it was when I 
 was appending that list with each carriage return (has anyone younger than 40 
 even seen an actual typewriter carriage? Odd nomenclature in the 21st 
 century, but I digress).
 
 This keeps the stack file small enough to be extremely portable (I'm 
 migrating a lot of tools to cloud storage - look for RevCloud coming soon to 
 RevNet this summer; think devolution on serious steroids and focused on 
 collaborative workflows), and it's unlikely that a person will type more than 
 5000 lines during a given session with the editor open.
 
 But what if they paste more than 5k lines?  I've trapped for that in the 
 Paste item and add another block of lines numbers beyond the number already 
 in the field + the number in the clipboard, so we stay a few thousand lines 
 ahead of the scripter.
 
 HTH -
 
 -- 
 Richard Gaskin
 Fourth World
 Rev training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
 revJournal blog: http://revjournal.com/blog.irv
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Line Numbers in Text Editor

2010-06-25 Thread Justin Sloan
I went with using a parallel field to add line numbers and it is
working well. However, rev only counts the line numbers based on the
delimeter. So if word warp is turned on you end up with more lines
then there are actual line numbers.

Does anyone know of a way to count all the lines, even the lines that
are wrapped and not separated by the delimeter?

 - Justin



On Thu, Jun 24, 2010 at 5:44 PM, Jeff Massung mass...@gmail.com wrote:
 I used a parallel field in my Cryogen editor (http://massj.tumblr.com for
 video + screenshot). Worked out perfectly, and now that I've done it that
 way once, I actually wouldn't want to do it any other way in the future.

 Jeff M.

 On Thu, Jun 24, 2010 at 6:01 AM, Justin Sloan justin.sl...@us.army.milwrote:

 I am planning to implement line numbers in a proprietary text editor
 that I wrote for in-house use.  Problem is, I don't know how I am
 going to implement it. I thought about using a parallel text field,
 but there has to be an easier way.  Any of you genius devs have any
 ideas?
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Line Numbers in Text Editor

2010-06-24 Thread Justin Sloan
I am planning to implement line numbers in a proprietary text editor
that I wrote for in-house use.  Problem is, I don't know how I am
going to implement it. I thought about using a parallel text field,
but there has to be an easier way.  Any of you genius devs have any
ideas?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Mac Standalone Bug

2010-06-24 Thread Justin Sloan
Is anyone else seeing a bug in the Mac standalone maker that cuts off 
approximately the bottom 15 to 20 pixels of your stack when you make a 
standalone?___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Mac Standalone Bug

2010-06-24 Thread Justin Sloan
Jeff,

I do have a menu. Is that the problem?  How do I counter it?

 - Justin


On Jun 24, 2010, at 7:54 PM, Jeff Massung wrote:

 Did you create a menu for your stack?
 
 Jeff M.
 
 On Thu, Jun 24, 2010 at 11:49 AM, Justin Sloan sloan.jus...@gmail.comwrote:
 
 Is anyone else seeing a bug in the Mac standalone maker that cuts off
 approximately the bottom 15 to 20 pixels of your stack when you make a
 standalone?___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Insertion Point

2010-06-19 Thread Justin Sloan
Hello All, 

I am totally lost and frustrated; I need your help.

I am writing a simple text editor as my first app. Problem is, I want to be 
able to insert some text from a menu selection, but the text is always added at 
the bottom of the text field rather than at the insertion point where the 
cursor is current located. Any ideas are greatly appreciated.

 - Justin___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Insertion Point

2010-06-19 Thread Justin Sloan
That is excellent, thanks! I spent hours trying to figure that out.
Maybe sometime the rev logic is just a little too easy!

On Saturday, June 19, 2010, Mike Bonner bonnm...@gmail.com wrote:
 Suppose you want to insert the date at the current location, use
 selectedtext to do this. If text is selected it will replace it, if no
 text is selected it will insert at the current insertion point.

 put the date into the selectedtext

 Will pop the date in just fine.

 On Sat, Jun 19, 2010 at 10:12 AM, Justin Sloan sloan.jus...@gmail.com wrote:
 Hello All,

 I am totally lost and frustrated; I need your help.

 I am writing a simple text editor as my first app. Problem is, I want to be 
 able to insert some text from a menu selection, but the text is always added 
 at the bottom of the text field rather than at the insertion point where the 
 cursor is current located. Any ideas are greatly appreciated.

  - Justin___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


ask password

2010-06-14 Thread Justin Sloan
Hello all,

I am trying to use the ask password command to mask the password input that 
eventually gets sent to the *nix shell. Problem is, when the user puts in their 
password, it returns seemingly random characters instead of the unmasked 
password. Any ideas?___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Shell Command with Sudo

2010-06-12 Thread Justin Sloan
Thanks to all who replied. With you help and some additional research
I came up with a solution.

Mac OS X bash shell only allows results from commands to be piped in
to another command, including sudo, not plain text. The solution is to
set a bash variable (pw=password) and echo the variable to pipe it
into sudo (echo $pw | sudo -S command). In Rev you must set the
variable and pipe it in on the same shell() call. Like this:

shell(pw=  tPassword  ; echo $pw | sudo -S command)

Works like a charm, and it's an elegant solution without a lot of
hashed code. I have not tested this on other Unix based systems but
the command should work on any system with bash as the default shell.


Happy coding!
 - Justin


On Fri, Jun 11, 2010 at 6:51 PM, David Bovill da...@vaudevillecourt.tv wrote:
 Don't think expect is the right way to do this - best would be to use an ssh
 key (seem to remember that is how I used to do this back when i was on Linux
 with Metacard), or else to write a bash script as a text file and then get
 rev to execute that.

 On 11 June 2010 16:33, Andre Garzia an...@andregarzia.com wrote:

 Justin,

 I always though you could not pipe passwords into sudo. One way to do this
 kind of stuff is to use the expect tool.

 http://expect.sourceforge.net/

 With expect you can automate many command line things.

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Shell Command with Sudo

2010-06-12 Thread Justin Sloan
Peter,

That is a good suggestion if the application was not meant for mass
deployment. Otherwise each machine's sudoers file would have to be
edited accordingly, which would be a bummer for users that do not know
how to do so. And that is likely the majority of Mac users. I would
venture to say that the majority of Mac users never even opened the
Terminal.

The solution is elegant, I believe, in that it will work on any Mac OS
X machine and takes advantage of Bash' s flexibility with Rev's shell
structure.

Happy coding!
 - Justin


On Sat, Jun 12, 2010 at 12:11 PM, Richmond richmondmathew...@gmail.com wrote:
 On 06/12/2010 12:08 PM, Peter Alcibiades wrote:

 Is there a reason you cannot use the NOPASSWD option in sudo?  Maybe this
 is
 not how it works in OSX, but what you'd normally do is to edit
 /etc/sudoers
 to allow this particular user to perform this particular command with the
 no
 password option, and its done.  If you do this, the command can be limited
 to one with specific options.  For instance, you can allow shutdown with
 the
 -h option, but not the -r option.  No-one has to know the root password
 then
 and it is not written anyplace.  Yes, you do have to know it to edit
 /etc/sudoers.


 This is all very charming, but I wonder how one would
 effect this from a standalone on an end-user's machine . . .  :)
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Shell Command with Sudo

2010-06-11 Thread Justin Sloan
Hello All,

I am trying to run a shell() command in revStudio in order to execute some 
terminal commands as the superuser on a Mac. An Ubuntu terminal will accept the 
superuser password using a pipe, such as pass | sudo -S command, but Mac's 
terminal will not accept the password on the same line.

Is there a way to run multiple commands from a single rev shell() call? Or, can 
I somehow followup a shell() call with the password?

Thanks,

Justin___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


revStudio for Linux Also $50

2010-06-10 Thread Justin Sloan
TheMacSale.com bundle is ending on 15 June. The good news is you still
have time to get revStudio for only $50, and for any OS. When you
purchase the bundle they send you an activation code. You then take
that activation code to the RunRev website and choose which OS you are
planning to run it on.  RunRev will then email you the serial number
for the product you selected and you are good to go. Regardless of
which OS you write your stacks on you can create standalones that run
on Win, Mac or Linux.  Awesome.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: revStudio for Linux Also $50

2010-06-10 Thread Justin Sloan
No, I purchased the Mac version. I noticed the option when I went to
activate my code and RunRev and get my serial for Studio. After you
enter your activation code provided by TheMacSale you are presented
with a form to fill in your name and address. At the botton of the
form you select your OS. It sounds to me like you can select whatever
version you want.

On Thu, Jun 10, 2010 at 3:58 PM, David C. davidoco...@gmail.com wrote:
 TheMacSale.com bundle is ending on 15 June. The good news is you still
 have time to get revStudio for only $50, and for any OS. When you
 purchase the bundle they send you an activation code. You then take
 that activation code to the RunRev website and choose which OS you are
 planning to run it on.  RunRev will then email you the serial number
 for the product you selected and you are good to go. Regardless of
 which OS you write your stacks on you can create standalones that run
 on Win, Mac or Linux.  Awesome.


 Justin, is that something you've actually done first hand with the
 Linux version?
 ...I contacted them inquiring whether it covered the Linux and was
 told the offer was good for Mac'c only.


 Best regards,
 David C.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution