Shoes apps average 2 to 8 lines each, but I'm still too danged lazy to type all that myself. I want to copy source out of the manual!

So (because Shoes text is painted, not maintained in a buffer and repainted), I added a "Copy" link, next to the "Run this" link at the bottom of each example.

Add this to help.rb, inside dewikify:

          stack :margin_bottom => 12, :margin_top => -20 do
            flow do
              para link("Run this", :stroke => "#777") { run_code(str) },
                :align => "right", :margin => 4
              para link("Copy", :stroke => "#777") { window{edit_box(str)} },
                :align => "right", :margin => 4
            end
          end

It pops the sample text up into a little window in an edit box.

Going forward, to make the actual manual text copyable, the Copy button could poke the Clipboard, and/or the grey sample code could be inside a locked, styled, sized edit box. How to do those things?

Also, shouldn't this work?

            flow :align => "right", :margin => 4 do
              para link("Run this", :stroke => "#777") { run_code(str) }
              para link("Copy", :stroke => "#777") { window{edit_box(str)} }
            end

--
  Phlip

Reply via email to