0

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 scrollingWindow working only for the textView.

vb <- vBoxNew False 0
containerAdd window vb

boxPackStart vb toolbar PackNatural 2
hseparator <- hSeparatorNew
boxPackStart vb hseparator PackNatural 2

horizontalBox <- hBoxNew False 5
sw <- scrolledWindowNew Nothing Nothing
containerAdd vb horizontalBox


table<- tableNew totalRows 1 True
tableGetColSpacing table 0
widgetSetSizeRequest table 50 675
containerAdd horizontalBox table

textview <- textViewNew 
textViewSetWrapMode textview WrapChar
widgetSetSizeRequest textview 700 400

containerAdd sw textview
containerAdd horizontalBox sw
Ivan Perez
  • 582
  • 2
  • 17
jorexe
  • 165
  • 1
  • 13
  • Following http://stackoverflow.com/questions/6617816/two-gtk-textview-widgets-with-shared-scrollbar, I tried synchronizing a hidden scroll window around the text view with an outer scroll window around the hbox (which is a discouraged ugly ugly ugly hack), and it sometimes crashes. Nevertheless, I fear the resulting UI might be a bit unnatural. Would you mind sharing a bit more about the UI problem you're trying to solve? – Ivan Perez Feb 01 '16 at 22:12
  • Yes, i have the textView in wich i have code, and a table on the leftside in wich appears buttons to fold the code functions in a single line. I don't know if there are a better way to do this with gtk. Here is a [link](http://codepad.org/RRUjS0wc) to my code. – jorexe Feb 01 '16 at 23:49
  • I'm confused. Can you mock up some screenshots showing what you want? – andlabs Feb 03 '16 at 21:51
  • Yes. [Image](http://imgur.com/PC95FiQ) . I need to scroll those buttons when the textview scrolls. I can't find any method, i'm trying to use moveCursor with textIterGetLine, but i only get the previous line.. also i can't know wich lines are visible on screen.. – jorexe Feb 03 '16 at 22:42
  • Oh, you're trying to do code folding? Look into gtksourceview instead; it was specifically designed for source code editing. – andlabs Feb 14 '16 at 16:19
  • Thanks you! I will check it – jorexe Feb 14 '16 at 22:53

0 Answers0