Apple touch inconsistency

by hitesh on 2009-12-30

Apple is really known for their user interface design. I'd say they generally have a lot more hits than misses, but one miss recently came as a surprise for me.

Take an iPhone, go to the Settings screen. Scroll the screen with your finger. Notice that the text moves in the direction of your fingers and the scrollbar moves in the opposite direction. The paradigm is that your finger is controlling the text, directly moving it. The scrollbar is just illustrative to let you know how far you are in the document.

Now take a Macbook or Macbook Pro with a multitouch trackpad. Use two fingers to scroll a webpage or other window that has a scrollbar. Notice that this time the text moves in the opposite direction of your stroke, while the scrollbar moves in the same direction as your fingers. The paradigm here is that your fingers control the scrollbar, which then inversely moves the text. One might say this method is indirect control.

So that's kind of strange. Two Apple devices using touch in entirely different and opposite ways. One going for direct control and the other indirect. This inconsistency could be Apple experimenting with touch user interface concepts or just be a result of legacy user interface design. But whatever the reason, they will someday have to make a choice.

As we head towards a future in which iPhone apps and OSX apps merge and play together on a singular device - possibly the fabled touch tablet - Apple will have to decide which of the touch paradigms will live on. Which one will it be?

Tags: osx, iphone, multitouch

Comments


Error installing Haskell X11 libs

by hitesh on 2008-11-05

I recently bought a new Macbook Pro and with the recent announcment of GHC 6.10.1, I thought it was time to install the latest GHC and libs. Previously I had some trouble installing the Haskell X11 libs on Leopard, but I thought something might have been borked on my old laptop. With this new one and starting from scratch, I hoped things would go smoothly. Twas not to be.

The X11 libraries are installed under /usr/X11/lib.

bash-3.2$ locate libX11
/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libX11.6.2.dylib
/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libX11.6.dylib
/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libX11.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.2.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.a
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.2.0.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.dylib
/opt/local/var/macports/sources/rsync.macports.org/release/ports/x11/xorg-libX11
/opt/local/var/macports/sources/rsync.macports.org/release/ports/x11/xorg-libX11/Portfile
/usr/X11/lib/libX11.6.2.0.dylib
/usr/X11/lib/libX11.6.dylib
/usr/X11/lib/libX11.dylib
/usr/X11/lib/libX11.la

I've fallen down and I can't get up

Here are some things I tried that didn't work.

It's a bit disappointing how different OSX is from the Linux distros. Yeah it doesn't suck like Windows, but even so I wish it weren't so different from Linux.

So what did work?

Just like in my previous article, using the LDFLAGS variable solves the problem.

bash-3.2$ export LDFLAGS=-L/usr/X11/lib; runhaskell Setup.hs configure

Setup.hs:3:0:
    Warning: In the use of `defaultUserHooks'
             (imported from Distribution.Simple):
             Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
             compatibility in which case you must stick with defaultUserHooks"
Warning: defaultUserHooks in Setup script is deprecated.
Configuring X11-1.4.4...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking whether to build Xinerama... yes
checking for egrep... grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating X11.buildinfo
config.status: creating include/HsX11Config.h
config.status: creating include/X11_extras_config.h

Tags: haskell, osx, x11

Comments


Error installing Haskell SDL-image

by hitesh on 2008-10-10

I really like OSX, except when I have to jump through extra hoops to install things on it versus Linux. The latest challenge was installing the Haskell SDL-image bindings on Leopard.

Configure would bomb right away, saying it couldn't find the libs even though I had them installed via MacPorts.

bash-3.2$ runhaskell Setup.lhs configure
Configuring SDL-image-0.5.2...
checking for sdl-config... /opt/local/bin/sdl-config
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for IMG_Load in -lSDL_image... no
configure: error: *** SDL_image lib not found! Get SDL_image from
http://www.libsdl.org/projects/SDL_image/index.html

bash-3.2$ locate SDL_image
/opt/local/include/SDL/SDL_image.h
/opt/local/lib/libSDL_image-1.2.0.1.5.dylib
/opt/local/lib/libSDL_image-1.2.0.dylib
/opt/local/lib/libSDL_image.a
/opt/local/lib/libSDL_image.dylib
/opt/local/lib/libSDL_image.la

So if you try using the same trick I did with installing Haskell X11 libs ...

bash-3.2$ export LDFLAGS=-L/opt/local/lib; runhaskell Setup.lhs configure
Configuring SDL-image-0.5.2...
checking for sdl-config... /opt/local/bin/sdl-config
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for IMG_Load in -lSDL_image... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating SDL-image.buildinfo
config.status: creating includes/HsSDLConfig.h
config.status: includes/HsSDLConfig.h is unchanged
bash-3.2$ runhaskell Setup.lhs build
Preprocessing library SDL-image-0.5.2...
Undefined symbols:
  "_ZCMain_main_closure", referenced from:
      _ZCMain_main_closure$non_lazy_ptr in libHSrts.a(Main.o)
  "___stginit_ZCMain", referenced from:
      ___stginit_ZCMain$non_lazy_ptr in libHSrts.a(Main.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
linking dist/build/Graphics/UI/SDL/Image/Version_hsc_make.o failed
command was: /opt/local/bin/ghc -optl-L/opt/local/lib -optl-lSDL_image dist/build/Graphics/UI/SDL/Image/Version_hsc_make.o -o dist/build/Graphics/UI/SDL/Image/Version_hsc_make

It gets further, but still fails. Now's the time to read the nice MACOSX file included with the distro. It tells you to write your own hsc2hs script to help it find certain dependencies on your system. For the most part the instructions are good, but for me it was still having trouble finding HsFFI.h. I had to add a cflag directive to make it work. So here is my myhsc2hs.

#!/bin/sh
# added include dir of /opt/local/lib/ghc-6.8.2/include
echo "/opt/local/bin/hsc2hs -v --cc=gcc --ld=gcc --cflag="-I/opt/local/lib/ghc-6.8.2/include" --lflag="-L/opt/local/lib -lSDLmain -framework AppKit -framework SDL" $@"
/opt/local/bin/hsc2hs -v --cc=gcc --ld=gcc --cflag="-I/opt/local/lib/ghc-6.8.2/include" --lflag="-L/opt/local/lib" --lflag="-lSDLmain" --lflag="-framework" --lflag="AppKit" --lflag="-framework" --lflag="SDL" "$@"

Tags: haskell, osx, sdl

Comments