Eric | 2 Jun 2008 20:17
Favicon

gtk2hs for ghc 6.8.2

Dear all,

I am currently running GHC 6.8.2 and so cannot currently install the 
latest version of Gtk2hs. Does anyone know when a version that works 
with GHC 6.8.2 will be available?

Thanks,

Eric M.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Peter Gavin | 2 Jun 2008 20:19
Picon

Re: gtk2hs for ghc 6.8.2

Hi Eric,

Eric wrote:
> Dear all,
> 
> I am currently running GHC 6.8.2 and so cannot currently install the 
> latest version of Gtk2hs. Does anyone know when a version that works 
> with GHC 6.8.2 will be available?
> 

Soon.  We are waiting for ghc 6.8.3 to be released, after which a 
version compatible with both 6.8.2 and 6.8.3 will be released. For the 
time being, you can use the development tree at 
http://code.haskell.org/gtk2hs which will build under 6.8.2.

Pete

> Thanks,
> 
> Eric M.
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gtk2hs-users mailing list
> Gtk2hs-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
(Continue reading)

Duncan Coutts | 3 Jun 2008 00:40
Picon
Picon
Favicon

Re: gtk2hs for ghc 6.8.2


On Mon, 2008-06-02 at 19:17 +0100, Eric wrote:
> Dear all,
> 
> I am currently running GHC 6.8.2 and so cannot currently install the 
> latest version of Gtk2hs. Does anyone know when a version that works 
> with GHC 6.8.2 will be available?

If you're talking about building from source then the current release is
compatible with ghc-6.8.x (and in particular works with 6.8.2).

If you're talking about binary builds for windows with installers then I
have one built with/for ghc-6.8.2:
http://haskell.org/~duncan/gtk2hs/gtk2hs-0.9.12.1.exe

As Gavin says there will also be a new release soon along with a windows
installer for ghc-6.8.3.

Duncan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Eric | 3 Jun 2008 18:34
Favicon

Re: gtk2hs for ghc 6.8.2


Thank you! I've installed it and everything's working.

Eric

Duncan Coutts wrote:
> On Mon, 2008-06-02 at 19:17 +0100, Eric wrote:
>   
>> Dear all,
>>
>> I am currently running GHC 6.8.2 and so cannot currently install the 
>> latest version of Gtk2hs. Does anyone know when a version that works 
>> with GHC 6.8.2 will be available?
>>     
>
> If you're talking about building from source then the current release is
> compatible with ghc-6.8.x (and in particular works with 6.8.2).
>
> If you're talking about binary builds for windows with installers then I
> have one built with/for ghc-6.8.2:
> http://haskell.org/~duncan/gtk2hs/gtk2hs-0.9.12.1.exe
>
> As Gavin says there will also be a new release soon along with a windows
> installer for ghc-6.8.3.
>
> Duncan
>
>
>
>   
(Continue reading)

Hristo Asenov | 15 Jun 2008 01:44
Picon
Favicon
Gravatar

getting the listStore out of tree view

Hello, I am new to gtk and haskell. I have already gotten to the point of filling a a tree view with objects, but now need to get the contents of a row when I click on it. In other words, everytime I right-click on a row, it is highlighted and a menu pops up, then when I select that menu, I want to access the list under which I have selected. I have found a tutorial for C in http://scentric.net/tutorial/treeview-tutorial.html and says to use gtk_tree_model_get but I haven't been able to find that function. The closest I have found is treeModelGetValue, which returns a Ge nericValue, but I don't think I'm supposed to work with it. It also asks for an Int, which is a column num, but when I try to do it, it says that it is invalid. I can get a reference both to treePath and treeIter, but I can't do anything with them. Could someone let me know what function I need to use?
                                                                                      Hristo Asenov

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Duncan Coutts | 16 Jun 2008 11:10
Picon
Picon
Favicon

Re: getting the listStore out of tree view


On Sat, 2008-06-14 at 16:44 -0700, Hristo Asenov wrote:
> Hello, I am new to gtk and haskell. I have already gotten to the point
> of filling a a tree view with objects, but now need to get the
> contents of a row when I click on it. In other words, everytime I
> right-click on a row, it is highlighted and a menu pops up, then when
> I select that menu, I want to access the list under which I have
> selected. I have found a tutorial for C in
> http://scentric.net/tutorial/treeview-tutorial.html and says to use
> gtk_tree_model_get but I haven't been able to find that function. The
> closest I have found is treeModelGetValue, which returns a
> GenericValue, but I don't think I'm supposed to work with it. It also
> asks for an Int, which is a column num, but when I try to do it, it
> says that it is invalid. I can get a reference both to treePath and
> treeIter, but I can't do anything with them. Could someone let me know
> what function I need to use?

The answer is to keep a reference to the underlying model rather than
trying to recover it using treeViewGetModel. The reason is that
treeViewGetModel can only get you a generic TreeModel and not the
specific type ListStore etc. Yes it is possible to get info out of a
TreeModel but as you see it is not a convenient typed interface and has
to go via the variant type GenericValue.

So when you construct the list store, keep hold of it. Set it as the
model for the tree view to use, but keep the list store too so that you
can use the convenient list store api.

Duncan

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Hristo Asenov | 16 Jun 2008 23:16
Picon
Favicon
Gravatar

Re: getting the listStore out of tree view

You know, I did pass the reference of the model and was thinking of using that at one point, but got confused when I searched "listStoreNew" on hoogle and came up with the one in Graphics.UI.Gtk.TreeList.ListStore, and couldn't find any function that could get its value. When you mentioned that listStore can be used, I looked under Graphics.UI.Gtk.ModelView.ListStore and found "listStoreGetValue", which I can use with my reference to TreePath. I tried it out and it worked. Thanx,
        &n bsp;                                                                          Hristo

--- On Mon, 6/16/08, Duncan Coutts <duncan.coutts <at> worc.ox.ac.uk> wrote:
From: Duncan Coutts <duncan.coutts <at> worc.ox.ac.uk>
Subject: Re: [Gtk2hs-users] getting the listStore out of tree view
To: njvsny <at> yahoo.com
Cc: gtk2hs-users <at> lists.sourceforge.net
Date: Monday, June 16, 2008, 5:10 AM

On Sat, 2008-06-14 at 16:44 -0700, Hristo Asenov wrote:
> Hello, I am new to gtk and haskell. I have already gotten to the point
> of filling a a tree view with objects, but now need to get the
> contents of a row when I clic k on it. In other words, everytime I
> right-click on a row, it is highlighted and a menu pops up, then when
> I select that menu, I want to access the list under which I have
> selected. I have found a tutorial for C in
> http://scentric.net/tutorial/treeview-tutorial.html and says to use
> gtk_tree_model_get but I haven't been able to find that function. The
> closest I have found is treeModelGetValue, which returns a
> GenericValue, but I don't think I'm supposed to work with it. It
also
> asks for an Int, which is a column num, but when I try to do it, it
> says that it is invalid. I can get a reference both to treePath and
> treeIter, but I can't do anything with them. Could someone let me know
> what function I need to use?

The answer is to keep a reference to the underlying model rather than
trying to recover it using treeViewGetModel. The reason is that
treeViewGetM odel can only get you a generic TreeModel and not the
specific type ListStore etc. Yes it is possible to get info out of a
TreeModel but as you see it is not a convenient typed interface and has
to go via the variant type GenericValue.

So when you construct the list store, keep hold of it. Set it as the
model for the tree view to use, but keep the list store too so that you
can use the convenient list store api.

Duncan

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Bulat Ziganshin | 19 Jun 2008 19:01
Picon

unicode in fileChooserSetFilename/fileChooserGetFilename

Hello all

functions fileChooserSetFilename and fileChooserGetFilename use UTF-8
filename encoding instead of built-in GHC Unicode support

reported on mingw ghc 6.6.1 with gtk2hs 0.9.11.3 (last official release)

--

-- 
Best regards,
 Bulat                          mailto:Bulat.Ziganshin <at> gmail.com

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Duncan Coutts | 19 Jun 2008 23:04
Picon
Picon
Favicon

Re: unicode in fileChooserSetFilename/fileChooserGetFilename


On Thu, 2008-06-19 at 21:01 +0400, Bulat Ziganshin wrote:
> Hello all
> 
> functions fileChooserSetFilename and fileChooserGetFilename use UTF-8
> filename encoding instead of built-in GHC Unicode support
> 
> reported on mingw ghc 6.6.1 with gtk2hs 0.9.11.3 (last official release)

Good point.

Here's a patch. I've also sent a darcs patch to the -devel list.

Duncan

Thu Jun 19 21:51:21 BST 2008  Duncan Coutts <duncan <at> haskell.org>
  * Use UTF8 filenames on windows for file selector
  On Windows, gtk_file_chooser_set/get_filename always use UTF8
  so we should encode/decode as such. Reported by Bulat Ziganshin.
diff -rN -u old-gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp
new-gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp
--- old-gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp
2008-06-19 22:03:27.000000000 +0100
+++ new-gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp
2008-06-19 22:03:27.000000000 +0100
 <at>  <at>  -364,11 +364,13  <at>  <at> 
 fileChooserGetFilename self =
 #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0)
   {# call gtk_file_chooser_get_filename_utf8 #}
+    (toFileChooser self)
+ >>= maybePeek readUTF8String
 #else
   {# call gtk_file_chooser_get_filename #}
-#endif
     (toFileChooser self)
   >>= maybePeek readCString
+#endif

 -- | Sets  <at> filename <at>  as the current filename for the file chooser, by
changing
 -- to the file's parent folder and actually selecting the file in list.
If the
 <at>  <at>  -403,10 +405,11  <at>  <at> 
              -- file was selected successfully,  <at> False <at>  otherwise.
 fileChooserSetFilename self filename =
   liftM toBool $
-  withCString filename $ \filenamePtr ->
 #if defined (WIN32) && GTK_CHECK_VERSION(2,6,0)
+  withUTF8String filename $ \filenamePtr ->
   {# call gtk_file_chooser_set_filename_utf8 #}
 #else
+  withCString filename $ \filenamePtr ->
   {# call gtk_file_chooser_set_filename #}
 #endif
     (toFileChooser self)

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Mark Wassell | 21 Jun 2008 14:14
Picon

Mouse and Keyboard events with OpenGL canvas.

Can anyone offer any guidance on how to register handlers for  mouse and 
keyboard events with the OpenGL canvas. Registering handlers as I did 
with vanilla OpenGL:

keyboardMouseCallback $= Just ....

leads to a message "getCallbackID: no current window" and the program to 
terminate. I have tried

canvas <- GtkGL.glDrawingAreaNew glconfig
Gtk.onKeyPress canvas handleKeyEventGtk

No error occurs but neither does any event handling. I have also tried 
to use the OpenGL style but wrap glDrawableGLBegin GLEnd

GtkGL.glDrawableGLBegin glWin glContext
keyboardMouseCallback $= Just ....
GtkGL.glDrawableGLEnd glWin

but still get the first call back error. This area doesn't seem to be 
covered by any of the sample programs or documentation that I have 
looked over.

Cheers

Mark

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Gmane