Hamish Mackenzie | 7 Apr 2013 20:57
Picon

Some Gtk 3 + Cairo support

I have pushed a patch to https://patch-tag.com/r/hamish/gtk2hs/home that
adds the missing "draw" event needed to use cairo.  It uses the cairo
"Render" monad.

You should be able to replace "onExpose" events with something like...

    someWidget `on` draw $ do
      moveTo 0 0 
      lineTo 10 10

The patch also adds "Region" and "RectangleInt" cairo types.

If you have time, please try it out and let me know if it works
ok for you.

Thanks,
Hamish

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
Karl Smeltzer | 18 Mar 2013 19:56
Picon

Idiomatic way to draw with Cairo and GTK3?

I'm still a bit of a rookie when it comes to GTK and Cairo, so please
bear with me.  I have some code that works with GTK2, but would like
to bring it up to date.

Most everything I've figured out, except the best way to replace the
`renderWithDrawable` function.  If I have a DrawingArea (or the
corresponding DrawWindow) what is the best way to draw to it directly?
 I see various bits of information about a "draw" callback and
surfaces, but nothing that has been entirely clear to me.

Thanks in advance.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
Hristo Asenov | 16 Mar 2013 20:35
Picon
Favicon
Gravatar

link

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Hamish Mackenzie | 7 Mar 2013 07:45
Picon

Re: Announce: Leksah 0.13.2.0 (still a bit experimental)

I am not able to reproduce this on my Ubuntu 12.10 VM.

What version of GHC are you using?
Do you have anything in your ~/.ghci file?
What command are you running?
Does putStrLn "Hello World" work?
What is the active .cabal project?

The GHCi interface is sensitive to changes in the way GHCi formats it output, so it is a bit fragile.   Some things that will currently break it are...
 * Anything that tries to read input on stdin
 * :set prompt (Leksah uses the prompt to detect when the output finishes)

I added some tests a while back to try to catch issues running GHCi.  Can you please try this...

cd leksah/vendor/leksah-server
cabal install --enable-tests --force-reinstall

You should see this near the end...

Running 1 test suites...
Test suite test-tool: RUNNING...
Test suite test-tool: PASS
Test suite logged to: dist/test/leksah-server-0.13.0.0-test-tool.log
1 of 1 test suites (1 of 1 test cases) passed.

Thanks,
Hamish

On 7 Mar 2013, at 08:48, Alejandro Toribio Bello Ruiz <alejandro.bello67 <at> gmail.com> wrote:

Leksah 0.13.2 compiled successfully on Ubuntu 12.10 following the new instructions on .travis.yml, but arise the old problem where the GHCi integration break when the first command set is from the debug scratch pane. This bug was fixed on Leksah 0.12.1.3. What happened? This issue is very import for my students. Would be very grateful if you fix this bug.

Regards

El viernes, 1 de marzo de 2013 23:04:59 UTC-5, Hamish escribió:
12.10 uses webkit 1.10 so the -fwebkit1.8 was probably tripping it up.

I have updated webkit so that webkit 1.8 is detected automatically and
updated the .travis.yml file.

Please try again.

On 23 Feb 2013, at 06:20, alejandr... <at> gmail.com wrote:

I compiled Leksah 0.13.2 using Ubuntu 12.04 (I followed the instructions on .travis.yml). It was OK, but when I tried to compile with Ubuntu 12.10, I got the following error:

  Building webkit-0.12.5...
  Preprocessing library webkit-0.12.5...
  gtk2hsC2hs: Errors during expansion of binding hooks:

  webkit1.8/Graphics/UI/Gtk/WebKit/DOM/File.chs:17: (column 14) [ERROR]
    >>> Unknown identifier!
    Cannot find a definition for `webkit_dom_file_get_file_name' in the header file.
  webkit1.8/Graphics/UI/Gtk/WebKit/DOM/File.chs:23: (column 16) [ERROR]
    >>> Unknown identifier!
    Cannot find a definition for `webkit_dom_file_get_file_size' in the header file.

 Can you help me, please?

Alejandro T. Bello Ruiz


--
You received this message because you are subscribed to the Google Groups "leksah" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leksah+un... <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
You received this message because you are subscribed to the Google Groups "leksah" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leksah+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Hamish Mackenzie | 2 Mar 2013 05:04
Picon

Re: Announce: Leksah 0.13.2.0 (still a bit experimental)

12.10 uses webkit 1.10 so the -fwebkit1.8 was probably tripping it up.

I have updated webkit so that webkit 1.8 is detected automatically and
updated the .travis.yml file.

Please try again.

On 23 Feb 2013, at 06:20, alejandro.bello67 <at> gmail.com wrote:

I compiled Leksah 0.13.2 using Ubuntu 12.04 (I followed the instructions on .travis.yml). It was OK, but when I tried to compile with Ubuntu 12.10, I got the following error:

  Building webkit-0.12.5...
  Preprocessing library webkit-0.12.5...
  gtk2hsC2hs: Errors during expansion of binding hooks:

  webkit1.8/Graphics/UI/Gtk/WebKit/DOM/File.chs:17: (column 14) [ERROR]
    >>> Unknown identifier!
    Cannot find a definition for `webkit_dom_file_get_file_name' in the header file.
  webkit1.8/Graphics/UI/Gtk/WebKit/DOM/File.chs:23: (column 16) [ERROR]
    >>> Unknown identifier!
    Cannot find a definition for `webkit_dom_file_get_file_size' in the header file.

 Can you help me, please?

Alejandro T. Bello Ruiz


--
You received this message because you are subscribed to the Google Groups "leksah" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leksah+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Karl Smeltzer | 22 Feb 2013 23:15
Picon

GHCi, runhaskell, and runghc failing

I'm using the latest darcs code to get GTK3 support on OSX (very
excited to see this hit Hackage!) and would like to improve my
workflow a bit.  If I compile using "ghc --make" then everything works
great, but using GHCi, runhaskell, and runghc all produce an empty
window.  Nothing is ever rendered and the process seems to hang.

Does anyone know a way around this?

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
Max | 7 Feb 2013 16:50
Picon

icon problem

Hello.

I'm trying to use icon for my widget:

thingy <- hBoxNew False 2
ico <- imageNewFromFile "~/.cache/icons/junk.ico"
silly <- labelNew (Just "silly name")
boxPackStart thingy ico PackNatural 1
boxPackStart thingy silly PackGrow 0
widgetShowAll thingy

It almost works - widget elements are in the right places, text is displayed but
instead of my icon I see the generic icon from my gtk theme. It seems like icon
loading failed for some reason but how do I troubleshoot that?

I've checked the icon file - it's there and it's correct. Is there way to know what
exactly imageNewFromFile is unhappy about?

I see following error in console:
Gtk-CRITICAL **: gtk_box_pack: assertion `child->parent == NULL' failed

but I'm not sure how to relate it to particular place in my code :(

I'm not even sure if this error related at all - upon app exit I got another one:
Gtk-CRITICAL **: IA__gtk_window_group_remove_window: assertion `window->group ==
window_group' failed

and it doesn't make any sense either.

cheers,
Max.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
Hamish Mackenzie | 2 Feb 2013 17:48
Picon

Announce: Leksah 0.13.2.0 (still a bit experimental)

Version Control
---------------
Harald and Stephan's Version Control integration has been
merged in!  If you want to help out on this there are still some
cool things that could be added.  I for one would love something
to show my changes vs. the repo as I edit.

Harald and Stephan also added a number of other nice UI
changes.  Unfortunately I do not have a list (but my favourite
is that selecting some text highlights other occurrences).

Better Haddock and GHCi support
-------------------------------
While writing documentation for jsc, I made a few changes to
help make writing Haddock docs easier....

 * Documentation pane - New pane that uses WebKit to display
   your packages Haddock docs (Package -> Open Documentation).

 * Auto build Haddock docs - If you click the tick button
   on the toolbar it will automatically build your docs
   and reload the Documentation pane while you edit your
   code.  If you have background build switched off then
   Ctrl+B will run tests and build docs if the tick is on.

 * Auto run - While you are in GHCi mode background build
   will also reevaluate the last expression sent to GHCi
   with Ctrl+Enter (also works with Ctrl+B if you have
   background build off).

 * Haddock & Ctrl+Enter - Haddock code block comments
   ( -- > and -- >>> ) are removed before the current
   line or selected text is sent to GHCi.

 * Support for choosing which executable or test suite GHCi
   should run (expand the package in the workspace pane
   to see the list and activate the one you want to
   load in GHCi).

Hop on #leksah if you have any questions. 

OS X
----
Sorry, I am still having trouble building WebKitGTK+ on OSX.

If you want a challenge...
https://github.com/jralls/gtk-osx-build
https://github.com/leksah/leksah/blob/master/osx/gtk.sh

Alternatively we might have to build Leksah with -f-webkit
to leave out the webkit stuff.

Windows
-------
Choose the version that matches your installed GHC
http://leksah.org/packages/leksah-0.13.2.0-ghc-7.0.3.exe
http://leksah.org/packages/leksah-0.13.2.0-ghc-7.0.4.exe
http://leksah.org/packages/leksah-0.13.2.0-ghc-7.4.1.exe
http://leksah.org/packages/leksah-0.13.2.0-ghc-7.4.2.exe
http://leksah.org/packages/leksah-0.13.2.0-ghc-7.6.1.exe

Linux
-----
Follow the steps in the .travis.yml file...
https://github.com/leksah/leksah/blob/master/.travis.yml
Should go something like this...
https://travis-ci.org/leksah/leksah

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Hamish Mackenzie | 2 Feb 2013 03:18
Picon

Gtk3 Patches

Hi,

I want to do a release of Leksah to Hackage that uses Gtk3 and WebKit (preferably in the next week or two).

This will need the following patches:
http://leksah.org/gtksourceview3.patches (repo still seems to be darcs1)

Although these packages default to gtk3 you can still use them with gtk2 (cabal install -f-gtk3)

I think we have three options:
 1) Push the Gtk3 patches into the Gtk2Hs repo in preparation for a regular release (perhaps 0.13.0).
 2) Create a new repo for them and release it as gtk on Hackage (version 1.0.0 or 0.13.0) and continue merging 0.12 repo changes in.
 3) Add gtk-gtk3, gtksourceview-gtk3 and webkit-gtk3 to Hackage.

Please can we start the ball rolling on option 1 or can you let me know which of the other two options you would prefer?

Thanks,
Hamish


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Axel Simon | 31 Jan 2013 13:21
Picon
Favicon

Re: About gtk3hs

Hi all,

first off, I think it's great if people are looking into using  
introspection to get Gtk2Hs up to date again.

On 31.01.2013, at 10:55, Luca Bruno wrote:

> Is the plan to use haskell-gi to replace most of the gtk2hs
> package/repo (or will there be a whole new gtk3hs package/repo)?  If
> the changes will be in the gtk2hs package/repo, will adding these Gtk3
> patches as well make it harder to port to GI?  (If so we might need to
> have a temporary fork gtk2hs-gtk3 or gtk2hs-leksah in Hackage so we
> can get the Gtk3 fixes into Leksah).
>
> As far as I know, the gtk2 annotations are not very good, I would  
> discard it. For what concerns gtk3, haskell-gi generates a Gtk3.hs,  
> so I think that would be a completely different repo. For pygobject  
> and javascript there's no separate repo, because they load the  
> typelib at runtime.
>

The docs are sometimes off in Gtk2Hs but a lot of the stuff is also a  
bit different and Haskellized. It would be shame to lose that.

> In general, this is how it should work:
> 1) haskell-gi reads the typelib or gir (currently the typelib) for a  
> library.
> 2) It reads an additional metadata/override file for possible custom  
> functions or fixes. This is not done yet in haskell-gi, but it's  
> done in other languages, seehttp://git.gnome.org/browse/pygobject/tree/gi/overrides 
>  and http://git.gnome.org/browse/vala/tree/vapi/metadata
> 3) Merge the two and produce the bindings Foo.hs ready to be  
> compiled and used.

Duncan once made a binding tool that tried to parse in the  
current .chs files and then added new bindings that weren't already  
defined. That way, he managed to mix the the metadata/override file  
with the result. The way it worked was that the tool would generate  
the source for a function in memory, compute a hash value and if, the  
function wasn't defined in the .chs module yet, it would add it,  
including the hash value.

The function can then be changed by hand. If the tool sees this  
modified function with the same hash code that it computed for the  
generated version, it leaves the function alone. Only if the function  
changes in Gtk3 (and thus the hash code is new), the new version  
replaces the old.

The code for doing this is already in the Gtk2Hs repository. In case  
you feel comfortable with this concept, you would have a starting point.

One thing that often has evaded the automatic generation is memory  
management. Most functions obey a convention in that a _new function  
returns a pointer on which sink() without ref() has to be called (or  
similar) while other functions that return objects must be wrapped  
with a function that does a ref(). Sometimes this is different  
(especially some functions take over ownership of an object, in which  
case ref() has be called before the object is passed to the function).  
I hope this is all conveyed in the introspection data.

Cheers,
Axel

>

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Hamish Mackenzie | 31 Jan 2013 02:38
Picon

Re: About gtk3hs

On 31 January 2013 10:31, Luca Bruno <lethalman88 <at> gmail.com> wrote:
> On Wed, Jan 30, 2013 at 6:20 PM, Hamish Mackenzie
> <hamish.k.mackenzie <at> gmail.com> wrote:
>>
>> If it is Gtk3 support you are after there are patches here...
>>
>> https://patch-tag.com
>
>
> I thought gtk3 and everything else was about GI. I'm a vala developer, and
> we switched to using GI and most of the annotations are reliable and GI even
> fixed some bugs in the old gtk2 and gtk3 bindings. Not to say that gtk3 has
> new widgets, deprecates old symbols, and you would benefit from a whole
> number of other libraries such as clutter, gstreamer and webkitgit having it
> always up-to-date.
> As far as I can see, are you handwriting the .chs files? Because GI would be
> right about not writing those stuff manually.
> So I'm looking after a gtk3hs + everything else with haskell-gi. The docs
> would obviously not be precise as the current ones, but I personally always
> refer to the original C docs in any case.

Sure, haskell-gi will be awesome!  These patches were just a "while we
wait" solution.  I was not sure if you were just looking for a quick
way to get your gtk2hs app to work with Gtk3 right now (sorry for the
confusion).

Gtk3 fixed a number of bugs we had in Leksah, and a few patches to the
Gtk2Hs source seemed like the quickest way to port Leksah to Gtk3.
But we will of course switch to the haskell-gi solution when it is
ready.

How close is haskell-gi to being ready?  (I have not tried it in a while).

I have also added all the DOM functions to webkit by processing the
WebKit IDL files
https://patch-tag.com/r/hamish/webkit/home

And wavewave made bindings for JavaScriptCore
https://github.com/ghcjs/webkit-javascriptcore

Do you know if GI will cover both of these?

Is the plan to use haskell-gi to replace most of the gtk2hs
package/repo (or will there be a whole new gtk3hs package/repo)?  If
the changes will be in the gtk2hs package/repo, will adding these Gtk3
patches as well make it harder to port to GI?  (If so we might need to
have a temporary fork gtk2hs-gtk3 or gtk2hs-leksah in Hackage so we
can get the Gtk3 fixes into Leksah).

Hamish

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan

Gmane