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

Haskell program using Graphics.UI.Gtk crashes on Windows when run from GHCi

I downloaded gtk recently and wrote the following code. main :: IO () main = do initGUI window <- windowNew onDestroy window mainQuit widgetShowAll window mainGUI This program results to a error message and that ghci is quitted. 0…
scholar guy
  • 79
  • 2
  • 11
0
votes
1 answer

Gtk2Hs set local format in a program or a widget

I'm trying to set the locale format of a spin button. The decimal mark on my system is a comma , and I would like it to become a dot .. Is there a function in GTK or Glib to set the locale formatting globally or locally on a widget. I looked in…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
0
votes
1 answer

Gtk2Hs : Existing function not found

I have a problem with Gtk2Hs, I want to set a cellRenderer activatable. For that, I need to set it's property cellMode to CellRendererModeActivatable by using : set render [ cellMode:= CellRendererModeActivatable ] But I have the following error…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
0
votes
1 answer

Gtk2Hs : Widget interaction

I'm trying to create a program with Gtk2Hs and Haskell and I wonder whether it is possible to make different widgets communicate with one another. I have a text entry, which is used to write commands, a drawing area, which draws something when the…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
0
votes
1 answer

Signal to CellRendererModeActivatable

The CellRenderer of gtk2hs has a property cellMode. If it's set to CellRendererModeActivateble, what signal gets emitted? I can't find one in the documentation.
Kritzefitz
  • 2,644
  • 1
  • 20
  • 35
0
votes
0 answers

Haskell and GtkGL - LookAt and Rotation

I'm looking at the GtkGL tutorial here, and I'm doing some modifications. Specifically, when I introduce a rotation: Gtk.timeoutAddFull (do preservingMatrix $ do -- from here matrixMode $= Modelview 0 rotate 10 (Vector3 0.0 1.0…
guaraqe
  • 249
  • 1
  • 7
0
votes
1 answer

Tables in glade

I'm making a GUI application with gtk2hs. Most of the GUI is designed in Glade. I now need a table to show some data. The problem is, that I can't find the table in glade. I searched in the Container category, but only found a "Grid". However I…
Kritzefitz
  • 2,644
  • 1
  • 20
  • 35
0
votes
3 answers

Is it possible to clean some code using gtk2hs?

I'm starting a GUI with haskell and gtk2hs. I've got a notebook widget and I want to switch pages with "F1, F2 ... F11" keys. My working code is: import Control.Monad.Trans (liftIO) import Graphics.UI.Gtk main = do initGUI builder <-…
grwp
  • 97
  • 7
0
votes
1 answer

Gtk2Hs: onEntryActivate deprecated

The documantation about entries in Gtk2Hs has the entry about the Event onEntryActivate, which is triggered when the user presses enter within the entry field. This seems like something you want for most of your entries. So why is this in the…
Kritzefitz
  • 2,644
  • 1
  • 20
  • 35
0
votes
2 answers

Fixing the size of a GTK Widget?

I am attempting to fix the size of a widget in GTK+, specifically using Gtk2hs with Haskell. I have drawn an image in a DrawingArea and I would like to specify the exact size of this drawing area. I do not want other widgets or the user to make this…
Necrototem
  • 554
  • 6
  • 12
0
votes
2 answers

How to do something repeatedly while button is pressed in gtk2hs?

I need to do some action while button is pressed. How can I do it? I have version 0.12.4. P. S.: For some reason, onButtonActivate in import Graphics.UI.Gtk import Control.Concurrent main = do initGUI window <- windowNew but…
Anon Imous
  • 415
  • 2
  • 11
0
votes
1 answer

Clearing a drawArea in haskell GTK

I'm making a game using gtk/cairo in haskell, and I'm looking for a way to completely clear the drawing area (a widget of type drawingArea). When a widget resizes for instance, the drawing area is cleared automatically. I'm looking for a way to…
Nathan
  • 73,987
  • 14
  • 40
  • 69
0
votes
1 answer

State monad and gtk2hs

I am trying to retain some state on my GUI application so that I may be able to construct a list of values from user input. But I have trouble understanding the State monad so... Here is some test code to illustrate what I want (it is obvious it…
Sarfraz
  • 225
  • 2
  • 10
0
votes
2 answers

Replace selected text and have the new text be selected

I'm using Gtk2Hs, and all this GTK stuff is new to me. I'm working with a TextView. I want to replace the currently selected text with some new text, and have the new text be selected. The closest I've been able to come up with is: -- Create marks…
mhwombat
  • 8,026
  • 28
  • 53
0
votes
1 answer

Using Haskell Gtk widgets with Graphics.SOE package

I have been working through the book The Haskell School of Expression by Paul Hudak and using its associated gtk based graphics library Graphics.SOE.Gtk (link to documentation) for small 2D drawing experiments. This library is very basic however,…
Craig Innes
  • 1,573
  • 11
  • 23
1 2 3
10
11