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
3
votes
0 answers

Gtk2Hs make its own Signal (or Event)

I'm trying to create a program with Gtk2Hs and Haskell and I wonder if it is possible to create a new signal with Gtk. For example I created a hBox containing a button and a text entry. This component can be added at differents places in the window…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
3
votes
1 answer

Tables reacting to click events on a per-cell basis

I have a timetable to display in a table. Here is a sample of my current solution: import Graphics.UI.Gtk import Control.Monad.IO.Class main = do initGUI window <- windowNew view <- treeViewNew store <- listStoreNew initialData …
Kritzefitz
  • 2,644
  • 1
  • 20
  • 35
3
votes
0 answers

TreeView doesn't vizualize tree from TreeStore

When I run this program, the treeWiew widget showed with white background and nothing else. I think, it's a bug but I'm not sure. I do not want report a bug which is not a bug. testTree :: Tree String testTree = (Node "root" [(Node…
rosetree
  • 305
  • 2
  • 9
3
votes
1 answer

Line numbering from text using gtk2hs

I'm working on a program that contains a text editor on it and will be used for programming (which means that the font is monospaced and has the same size in the entire text). As such, it would be useful if it were possible to see the number of each…
mgmillani
  • 127
  • 9
3
votes
1 answer

gtk2hs on windows fails to run

I wrote little app using gtk2hs on Linux and it works great. Latter I tryed to run that same app on Windows (xp, 7) but with no success. I installed: haskell platform for win gtk2hs all in one bundle in path with no spaces and set %PATH% to its…
akegalj
  • 379
  • 2
  • 10
3
votes
1 answer

Why is this minimal Gtk2Hs program leaking memory

Using GHC 7.4.2 and GtkHs 0.12.4, on Win32 and Win64, this program takes more and more memory, consuming approximately 2Mb/sec on my machine. I am simply trying to make an animation using Gtk (this is why I invalidate the window so it gets redrawn…
trethaller
  • 587
  • 3
  • 16
3
votes
1 answer

gtksourceview2: implement completion provider

The documentation states about SourceCompletionProvider: You must implement this interface to provide proposals to SourceCompletion What does "implement this interface" means in the context? Should I create new GObject using this functions? Any…
Yuras
  • 13,856
  • 1
  • 45
  • 58
3
votes
2 answers

How to force a Haskell type to a more general type

I am struggling to get the following code past GHC: getFirstChild :: (WidgetClass w1, WidgetClass w2) => w1 -> IO (Maybe w2) getFirstChild parent = do -- check if parent is a container if parent `isA` gTypeContainer -- if parent is a…
Rouan van Dalen
  • 748
  • 4
  • 14
2
votes
1 answer

Multiple additions instead of single [gtk2hs]

I have another problem that I can't solve I have a following code that adds a user (first name, last name and age) into a treeview. It all works well except for one small thing: it works well only when you add an user for the first time. When you…
jban
  • 149
  • 1
  • 10
2
votes
1 answer

What are the equivalent of these functions in gtk2Hs when migrating from gtk2 to gtk3

I'm converting a Haskell program written with Gtk2Hs gtk2 to Gtk2Hs gtk3 and I'm looking the equivalent function of Gtk2Hs gtk2 for: onActivateLeaf to catch the activation of a menu item. onExpose to draw in a widget. onClicked to catch the clicked…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
2
votes
1 answer

Toggle between event handlers in gtk2hs

I would like to do something like this: handlerOn = do cid <- canvas `on` buttonPressEvent $ tryEvent do signalDisconnect cid handlerOff putStrLn "handlerOn" handlerOff = do cid <- canvas `on` buttonPressEvent $ tryEvent do …
mentics
  • 6,852
  • 5
  • 39
  • 93
2
votes
1 answer

Differences between gtk and gtk2

There seem to be two gtk2hs libraries on Hackage - gtk and gtk3. Looking at the source, they seem to share the same files and have only minor differences. How are these libraries different?
bradrn
  • 8,337
  • 2
  • 22
  • 51
2
votes
1 answer

Using haskell-gi GTK signals

Haskell Gi-GTK noob here. And GTK noob in general. I have an image, which I've wrapped in an Eventbox. Now, I want to detect when the user presses on the event box (mousedown). Some Googling points me to using button-press-event. My code is…
hello
  • 73
  • 1
  • 6
2
votes
1 answer

How do I get keydown and keyup events in haskell?

I’m using haskell and gtk2hs. Is there any way to get keydown/keyup events (keystate is just as good; keypress event is not) with those?
some idiot
  • 191
  • 13
2
votes
0 answers

Building project dependent on gtk2hs fails on lts-7.8 and later

Building project dependent on glib fails on lts-7.8 and later after Cabal becomes 1.24.1.0. Steps to reproduce Add glib to a project's .cabal file build-depends: base , gtktest , glib Run following…
fujiyan18
  • 21
  • 2
1 2
3
10 11