From: Tom O. <tos...@gm...> - 2010-09-25 19:52:52
|
Hello again, During the course of writing a program, things were going well, until I started to pack a SourceView widget inside a Notebook. I found a way to work around this through the usage of a ScrolledWindow widget, but seeing that the SourceView widget extends the TreeView widget (in addition to the fact that scrolling with the TreeView widget inside the ScrolledWIndow widget doesn't work right), I was wondering whether there is a way to activate scrolling with a SourceView inside a Notebook page. To illustrate this problem better, compile and run the following code: module Main where import Graphics.UI.Gtk import Graphics.UI.Gtk.SourceView main :: IO () main = do initGUI window <- windowNew notebook <- notebookNew sview <- sourceViewNew notebookAppendPage notebook sview "Untitled" set window [containerBorderWidth := 0, windowTitle := "Test", windowDefaultWidth := 640, windowDefaultHeight := 480, containerChild := notebook] onDestroy window mainQuit widgetShowAll window mainGUI The code will compile validly, but if you create a document that has text outside the window bounds, instead of having the SourceView become scrollable like the TextView normally does, it instead re-expands the window, and trying various API functions to resolve the issue hasn't helped. Does anybody know how to get it so that 1. The SourceView widget sizes appropriately when the screen resizes 2. Does not cause the screen to resize when the text exceeds the buffer's dimensions? Thanks, Tom |