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
5
votes
2 answers

Radio button grouping with glade

I am programming a GUI in Haskell using the editor Glade with the gtk2hs bindings. Currently I am failing miserably at grouping the radio buttons. It will not let me select the group name. Can someone help?
Stuart Paton
  • 291
  • 4
  • 13
4
votes
1 answer

capturing right-click event on treeview row [haskell gtk2hs]

I have searched thoroughly (at least I believe so) and I didn't find any answer for my problem, so I'd like to ask you for help. I'm trying to determine when a user right-clicks a row in my treeView (list of users) and then show a pop-up window with…
jban
  • 149
  • 1
  • 10
4
votes
1 answer

Override Events in Haskell

I'm writing a haskell program with GUI. When I write the following piece of code onClicked btn $ do print 1 onClicked btn $ do print 2 Pressing btn resulted in printing 1 and 2 simultaneously How can I override the…
Islam Hassan
  • 1,736
  • 4
  • 26
  • 42
4
votes
1 answer

Is there a Gtk spreadsheet widget

I plan to make a program to edit data in a spreadsheet style. Is there a specific widget to make a spreadsheet with Gtk (any version) like wxSheet in wxWidget ? If not, do you know if it is intended to be implemented by Gtk developpers ? Some detail…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
4
votes
1 answer

ComboBox doesn't show any of its strings

I just started using gtk2hs (gtk3 on hackage) and have run into some issues with comboBoxes. I cannot make a simple comboBoxNewText display its strings. I have commented out everything unneeded in my application so I just have a basic framework for…
4
votes
1 answer

install gtk2hs with Darcs

I'm having some existing code that I'm not able to run without gtk2hs. But I can't get it installed. I tried with cabal before but found out that the correct solution for now is to build from darcs. So I do : darcs get --lazy…
Jeremy Knees
  • 652
  • 1
  • 7
  • 21
4
votes
1 answer

How can I fix the "Unacceptable result type in foreign declaration: CULong" error building gtk2hs packages?

When trying to compile the gtk Haskell package with ghc-7.6.1, I get the following error (when trying to build pango, one of the dependencies, but it also occurs in other dependency packages if I try to install them manually): [ 1 of 14] Compiling…
a1kmm
  • 1,354
  • 7
  • 13
4
votes
1 answer

With Haskell and Gtk2hs, how would I create a new widget and associated events?

I have an application that I am working on, and I'm basically self-teaching GUI programming. I asked a fairly involved question over on programmers.stackexchange. This question is about the mechanics of an idea I had not tried. I have three…
Savanni D'Gerinel
  • 2,379
  • 17
  • 27
4
votes
1 answer

Is it possible to use menus created with Glade in gtk2hs?

I have menus created with Glade in my gtk2hs application. Is it possible to use this in my Haskell code to write actions for each activated menu item? Is there a simple example somewhere or project on Hackage that can be used as an illustrative…
donatello
  • 5,727
  • 6
  • 32
  • 56
3
votes
1 answer

How do I use threads with gtk2hs with ghc-7.4?

The following program does not work as expected: module Main where import Graphics.UI.Gtk import Control.Monad.IO.Class (liftIO) import Control.Concurrent (forkIO) main = do unsafeInitGUIForThreadedRTS window <- windowNew …
phischu
  • 440
  • 2
  • 6
3
votes
1 answer

gtk2hs: Request recalculation of windows size after removing a widget

I have a Window with three Entry widgets and one Button. I use the button to remove one of the widgets programmatically. The problem is that the main window doesn't change it's size to fit the new layout after it's been removed. I can imagine that I…
Peter Jankuliak
  • 3,464
  • 1
  • 29
  • 40
3
votes
1 answer

c2hs in marshaller vs. gtk2hsC2hs

i try to understand the difference between c2hs and gtk2hsC2hs (modified version of c2hs for use in gtk2hs). Consider the following coding: module Matrix where data Matrix = Matrix { xx :: !Double, yx :: !Double, xy ::…
kilian
  • 79
  • 4
3
votes
1 answer

How do I render into a gtk3 statusicon using cairo in a haskell application?

I would like render into the statusicon of my application. I know I can make the statusicon display a pixbuf by setting statusIconPixbuf. And I can create an empty pixbuf via pixbufNew and do things like filling it with a single color. But how do…
Daniel Schmitz
  • 347
  • 1
  • 7
3
votes
2 answers

Try to install gtk on mac missing dependencies

I tried to install the gtk haskell on my mac. I used this site to install it. However I failed at the last step with the command: sudo cabal install --with-gcc=gcc-4.8 gtk the terminal answer is: Resolving dependencies... cabal: Could not resolve…
Max K
  • 171
  • 12
3
votes
1 answer

can't get gtk2 CellRendererCombo to display anything

I am unable to get gtk's cell renderer combo box to display any options. I need to use a different model for each row in my tree, which should be possible with cellComboTextModel. My result is the combo box renderer is completely empty. Here is a…
ghorn
  • 614
  • 3
  • 11
1
2
3
10 11