Showing posts with label Tk. Show all posts
Showing posts with label Tk. Show all posts

Saturday, April 21, 2012

Google Script - What is It?

v 0.2

Said one way ..... Google Script is server-side javascript with Google API extensions that can be used to manipulate Google services and create User Interfaces.  Scripts are typically stored within Google Docs Spreadsheets or Websites and executed within the Google Cloud.

Some examples:
  • Create user functions within a spreadsheet and use them for additional formula functionality
  • Read and write data to spreadsheets
  • Create new spreadsheet menus
  • Create a user dialog or form or other application interface.
  • Create a simple database using an interface and a spreadsheet or Fusion table to store data.
Yes, there is so much more you can do, however if you already know that, then you don't need my description ..

In order to USE Google Script within your Google Account, you really do need to understand how to program Javascript.  In particular, you need to understand Javascript objects, since they are central to the use of Google Script.  Youtube has an extensive list of tutorials and lectures for Javascript, and there is now one book available for Google Script.  Google has full documentation for its API set, though this can be a little hard going for the inexperienced.

Whilst ultimately I want to end up with a complete application, I have found that I've had to go through the Google documentation - work out what I need to do, and then find example routines to do what I want - read and write to spreadsheets, create and re-order sheets, build a dialog etc.  It starts out slowly, but does speed up as you get into it.

One thing I'll say about the GUI techniques - I've found them very similar to those used in the TK interface of TCL/TK, notably the Pack and Grid modes.


Later ....

Thursday, December 1, 2011

Perl - Installing Tk on Strawberry Perl

v 0.2

I recently started looking at the options for using Perl on Windows.  One can install it through Cygwin, which may be a good option, or install either the Activestate or Strawberry versions.

I first stumbled across Strawberry when I spotted a random quote that Larry Wall uses it when he has to use Windows, so I looked further.  It is open source and comes with its own C compiler suite for use in installing Cpan modules.  I liked that Strawberry was more closely integrated with Cpan than Activestate, although the latter has its own Perl Package Manager.

Then I thought I'd like to look at using the Tk graphical toolkit with Perl, and discovered that it didn't appear to be included in either product.  I thought it would be a good opportunity to try installing Tk on Strawberry using the " cpan " facility.  So started an adventure that almost had me uninstalling the whole thing and going to Activestate.

Now, I'd installed the 32 bit version of Strawberry 5.12 on my 64 bit Win7 box.  No matter what I did, the installation failed when  " dmake " was unable to recognise some file extensions in the compiler suite.  So in a last ditch effort, I uninstalled the 32 bit version and downloaded the 64 bit Strawberry 5.14 preview and installed that.  The appropriate directories were in the "path" and so I opened a command line window and typed:

cpan Tk

It all downloaded and dmake built the Tk system however when dmake tried to test, the test failed and dumped me back to the command line.  All was not lost however, since there is only one more step needed, the actual install.  I changed to the downloaded and unpacked Tk source directory in " cpan\build " and simply typed:

dmake install

and the installation completed.  Here is some advice I found in my searching to manually install Cpan modules in Strawberry if you need to:

http://www.perlmonks.org/?node_id=841828
-----------------------------------------------------------------------
Try manual installation if CPAN install fails. Try following:
1. Download tar.gz file
2. Extract using Winzip or 7zip
3. go to the folder "Tk-804.028_503" in command prompt
4. type: dmake
5. type: dmake test
5. type: dmake install
----------------------------------------------------------------------

Anyway, I now have a working Tk module in my Perl install - I shall monitor the situation, since this is a little complex if you have a client that needs to install Perl/Tk .....


Later