From: Gregory Millam Date: 2004-04-09T14:41:24+09:00 Subject: Re: Idea: Simplified GTK Received: Fri, 9 Apr 2004 13:23:17 +0900 And lo, Hal wrote: > I thought these options were constant for the container? I guess > I'm wrong about that? If homogeneous is false in the creation of the widget, then expand and fill determine what it looks like afterwards. The example I gave earlier was what I ended up using - method based context. (all the context bits like that are controlled by method_missing as it is, and are only valid methods if their current context has a context named that) vbox { expand false fill false menubar { ... } expand true fill true scintilla } Flesh out menubar, and tada, instant mini-editor. > > (Regarding the 'scintilla' bit: I wrote a ruby-gtk2 binding for scintilla last December (for gtk2, as opposed to fxscintilla). I just haven't bothered finishing it up yet, or figured out how get extconf working to make it releasable. It's still highly usable - the only things not implemented are those that involve styles (where a string is a set of 16 bit "characters" - one character byte, one style byte)) > > That's very cool. Scintilla is as powerful as they come (afaik). Its > learning curve ranges from shallow to vertical, though. I've rarely actually used it to code. I only wrote the rbscintilla.so for a programming contest - My team was making a "Collaborative client-server based IDE" for the contest. We couldn't finish enough of it to make it usable, though, and the perl team won with a file browser. *cough* (we had 12 hours to code the whole thing. If we had just /1/ hour more, we'd have had it complete enough to win) Using scintilla in Gtk is easy, though. require 'rbscintilla' sci = Gtk::Scintilla.new # or in EzGtk, just "sci = scintilla" # Add it to a window and stuff. # load file sci.text = IO.readlines(filename).join("\n") # Go ahead and edit, it's already all set up and editable. # Now asave File.open(filename,"w") do |f| f.write(sci.text) end - Greg