At first, install scim and your favorite input-method engines from pkg.opensolaris.org, you could list the available scim packages, by
$ pkg list -a SUNWscim*. For nevada users, you need select the scim metacluster in installer.
Then, edit your $HOME/.profile to export the GTK_IM_MODULE to scim, and re-login
$ cat >> ~/.profile << EOF
> export GTK_IM_MODULE
To switch back to iiim, you could simply comment out the above lines in your $HOME/.profile, and re-login.