gtk2hs

Create a ComboBox widget in Gtk2HS

≯℡__Kan透↙ 提交于 2019-12-11 04:43:54
问题 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 ... But this error appears: Couldn't match type ‘[Char]’ with ‘text-1.2.2.0:Data.Text.Internal.Text’ Expected type: ComboBoxText Actual type: [Char] In the second argument of ‘comboBoxAppendText’, namely ‘"Secuencial"’ In a stmt of a 'do' block: comboBoxAppendText

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

荒凉一梦 提交于 2019-12-10 23:46:14
问题 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 commands stack install gtk2hs-buildtools stack build Result The following error occurred ... [debug] Ignoring package Cabal due to wanting version 1.24.1.0 instead of 1.24.0.0 @(Stack\Build\Installed.hs:196:5) ... -- While building package glib-0.13.4.1 using: C:\Users\foo\AppData\Local\Programs

How to upgrade gtk2hsC2hs?

久未见 提交于 2019-12-05 11:16:44
问题 I am trying cabal install glib-0.12.3 under my Ubuntu 11.10 using cabal-install 0.10.2. However, it shows the following error messages: setup: The program gtk2hsC2hs version >=0.13.5 is required but the version found at /usr/bin/gtk2hsC2hs is version 0.13.4 cabal: Error: some packages failed to install: glib-0.12.3 failed during the configure step. The exception was: ExitFailure 1 After half an hour's search, I cannot find where this gtk2hsC2hs is. I dug into places like http://code.haskell

What are the relative merits of wxHaskell and Gtk2HS?

旧街凉风 提交于 2019-12-04 15:49:33
问题 Which is better for developing GUI applications with Haskell, wxWidgets (via wxHaskell) or GTK (via Gtk2HS)? What are the pros and cons of each? Does it vary depending on which platform you are targeting (I would primarily be working on OS X but would like my programs to work on Linux and Windows too)? 回答1: [Disclaimer: I am a wxHaskell maintainer] Both are stable and fairly complete GUI bindings, and you could choose either for most projects with confidence. Both have some degree of 'higher

How to upgrade gtk2hsC2hs?

会有一股神秘感。 提交于 2019-12-03 23:04:19
I am trying cabal install glib-0.12.3 under my Ubuntu 11.10 using cabal-install 0.10.2. However, it shows the following error messages: setup: The program gtk2hsC2hs version >=0.13.5 is required but the version found at /usr/bin/gtk2hsC2hs is version 0.13.4 cabal: Error: some packages failed to install: glib-0.12.3 failed during the configure step. The exception was: ExitFailure 1 After half an hour's search, I cannot find where this gtk2hsC2hs is. I dug into places like http://code.haskell.org/gtk2hs/tools/c2hs/ , but could not seem to find the right version. How could I upgrade my gtk2hsC2hs

What are the relative merits of wxHaskell and Gtk2HS?

只谈情不闲聊 提交于 2019-12-03 10:47:51
Which is better for developing GUI applications with Haskell, wxWidgets (via wxHaskell ) or GTK (via Gtk2HS )? What are the pros and cons of each? Does it vary depending on which platform you are targeting (I would primarily be working on OS X but would like my programs to work on Linux and Windows too)? [Disclaimer: I am a wxHaskell maintainer] Both are stable and fairly complete GUI bindings, and you could choose either for most projects with confidence. Both have some degree of 'higher-level' Haskell bindings, but in both cases you will need to drop into rather imperative 'C' style coding

Can't use a glade xml file with haskell

守給你的承諾、 提交于 2019-12-03 08:15:22
I'm not sure if I should say hi or not, being this my first post here. Anyway, I am following the glade tutorial from the gtk2hs website . The code compiled properly but when I try to execute it I get this error. (hellogtk2hs:8670): libglade-WARNING **: Expected <glade-interface>. Got <interface>. (hellogtk2hs:8670): libglade-WARNING **: did not finish in PARSER_FINISH state hellogtk2hs: user error (Pattern match failure in do expression at HelloGtk2Hs.hs:8:8-15) This is my glade file. <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> <object class=

How to pass state between event handlers in gtk2hs

笑着哭i 提交于 2019-12-03 00:20:42
I'm trying to make a toy application, just to get my head around how to write event driven programs in Haskell. What I'm trying to do is draw a line to a canvas which moves forward every time a key is pressed (so it's sort of a primordial cursor in a text editor). My problem is I can't work out what the best way to count the number of times the user has pressed a key. Obviously I can't use a global variable like I would in an imperative program so presumably I need to pass the state around on the call stack, but in GTK execution descends into the main loop after each event handler returns and

Convert Ptr () to SourceCompletionProvider

℡╲_俬逩灬. 提交于 2019-12-02 08:16:54
问题 I've solved the prev question partially. Right now I'm able to register GObject subtype via bindings-gobject (see hpase) I can implement SourceCompletionProvider using c'g_type_add_interface_static function (but didn't tried yet). The only issue is to convert Ptr () , returned by c'g_object_newv , to gtk2hs data type SourceCompletionProvider . How can I do it? Any hints? SourceCompletionProvider is defined like: newtype SourceCompletionProvider = SourceCompletionProvider (ForeignPtr

Gtk2hs windows 7 installation

╄→гoц情女王★ 提交于 2019-11-29 12:13:48
I did: cabal update cabal install gtk2hs-buildtools But stuck here: >cabal install gtk Resolving dependencies... [1 of 2] Compiling SetupWrapper ( C:\Users\1\AppData\Local\Temp\gtk-0.12.5.4 -4000\gtk-0.12.5.4\SetupWrapper.hs, C:\Users\1\AppData\Local\Temp\gtk-0.12.5.4-4 000\gtk-0.12.5.4\dist\setup\SetupWrapper.o ) [2 of 2] Compiling Main ( C:\Users\1\AppData\Local\Temp\gtk-0.12.5.4 -4000\gtk-0.12.5.4\Setup.hs, C:\Users\1\AppData\Local\Temp\gtk-0.12.5.4-4000\gtk -0.12.5.4\dist\setup\Main.o ) Linking C:\Users\1\AppData\Local\Temp\gtk-0.12.5.4-4000\gtk-0.12.5.4\dist\setup\ setup.exe ... [1 of 2]