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
1 answer

Both versions of the gtk package are visible when running `stack ghc`

A minimal reproduction can be found here: https://github.com/IvanMalison/stack-gtk2hs-bug Everything works as expected when I use normal stack commands, but when I run the failing command: stack ghc -- --make main.hs I get the following…
imalison
  • 335
  • 3
  • 8
0
votes
1 answer

Gtk2Hs : Missing functions when migrating from Gtk2 to Gtk3

I wrote a Haskell program with Gtk2Hs dealing with Gtk2. But when I tried to build my program with Gtk3, GHC complains about missing functions which doesn't exist anymore : • Variable not in scope: widgetGetSize :: GtkGL.GLDrawingArea -> IO…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
0
votes
1 answer

list of gtk2hs widgets

how do I create a List (or whatever. Not a Tuple though) that accepts different instances of some typeclass? Specifically, I want to do something like the following: [labelNew (Just "foo"), buttonNewWithLabel "bar"] I don’t care for the…
some idiot
  • 191
  • 13
0
votes
1 answer

How to check whether render state is saved or not in Gtk2hs Cairo to prevent scaling image on resizing window in Haskell

I am trying to draw some simple images in gtk2hs cairo. I know you can save the current state using save command and restore using restore command. Is thee a way to check is a state is currently saved. I do not want my image to scale when resizing…
Ratan Senapathy
  • 2,148
  • 2
  • 10
  • 14
0
votes
3 answers

Installation of haskell-chart fails due to gtk-0.14.2 build error

I'm trying to install haskell-chart from here (github), I clone it, install stack, ran stack setup (it installs GHC successfully), but then I ran make that fails with the messages: ... Chart-cairo-1.8: copy/register Chart-diagrams-1.8:…
E. Nerush
  • 69
  • 7
0
votes
0 answers

rangeGetValue causes a segfault after mainQuit in gtk2hs

I'm working on a Haskell project with a graphical user interface written with gtk2hs. When I quit my program, 90% of the time I get a segfault. (I noticed that quite recently, because I usually kill my program with a Ctrl-C on the terminal when…
Guerric Chupin
  • 461
  • 2
  • 13
0
votes
0 answers

GTK change size WIDGET

I have since months a problem in my software (In GTK2). I have a WIDGET (picture.png) which has a certain size. I define the X and Y coordinates of the image and set the size at the beginning to Zero. But if I want to change the size of the picture…
Joe
  • 31
  • 9
0
votes
0 answers

How to pass data from onClick function

I'm building a small Haskell GUI application as an exercise for myself using the gtk2hs library, but I'm stuck at a certain point. So I want to show a FileChooserDialog where a user can select multiple images, and I made a function that does all of…
user4424299
0
votes
1 answer

haskell & Gtk2hs : no point is displayed in a canvas (parallel drawing)

I wrote a little program which has to display the mandelbrot set, in haskell, using Gtk2Hs. thought there is no compilation error, nothing is displayed in the canvas (the component in which the points are colored)... could you help me to debug this…
lolveley
  • 1,659
  • 2
  • 18
  • 34
0
votes
1 answer

logical error in the display of the mandelbrot set in haskell

I created a program whose purpose is to draw a fractal set (the manderbrot set) and it does not contain any syntax error, but only one pixel appears, not the set. here is my program: module Main where import Graphics.UI.Gtk import…
lolveley
  • 1,659
  • 2
  • 18
  • 34
0
votes
0 answers

Scroll on TextView and Table - Haskell Gtk

i'm working on a gtk proyect using haskell. I have a table and a textview in an horizontalBox, and i need to scroll this table at the same time as the textview. I've tried some combinations but i couldn't do it. This is mi code with the…
jorexe
  • 165
  • 1
  • 13
0
votes
1 answer

gtk2hs - Getting back a ListStore from a TreeView

I have a handle to a TreeView that happens to have a ListStore as its model. What I want to do is get back a handle to that ListStore from my handle to the TreeView. As pointed out here, the treeViewGetModel getter returns a generic TreeModel rather…
gameboo
  • 93
  • 1
  • 10
0
votes
1 answer

Changing window layout in gtk2hs

I am making an applocation to demonstrate some algorithms, and I am using gtk2hs. When the user selects an algorithm, I want the whole window to change (different layout, input, output interface...). How could I do that? For example, is it possible…
mani
  • 45
  • 5
0
votes
0 answers

how to dynamic to add widget to window such as increase number of vbox in gtk2hs and how to add opengl as a widget in gtk2hs window

i search Data.Dynamic how to make use of it to dynamic add widget to increase bgBac1 <- imageNewFromFile "example1_big.png" row0 <- hBoxNew False 2 boxPackStart row0 bgBac1 PackNatural 0 how to add opengl as a widget in gtk2hs window ? after…
M-Askman
  • 400
  • 4
  • 17
0
votes
1 answer

Timer function using gtk2hs

I'm trying to make a Timer in Haskell using gtk2hs. I found an example on this website wiki.haskell Tutorial Threaded GUI which I could successfully implement in my project. The only problem I'm facing is creating a restart button for the timer. My…
demathieu
  • 467
  • 1
  • 3
  • 15