Questions tagged [gtk2hs]

Gtk2Hs is a GUI library for Haskell based on Gtk+. Gtk+ is an extensive and mature multi-platform toolkit for creating graphical user interfaces.

Gtk2Hs is a GUI library for Haskell based on Gtk+. Gtk+ is an extensive and mature multi-platform toolkit for creating graphical user interfaces.

Gtk2Hs features:

  • Automatic memory management.
  • Nearly complete coverage of the Gtk+ API.
  • Unicode support.
  • Extensive reference documentation.
  • Support for Linux, Windows, MacOS X and Unix platforms.
  • Support for several related GtK+ and Gnome modules:
    • the Glade visual user interface builder.
    • the cairo vector graphics library.
    • rendering of SVG images using cairo (via librsvg)
    • the Gtk+ OpenGL extension.
    • GConf for storing application preferences.
    • SourceView, an editor widget with syntax highlighting.
    • the Mozilla browser rendering engine in a Gtk+ widget
  • An implementation of the Graphics.SOE API.

Gtk+ and Gtk2Hs are Free software liscenced under the GNU LGPL.

157 questions
2
votes
1 answer

gtk2hs: Unable to render combo box on Windows

My problem is very confusing to me because it occurs only on Windows (I am testing with XP). It all works perfectly on Linux. I am using gtkbuilder to load my layout. (in case it's important) route_input <- builderGetObject builder castToComboBox…
polson136
  • 151
  • 1
  • 10
2
votes
1 answer

Haskell GTK and Monad Transformers

I'm making and application with UI and I need to run code that is in a StateT and a ReaderT over IO, I'm using Graphics.UI.Gtk for the UI and I have the following problem: I need that when a certain button is clicked it calls a function that has…
chamini2
  • 2,820
  • 2
  • 24
  • 37
2
votes
0 answers

What are the limitations of buffer size of textBufferSetView in haskell using gtk?

What is the buffer size? I can set a buffer to take in VC "Cons" [VC "Z" [],VC "Cons" [VC "S" [VC "Z" []],VC "Cons" [VC "S" [VC "S" [VC "Z" []]],VC "Cons" [VC "S" [VC "S" [VC "S" [VC "Z" []]]],VC "Cons" [VC "S" [VC "S" [VC "S" [VC "S" [VC "Z"…
Stuart Paton
  • 291
  • 4
  • 13
2
votes
1 answer

GUI programming in Haskell - installation problems on Ubuntu

is there a GUI package that is still up-to-date? I tried installing both wxHaskell and gtk2hs today and both fail on dependencies I just cannot solve (wxHaskell cannot find some wxWidget libs and while trying the glade tutorial gtk2hs fails on a…
Random Dev
  • 51,810
  • 9
  • 92
  • 119
1
vote
2 answers

Will gtk2hs and wx ever build more reliably?

This is not a rant; it's a technical question. Haskell coders of all abilities seem to agree that building gtk is a huge hurdle. Even experts seem to cross their fingers when they cabal-install it. It's a large system with many components; the age…
amindfv
  • 8,438
  • 5
  • 36
  • 58
1
vote
1 answer

Printing with Gtk.Printing/cairo/pango in gtk2hs - Print-operations in Haskell

I am currently trying to print files or text (to a printer, not to a terminal etc.) in Haskell with gtk(2hs) using Graphics.UI.Gtk.Printing, Cairo and Pango. Code is the following: op <- printOperationNew on op printOptBeginPrint $ \context -> do …
forste
  • 1,103
  • 3
  • 14
  • 33
1
vote
1 answer

How to render diagrams in gi-gtk?

I want to render a diagram on top of a GUI written with gi-gtk. I tryed to use the defaultRender function from the Diagrams.Backend.Gtk but the compiler is complaining with : • Couldn't match expected type…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
1
vote
1 answer

What is the difference between gi-cairo and cairo libraries

I making a program to draw some vector graphics on top of a GTK program written with Haskell. I upgraded my program to the gi-gtk library in replacement of Gtk2Hs to benefit of Gtk3 and when I see tutorial/example about drawing in Gtk windows with…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
1
vote
2 answers

Drawing text on GTK's DrawingArea in Haskell

I have a DrawingArea onto which I can draw using primitives such as drawRectangle and drawLine. How do I draw text onto that area? I'm most interested in something that quickly outputs a single line of text. Graphics.UI.Gtk.Gdk.Drawable.layoutLine…
user12163
1
vote
2 answers

Haskell GTK, double buffering with primitives

With an example like this. How can I do 2d double buffering with gtk and haskell. I want to render primitives to an offscreen buffer and flip. This code only renders a pixel/rectangle. I want to add movement using a double buffered…
Berlin Brown
  • 11,504
  • 37
  • 135
  • 203
1
vote
1 answer

Can a Container be both drawn on and have components visible in gtk2hs?

I want draw on the background (like a rectangle or such) and then have it render the components on top of that. The components would be on top of what I drew. Is there a way to do this? Here's an example of the concept. This only displays the…
mentics
  • 6,852
  • 5
  • 39
  • 93
1
vote
1 answer

Diagrams and gtk2hs

I've been working on my summer research project, and I've been using the Diagrams library to draw graphs with edges, nodes. I'm simulating the spread of information throughout the graph, so my diagram is constantly updating discretely. I have all of…
1
vote
1 answer

How do I render a Cairo drawing to a printer in Haskell gtk2hs

I'm using the GTK3 build of gtk2hs. I have a Cairo drawing in the Render monad and I want to send it to a printer. I see that there is a Surface type which encapsulates the Cairo back end. For example it is possible to create an SVG surface using…
Paul Johnson
  • 17,438
  • 3
  • 42
  • 59
1
vote
1 answer

Get ComboBox widget value in Gtk2Hs

I'm trying to get the ComboBox widget value with this code: selectRadioB cb = do ntxt <- comboBoxGetActiveText cb case ntxt of Just ("Option 1") -> ... Just ("Option 2") -> ... Just ("Option 3") -> ... return…
Hamburguesa66
  • 87
  • 1
  • 7
1
vote
1 answer

Create a ComboBox widget in Gtk2HS

I want to create a ComboBox widget with this code: void initGUI window <- windowNew ... cb <- comboBoxNewText comboBoxAppendText cb "Option 1" comboBoxAppendText cb "Option 2" comboBoxSetActive cb 0 boxPackStart hb cb PackNatural 0 …
Hamburguesa66
  • 87
  • 1
  • 7