On 12/15/2010 06:27 PM, Colomban Wendling wrote:
Le 16/12/2010 02:37, Matthew Brush a écrit :
On 12/15/2010 08:27 AM, Colomban Wendling wrote:
Le 15/12/2010 16:30, Matthew Brush a écrit :
[…] After work I will try and come up with a better solution that still doesn't require patching Geany. If anyone has any suggestions on how to get a handle on the vte frame widget from a plugin that would be great, the comments in and around the get_vte_frame() function explain my difficulties.
Well, the first idea that comes to my mind is to check if the widget inside the tab is actually a VTE. I guess there is GObject-like API for the VTE, such as VTE_IS_TERMINAL(obj), so you can check whether the packed child in the tab is really the one you're searching for. Well, take into account that Geany might add a frame/scrolled window/whatever before the VTE, but you should be able to do the check correctly.
Thanks for the hint. The problem should now be fixed, at least as good as I can figure without modifying Geany.
https://github.com/codebrainz/geany-sidebarterm
Feedback welcome.
I'd implemented this in a slightly more generic fashion, something like one of these (untested) examples: http://nopaste.geany.org/p/f321377d7
The advantage is that it does not depend on the actual widget hierarchy, and simply checks if there is a VTE terminal anywhere behind (or at, depending on the implementation) a given widget.
Thanks! I just added the 2nd variation to the code, it's much better than my attempt :)
My next todo item is how to make the plugin not load (cancel loading) if the VTE is not found, for example after the error message, it gets unchecked in the Plugin Manager so that the error message doesn't occur each time Geany is loaded.
Matthew Brush (codebrainz)