Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  gcNew with simple draw example haskell gtk (Berlin Brown)
   2.  Cabal install woes (Tom Murphy)
   3. Re:  gcNew with simple draw example haskell gtk (David McBride)
   4. Re:  Cabal install woes (Andres Loeh)
   5. Re:  Cabal install woes (Daniel Fischer)
   6. Re:  Cabal install woes (Tom Murphy)


----------------------------------------------------------------------

Message: 1
Date: Sat, 12 Mar 2011 15:37:58 -0500
From: Berlin Brown <berlin.br...@gmail.com>
Subject: [Haskell-beginners] gcNew with simple draw example haskell
        gtk
To: beginners@haskell.org
Message-ID:
        <AANLkTin3p9ksTo=nmf+ct9jmxd85-yy3k9qfwh07z...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I am trying to draw a simple pixel with gtk/haskell.  This is the code, but
I get an error.

GHC 6.12.3? with the most recent gtk library.

Error:

# ghc --make SimpleCells.hs
[1 of 1] Compiling Main             ( SimpleCells.hs, SimpleCells.o )

Graphics\UI\Gtk\Misc\DrawingArea.chs:22:10: Not in scope: `gcNew'


-----

import Graphics.UI.Gtk

renderScene d ev = do
dw  <- widgetGetDrawWindow d
(w,h) <- widgetGetSize d
gc    <- gcNew dw
return True

main = do
initGUI
window  <- windowNew
drawing <- drawingAreaNew
onExpose drawing (renderScene drawing)
 window `onDestroy` mainQuit
windowSetDefaultSize window 800 600
windowSetPosition window WinPosCenter
widgetShowAll window
mainGUI

-- 
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110312/25671151/attachment-0001.htm>

------------------------------

Message: 2
Date: Sat, 12 Mar 2011 16:35:47 -0500
From: Tom Murphy <amin...@gmail.com>
Subject: [Haskell-beginners] Cabal install woes
To: beginners@haskell.org
Message-ID:
        <AANLkTikX5D9zAj3v5s=j00q=jmgt0l0ckcx_ukfb3...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi everyone,
   I'm having Cabal problems. Any help would really be appreciated.

   When I try:

"cabal install soegtk"
or
"cabal install gtk"
or
"cabal install glib"



   I get the error (abridged):
"
Cannot find gtk2hsC2hs
Please install `gtk2hs-buildtools` first and check that the install
directory is in your PATH (e.g. HOME/.cabal/bin).

[...]

gio-0.12.0 depends on glib-0.12.0 which failed to install.
glib-0.12.0 failed during the configure step. The exception was:
exit: ExitFailure 1
[...]
"


   But:
gtk2hsC2hs and gtk2hs-buildtools ARE where they're supposed to be
(gtk2hsC2hs is in ~/.cabal/bin, and gtk2hs-buildtools is in
~/.cabal/share).


   A possibly related issue is that when I run "cabal update" it tells
me my Cabal isn't the newest version. I successfully run "cabal
install cabal-install", then do "cabal update" and get the same
message again.


   As a side question, is there a good resource about Cabal in greater
detail than a how-to? I'm looking for, say, what ARE the executables
in .cabal/bin? How do they relate to packages loaded in ghci?


Thanks for your time!
Tom



------------------------------

Message: 3
Date: Sat, 12 Mar 2011 16:40:54 -0500
From: David McBride <dmcbr...@neondsl.com>
Subject: Re: [Haskell-beginners] gcNew with simple draw example
        haskell gtk
To: beginners@haskell.org
Message-ID:
        <AANLkTi=Wyoq5+BZ4t4Z4f29=-yclyi4kknbg0sncz...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

try: import Graphics.UI.Gtk.Gdk.GC

If you can't find a function, try searching on hayoo (at hackage.haskell.org).

On Sat, Mar 12, 2011 at 3:37 PM, Berlin Brown <berlin.br...@gmail.com> wrote:
> I am trying to draw a simple pixel with gtk/haskell. ?This is the code, but
> I get an error.
> GHC 6.12.3? with the most recent gtk library.
> Error:
> # ghc --make SimpleCells.hs
> [1 of 1] Compiling Main ? ? ? ? ? ? ( SimpleCells.hs, SimpleCells.o )
> Graphics\UI\Gtk\Misc\DrawingArea.chs:22:10: Not in scope: `gcNew'
>
> -----
> import Graphics.UI.Gtk
> renderScene d ev = do
> dw ?<- widgetGetDrawWindow d
> (w,h) <- widgetGetSize d
> gc ? ?<- gcNew dw
> return True
> main = do
> initGUI
> window ?<- windowNew
> drawing <- drawingAreaNew
> onExpose drawing (renderScene drawing)
> window `onDestroy` mainQuit
> windowSetDefaultSize window 800 600
> windowSetPosition window WinPosCenter
> widgetShowAll window
> mainGUI
> --
> Berlin Brown (berlin dot brown at gmail.com)
> http://botnode.com
> http://berlinbrowndev.blogspot.com/
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>



------------------------------

Message: 4
Date: Sat, 12 Mar 2011 22:53:27 +0100
From: Andres Loeh <andres.l...@googlemail.com>
Subject: Re: [Haskell-beginners] Cabal install woes
To: Tom Murphy <amin...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <AANLkTi=7iQhyA5GAOFXb47NOMbhJt7xK8rwt8MoVBpX=@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi Tom.

> Please install `gtk2hs-buildtools` first and check that the install
> directory is in your PATH (e.g. HOME/.cabal/bin).

The most likely explanation for your problems seems to be that while
you have the buildtools installed, you haven't actually added
$HOME/.cabal/bin to your search path, so it isn't found by cabal. This
might also hold for the new version of cabal-install you installed,
which installs a "cabal" binary to $HOME/.cabal/bin. But if you don't
have that in your search path, and have another "cabal" binary
installed in, say /usr/bin, then you'll still run the old version and
get the message about the newer version again.

Cheers,
  Andres



------------------------------

Message: 5
Date: Sat, 12 Mar 2011 23:33:01 +0100
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] Cabal install woes
To: beginners@haskell.org
Message-ID: <201103122333.01763.daniel.is.fisc...@googlemail.com>
Content-Type: Text/Plain;  charset="iso-8859-1"

On Saturday 12 March 2011 22:53:27, Andres Loeh wrote:
> Hi Tom.
> 
> > Please install `gtk2hs-buildtools` first and check that the install
> > directory is in your PATH (e.g. HOME/.cabal/bin).
> 
> The most likely explanation for your problems seems to be that while
> you have the buildtools installed, you haven't actually added
> $HOME/.cabal/bin to your search path, so it isn't found by cabal.

A common mistake would be to add it in the form

export PATH="~/.cabal/bin:$PATH"

Many (most, I think) shells don't do tilde expansion in quoted strings, so 
you'd have a literal '~' in your PATH. That's no problem if it's passed to 
a shell, but other programmes usually don't do expansion for such strings.

If that's the case here, possible fixes are
- spelling it out
- using $HOME instead of ~
- not quoting

> This
> might also hold for the new version of cabal-install you installed,
> which installs a "cabal" binary to $HOME/.cabal/bin. But if you don't
> have that in your search path, and have another "cabal" binary
> installed in, say /usr/bin, then you'll still run the old version and
> get the message about the newer version again.

Also if the other cabal is in a place before $HOME/.cabal/bin in the PATH.



------------------------------

Message: 6
Date: Sat, 12 Mar 2011 19:25:36 -0500
From: Tom Murphy <amin...@gmail.com>
Subject: Re: [Haskell-beginners] Cabal install woes
To: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID:
        <aanlktiky+szok8yuoeb1uprydzon3rbjjeb6ddx_k...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Here's my new error message  (the "does not export" errors are new):


"
Resolving dependencies...

/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/Gtk2HsSetup.hs:25:0:
     warning: #warning Setup.hs is guessing the version of Cabal. If
compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal
version 1.x.0 when building (prefixed by --ghc-option= when using the
'cabal' command)
[1 of 2] Compiling Gtk2HsSetup      (
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/Gtk2HsSetup.hs,
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/dist/setup/Gtk2HsSetup.o
)

/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/Gtk2HsSetup.hs:48:2:
    Module
    `Distribution.Simple.PackageIndex'
    does not export
    `lookupPackageId'

/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/Gtk2HsSetup.hs:25:0:
     warning: #warning Setup.hs is guessing the version of Cabal. If
compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal
version 1.x.0 when building (prefixed by --ghc-option= when using the
'cabal' command)
[1 of 2] Compiling Gtk2HsSetup      (
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/Gtk2HsSetup.hs,
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/dist/setup/Gtk2HsSetup.o
)

/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/Gtk2HsSetup.hs:48:2:
    Module
    `Distribution.Simple.PackageIndex'
    does not export
    `lookupPackageId'
cabal: Error: some packages failed to install:
cairo-0.11.1 failed during the configure step. The exception was:
exit: ExitFailure 1
gio-0.11.1 depends on glib-0.11.2 which failed to install.
glib-0.11.2 failed during the configure step. The exception was:
exit: ExitFailure 1
gtk-0.11.2 depends on glib-0.11.2 which failed to install.
pango-0.11.2 depends on glib-0.11.2 which failed to install.
soegtk-0.11.1 depends on glib-0.11.2 which failed to install.
"


Also, here's my $PATH:
"
cm-macbookpro-3:bin colinmurphy$ $PATH
-bash: 
/.cabal/bin:~/.cabal/bin:/Users/colinmurphy/.cabal/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:
No such file or directory
"


Thanks for the help!
Tom



On Sat, Mar 12, 2011 at 5:33 PM, Daniel Fischer
<daniel.is.fisc...@googlemail.com> wrote:
> On Saturday 12 March 2011 22:53:27, Andres Loeh wrote:
>> Hi Tom.
>>
>> > Please install `gtk2hs-buildtools` first and check that the install
>> > directory is in your PATH (e.g. HOME/.cabal/bin).
>>
>> The most likely explanation for your problems seems to be that while
>> you have the buildtools installed, you haven't actually added
>> $HOME/.cabal/bin to your search path, so it isn't found by cabal.
>
> A common mistake would be to add it in the form
>
> export PATH="~/.cabal/bin:$PATH"
>
> Many (most, I think) shells don't do tilde expansion in quoted strings, so
> you'd have a literal '~' in your PATH. That's no problem if it's passed to
> a shell, but other programmes usually don't do expansion for such strings.
>
> If that's the case here, possible fixes are
> - spelling it out
> - using $HOME instead of ~
> - not quoting
>
>> This
>> might also hold for the new version of cabal-install you installed,
>> which installs a "cabal" binary to $HOME/.cabal/bin. But if you don't
>> have that in your search path, and have another "cabal" binary
>> installed in, say /usr/bin, then you'll still run the old version and
>> get the message about the newer version again.
>
> Also if the other cabal is in a place before $HOME/.cabal/bin in the PATH.
>



------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 33, Issue 13
*****************************************

Reply via email to