This looks as a bug in that old Haskell library: from its source code module Graphics.UI.Gtk.ModelView.CellRenderer ( -- snip CellRendererMode, The above is not exporting the constructors. Newer versions do: module Graphics.UI.Gtk.ModelView.CellRenderer ( -- snip CellRendererMode(..), You may try to update the Haskell library to a newer version. That should...
Your problem is caused by the fact that you keep yanking the viewport around while you are also listening to motion events on it. The simple solution I've found is to wrap your scrolledWindow in a GtkEventBox (I've called in eventbox in my code) and then attach the event listener...
haskell,localization,gtk,gtk2hs
I find a way to have the correct format in the spinbutton entry by setting the text with the entrySetText function : onValueSpinned spin $ do val <- spinButtonGetValue spin entrySetText spin $ printf "%6.2f" val return () The entry text is modified each time the value of the spinbutton...
windows,haskell,windows-7,gtk2hs
The solution is to run new thread! We need to put forkIO in the body of onPressed: onPressed but $ do forkIO $ do set lab [labelText:="one"] threadDelay 1000000 set lab [labelText:="two"] threadDelay 1000000 set lab [labelText:="three"] return() It works fine now!...
You're right that this is not implemented at the moment. Adding it shouldn't be too involved, and might be a fun project if you're looking to get into gtk2hs development. You'll want to add a new constructor to the Event type, together with a descriptive type alias like type EventOwnerChange...
I find a solution to my problem : In the main program I create an IORef of a list of actions to perform : actionsIO <- newIORef [action_to_do_1,action_to_do_2] I create my custom combined widget for text entry ent <- textEntry window canvas state modele parser info actionsIO Inside, I execute...
Here is the code to obtain the expected result : pic1 <- pixbufNewFromFile "Picture_1.png" pic2 <- pixbufNewFromFile "Picture_2.png" pic3 <- pixbufNewFromFile "Picture_3.png" let lstsecrep = [ ("Picture 1",pic1) , ("Picture 2",pic2) , ("Picture 3",pic3) ] lststorerep <- listStoreNew lstsecrep customStoreSetColumn lststorerep (makeColumnIdString 0) fst customStoreSetColumn lststorerep (makeColumnIdPixbuf 1) snd combo...
The docs at https://developer.gnome.org/gtk3/stable/GtkCellRenderer.html state: A cell renderer can be “activatable” like GtkCellRendererToggle, which toggles when it gets activated by a mouse click, or it can be “editable” like GtkCellRendererText, which allows the user to edit the text using a GtkEntry. To make a cell renderer activatable or editable, you...
You can adopt the solution described in this Python answer. A buttonPressEvent callback can be installed in your prepareCols function that checks that the event is a right mouse click, and then decodes the event coordinates into a TreeStore path: onPathRightClick :: (TreeViewClass view) => view -> (TreePath -> Int...
If you have a TextBuffer bound to the variable "buf", you can easily know where the cursor is. insertmark <- textBufferGetInsert buf is a convenient way to get the "insert" mark, which holds the cursor position. Then, you need the corresponding TextIter: cursoriter <- textBufferGetIterAtMark buf insertmark. Now, the function...
haskell,gtk,base64,glade,gtk2hs
name2 is of type String, whereas encode requires a ByteString. The simplest thing to do is just use the pack function from Data.ByteString.Char8 to make the conversion. However, there's a problem with this: it will only work properly for ASCII codepoints. What happens if the user enters non-ASCII characters (לדוגמה,...
I made a mistake entryCursorPosition is a read only attribut and can't be set. The correct function to set the cursor position in a entry is : editableSetPosition entry (-1) Hoping it will be helpfull...
I just tried it myself, and hit some snags that I was able to overcome.... Perhaps you are having the same problem. For some reason, some dependencies would not automatically install. It is easy to install them by hand though. Try this: cabal install alex cabal install gtk2hs-buildtools cabal install...