LPSwitch, a UISwitch clone

34 views
Skip to first unread message

luddep

unread,
Nov 7, 2009, 8:31:31 PM11/7/09
to Cappuccino & Objective-J
Hello everyone,

I've been messing around a bit with creating a pretty much identical
(behavior wise, at least) clone of UISwitch for cappuccino tonight.

It requires my LPKit "framework" to run, but I've got a live demo up
at http://luddep.se/static/LPKit-Examples/ so you don't have to set
stuff up & jump through a bunch of hoops just to see what the controls
are like (with the added bonus of them being shown off in an aristo-
like theme).

You can both drag it to either side, or just click it and it'll work
as you would expect.
Anyhow, I'd love to get some feedback on this thing (& any other part
of LPKit for that matter), so if you've got any, shoot - I'm all ears.

The source is available at http://github.com/luddep/LPKit/blob/master/LPSwitch.j

Thanks,
Ludwig

Tobin Juday

unread,
Nov 7, 2009, 9:15:57 PM11/7/09
to objec...@googlegroups.com
The calendar component is gorgeous, well done.

Tobin


On Sat, Nov 7, 2009 at 8:31 PM, luddep <lud...@gmail.com> wrote:

Hello everyone,.

Randy Luecke

unread,
Nov 7, 2009, 9:40:03 PM11/7/09
to Cappuccino & Objective-J
Very cool! Question, what license are you using for LPAristo?



On Nov 7, 8:31 pm, luddep <lud...@gmail.com> wrote:
> Hello everyone,
>
> I've been messing around a bit with creating a pretty much identical
> (behavior wise, at least) clone of UISwitch for cappuccino tonight.
>
> It requires my LPKit "framework" to run, but I've got a live demo up
> athttp://luddep.se/static/LPKit-Examples/so you don't have to set

Randy Luecke

unread,
Nov 7, 2009, 11:31:27 PM11/7/09
to Cappuccino & Objective-J
Oh, and I would probably try to match the size of the text used for
Aristo buttons on the LPSwitch.

On Nov 7, 8:31 pm, luddep <lud...@gmail.com> wrote:
> Hello everyone,
>
> I've been messing around a bit with creating a pretty much identical
> (behavior wise, at least) clone of UISwitch for cappuccino tonight.
>
> It requires my LPKit "framework" to run, but I've got a live demo up
> athttp://luddep.se/static/LPKit-Examples/so you don't have to set

Dunkie

unread,
Nov 7, 2009, 11:52:04 PM11/7/09
to Cappuccino & Objective-J
I've downloaded the source.
Attempting to implement it but I get a javascript alert "IMPLEMENT
ANIMATION CURVES!!!"


On Nov 7, 8:31 pm, luddep <lud...@gmail.com> wrote:
> Hello everyone,
>
> I've been messing around a bit with creating a pretty much identical
> (behavior wise, at least) clone of UISwitch for cappuccino tonight.
>
> It requires my LPKit "framework" to run, but I've got a live demo up
> athttp://luddep.se/static/LPKit-Examples/so you don't have to set

Johan

unread,
Nov 8, 2009, 1:10:34 AM11/8/09
to Cappuccino & Objective-J
Yes, really nice (and clean) indeed!

Bruno Ronchetti

unread,
Nov 8, 2009, 2:21:01 AM11/8/09
to Cappuccino & Objective-J
Hi Ludwig,

I am really impressed by you calendar component, which looks and
performs so much better than mine (couple of messages below).

Congrats. I will study your code an try to learn.

Regards.

Bruno

Joel Norvell

unread,
Nov 8, 2009, 4:11:48 AM11/8/09
to Cappuccino & Objective-J
Hello Ludwig,

Your work is really beautiful!

Thank you for sharing the code!

Sincerely,
Joel

luddep

unread,
Nov 8, 2009, 7:41:16 AM11/8/09
to Cappuccino & Objective-J
Thanks everyone!

> Very cool! Question, what license are you using for LPAristo?

LPAristo is distributed under the Creative Commons Attribution Share-
Alike License to stay cool with Aristo, the example app is distributed
under the MIT license.

> Oh, and I would probably try to match the size of the text used for
> Aristo buttons on the LPSwitch.

I personally don't use Aristo for any of my projects, so I'm not
really going for pixel perfection on the LPAristo theme - think of it
more as an example on how to use the theme API with LPKit.

But not everyone is like me, so if anyone wants to use it together
with Aristo in a production app, I can spend a few minutes tidying it
up :)

> Attempting to implement it but I get a javascript alert "IMPLEMENT
> ANIMATION CURVES!!!"

Ah, it requires that you run on the master branch - it's not supported
on 0.7.1 and below.
I should add that to the readme.. thanks for reminding me!

Again, thanks again for all the kind words. Now this is all on github,
so start forking! :)

On Nov 8, 5:31 am, Randy Luecke <rclconce...@gmail.com> wrote:
> Oh, and I would probably try to match the size of the text used for
> Aristo buttons on the LPSwitch.
>
> On Nov 7, 8:31 pm, luddep <lud...@gmail.com> wrote:
>
>
>
> > Hello everyone,
>
> > I've been messing around a bit with creating a pretty much identical
> > (behavior wise, at least) clone of UISwitch for cappuccino tonight.
>
> > It requires my LPKit "framework" to run, but I've got a live demo up
> > athttp://luddep.se/static/LPKit-Examples/soyou don't have to set

Dunkie

unread,
Nov 8, 2009, 10:43:42 AM11/8/09
to Cappuccino & Objective-J
Great...

As you state in your original post “so you don't have to set stuff up
& jump through a bunch of hoops just to see what the controls are
like” says a lot and has been a burr in my saddle for quite a while.

The simple starter package is awesome. No matter what your platform
you download it and begin to code. Instant results, everything just
works.

For the average guy busy doing a crash course on objective-C/J - all
the git branch pushing/pulling, updating with jake/rake or worse the
mac only nib/cib discussions can be negatively distracting.

Francisco/Ross/Tom: for all of us without sudo permission or not using
a mac or can we PLEASE get an update to the 7.1 (July 2009) starter
package?
> > > athttp://luddep.se/static/LPKit-Examples/soyoudon't have to set

Ross Boucher

unread,
Nov 8, 2009, 12:18:57 PM11/8/09
to objec...@googlegroups.com
We're planning on making nightly builds available soon. But you don't
need sudo to build/install, you just need to change the default paths.

Sent from my iPhone.

Dunkie

unread,
Nov 21, 2009, 9:24:12 AM11/21/09
to Cappuccino & Objective-J
In the sample docs it says: "see cappuccino docs on how to compile &
use themes".
Where is the docs?


I'm using the latest Atlas6 download and no longer get the "IMPLEMENT
ANIMATION CURVES!!!"
Now when I attempt to use the LPAristo theme as in the sample I get
the error:"*** Could not recognize executable code format."



On Nov 7, 8:31 pm, luddep <lud...@gmail.com> wrote:
> Hello everyone,
>
> I've been messing around a bit with creating a pretty much identical
> (behavior wise, at least) clone of UISwitch for cappuccino tonight.
>
> It requires myLPKit"framework" to run, but I've got a live demo up
> athttp://luddep.se/static/LPKit-Examples/so you don't have to set
> stuff up & jump through a bunch of hoops just to see what the controls
> are like (with the added bonus of them being shown off in an aristo-
> like theme).
>
> You can both drag it to either side, or just click it and it'll work
> as you would expect.
> Anyhow, I'd love to get some feedback on this thing (& any other part
> ofLPKitfor that matter), so if you've got any, shoot - I'm all ears.

luddep

unread,
Nov 21, 2009, 9:33:55 AM11/21/09
to Cappuccino & Objective-J
Sorry about that, there were some changes recently to how bundles are
loaded and I forgot to make the example app compatible.
I've pushed the fix.

As for docs, there aren't any, yet. For initial instructions, check
this thread: http://groups.google.com/group/objectivej/browse_thread/thread/1508aee0d9b25af1/1b6fb461ec5fd6a8


On Nov 21, 3:24 pm, Dunkie <blairdun...@sympatico.ca> wrote:
> In the sample docs it says: "see cappuccino docs on how to compile &
> use themes".
> Where is the docs?
>
> I'm using the latest Atlas6 download and no longer get the "IMPLEMENT
> ANIMATION CURVES!!!"
> Now when I attempt to use the LPAristo theme as in the sample I get
> the error:"*** Could not recognize executable code format."
>
> On Nov 7, 8:31 pm, luddep <lud...@gmail.com> wrote:
>
>
>
> > Hello everyone,
>
> > I've been messing around a bit with creating a pretty much identical
> > (behavior wise, at least) clone of UISwitch for cappuccino tonight.
>
> > It requires myLPKit"framework" to run, but I've got a live demo up
> > athttp://luddep.se/static/LPKit-Examples/soyou don't have to set

Dunkie

unread,
Nov 21, 2009, 12:17:18 PM11/21/09
to Cappuccino & Objective-J
That seems to have done it, thanks.

Still seems to be something missing to get it to work in Atlas as now
the fonts on the calendar have changed to serif font which is
different from the sample.

Here is what I've done.
Created a new cib project in Atlas.

Dropped the LPAristo folder (from the new Nov 21 example on git) into
the new projects folder.
Dropped the LPKit folder (from the Nov 7 version on git) into the new
projects Frameworks folder
Dropped the AppController.j from the new Nov 21 example into the new
projects folder.
Opened the new project in Atlas.
Build and Run.

I now get the error: *** Could not recognize executable code format.

If I just click on the index.html file from the new project,
everything works but for the font changes.



luddep

unread,
Jan 17, 2010, 4:27:18 PM1/17/10
to Cappuccino & Objective-J
Here is an example app that runs LPKit alongside atlas:

http://cloud.github.com/downloads/luddep/LPKit-Examples/LPKit-Atlas.zip

It's using a built version of LPKit as well as symlinked (capp gen -l -
f --force) frameworks, which in turn is built from the latest jake
branch.

Hope this helps,
Ludwig

Dunkie

unread,
Jan 17, 2010, 5:03:50 PM1/17/10
to Cappuccino & Objective-J
Hmmm, I suspect I'm still missing something.

I downloaded your zipped file.
Clicked on the index.html file - nothing loads due to missing
frameworks.
In the Foundation folder, replaced your aliases of AppKit, Foundation,
Objective-J with my latest copies from Atlas.
Clicked on the index.html file.
Sample loads and works. (fonts display as a serif font, not like your
online example).

Now for Atlas I opened the project file.
Clicked Build and Run.

Atlas displays a vague dialog message:
"An error occured while building

No such file or directory."

meelash

unread,
Jan 20, 2010, 11:47:51 AM1/20/10
to Cappuccino & Objective-J
I'm not sure if this is the right way to get this working, but it
works:

The problem seems to be that building in Atlas only builds and copies
the official frameworks from the Frameworks directory.

To get around this, you can change the import statements, (both yours
and in the few LPKit sources that have imports from itself) to @import
"LPKit/.......j". Now, this will still not work by building in Atlas,
because Atlas seems to only get directories copied to the built
directory if they are in the Resources folder.

So, add LPKit directory to resources, and go through all your files
and LPKit's files replacing @import <LPKit/etc.j> with @import
"Resources/LPKit/etc.j"

Now Build and Run should work.

luddep

unread,
Jan 20, 2010, 12:09:05 PM1/20/10
to Cappuccino & Objective-J
> In the Foundation folder, replaced your aliases of AppKit, Foundation,

Be sure to use the latest cappuccino frameworks (built from source,
*not* downloaded with atlas).
LPKit is quite bleeding edge, but as soon as the next point version of
cappuccino is released, I'll put up a compiled 0.1 version.

Meelash, There's no need for that.
I placed the already built LPKit (just run jake in its directory, or
copy the files from the .zip I linked) in Frameworks/, and it compiled
without any problems.

meelash

unread,
Feb 9, 2010, 11:47:13 AM2/9/10
to Cappuccino & Objective-J
heh, I had actually given up on this because I didn't want to bother
you with something obvious, but I just happened to stumble across what
I was doing wrong. I forgot to copy LPKit to Frameworks/Debug and I
was building in debug mode, hence it was not working....

On Jan 20, 12:09 pm, luddep <lud...@gmail.com> wrote:
> > In the Foundation folder, replaced your aliases of AppKit, Foundation,
>
> Be sure to use the latest cappuccino frameworks (built from source,
> *not* downloaded with atlas).
> LPKit is quite bleeding edge, but as soon as the next point version of
> cappuccino is released, I'll put up a compiled 0.1 version.
>
> Meelash, There's no need for that.
> I placed the already built LPKit (just run jake in its directory, or
> copy the files from the .zip I linked) in Frameworks/, and it compiled
> without any problems.
>

> On Jan 20, 5:47 pm,meelash<meel...@gmail.com> wrote:
>
>
>
> > I'm not sure if this is the right way to get this working, but it
> > works:
>
> > The problem seems to be that building in Atlas only builds and copies
> > the official frameworks from the Frameworks directory.
>
> > To get around this, you can change the import statements, (both yours
> > and in the few LPKit sources that have imports from itself) to @import
> > "LPKit/.......j". Now, this will still not work by building in Atlas,
> > because Atlas seems to only get directories copied to the built
> > directory if they are in the Resources folder.
>
> > So, add LPKit directory to resources, and go through all your files
> > and LPKit's files replacing @import <LPKit/etc.j> with @import
> > "Resources/LPKit/etc.j"
>

> > NowBuildand Run should work.


>
> > On Jan 17, 5:03 pm, Dunkie <blairdun...@sympatico.ca> wrote:
>
> > > Hmmm, I suspect I'm still missing something.
>
> > > I downloaded your zipped file.
> > > Clicked on the index.html file - nothing loads due to missing
> > > frameworks.
> > > In the Foundation folder, replaced your aliases of AppKit, Foundation,
> > > Objective-J with my latest copies from Atlas.
> > > Clicked on the index.html file.
> > > Sample loads and works. (fonts display as a serif font, not like your
> > > online example).
>
> > > Now for Atlas I opened the project file.

> > > ClickedBuildand Run.


>
> > > Atlas displays a vague dialog message:
> > > "An error occured while building
>
> > > No such file or directory."
>

> > > On Jan 17, 4:27 pm,luddep<lud...@gmail.com> wrote:
>
> > > > Here is an example app that runs LPKit alongside atlas:
>
> > > >http://cloud.github.com/downloads/luddep/LPKit-Examples/LPKit-Atlas.zip
>
> > > > It's using a built version of LPKit as well as symlinked (capp gen -l -
> > > > f --force) frameworks, which in turn is built from the latest jake
> > > > branch.
>
> > > > Hope this helps,
> > > > Ludwig
>
> > > > On Nov 21 2009, 6:17 pm, Dunkie <blairdun...@sympatico.ca> wrote:
>
> > > > > That seems to have done it, thanks.
>
> > > > > Still seems to be something missing to get it to work in Atlas as now
> > > > > the fonts on the calendar have changed to serif font which is
> > > > > different from the sample.
>
> > > > > Here is what I've done.
> > > > > Created a new cib project in Atlas.
>
> > > > > Dropped the LPAristo folder (from the new Nov 21 example on git) into
> > > > > the new projects folder.
> > > > > Dropped the LPKit folder (from the Nov 7 version on git) into the new
> > > > > projects Frameworks folder
> > > > > Dropped the AppController.j from the new Nov 21 example into the new
> > > > > projects folder.
> > > > > Opened the new project in Atlas.

> > > > >Buildand Run.

Reply all
Reply to author
Forward
0 new messages