Re: [pygtk] gtk.TextIter
Pier Carteri wrote: >Hi to all, >I'm learning the new gtk2 and in particular the multiline text widgets (TextBuffer > TextView & Co.) >My idea is to see if I can use theese widgets in my app. The app is basically and >editor for Python and since now I've used the Scintilla widget that's very cool! >So first question: >Is it possible to create a class based on new widgets of gtk2,that implements >a widget with syntax styling, folding and everythings else like Scintilla? >I suppose that the answer is Yes, but how much difficult will it be (in particular >the auto-highlight of text and the folding rutine)? > If it can be done with the Tk text widget, it can be done with GtkTextView (probably). There are also a number of things the gtk widget can do that Tk can't. > >And now about TextIter: >can you explain me in a few words what is a TextIter and how to create one (probably >an example will be the perfect explanation) > Text iters represent a position in the text buffer. You can create them with a GtkTextBuffer object as follows: iter = buffer.get_iter_at_line_offset(linenum, charoffset) iter = buffer.get_iter_at_offset(charoffset) iter = buffer.get_start_iter() iter = buffer.get_end_iter() start_iter, end_iter = buffer.get_bounds() There are a few other text buffer methods for creating iters, but those should be enough most of the time. You can then use iter methods to advance by chars, words or lines, etc. > > >[An off topic question: does anybody know when we can have a glade2 program >to play with?] > I don't know when glade2 will be ready. There is also a port of the old glade to gtk 2. I don't know the branch name for this though. As a third option, you can do your interface in glade as normal, and use libglade-convert to convert the .glade file to the new format. James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Patch: GtkTreeModel and refenecing objects
Arjan J. Molenaar wrote: >Hi, > >I've created a patch that adds a 'leak_references' property to the >GenericTreeModel. Turning this feature off (default is on, the old >behaviour) will always decrement the refcount on PyObjects. This will >prevent memory/refcnt leaks from happening. The Model should ensure that >objects which are user as iterator are not destroyed before the iterator >is destroyed. > >This sounds a bit silly, but there are no other way, unless we get to >know when a iterator is being removed... > Thanks for the patch. Could you please put this in bugzilla so that I don't forget about it? James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] GCC with -ansi option
Arjan J. Molenaar wrote: >Hi, > >I'm having some trouble compiling PyGTK from CVS. I get errors like >these: > > /gnome/head/INSTALL/include/glib-2.0/glib/gmessages.h:108: > warning: invalid character in macro parameter name > >The remedy seems to be removing the '-ansi' flag from the CFLAGS >attribute. AKAIK the '...' in macro definitions is a GCC specific >feature, therefore setting '-ansi' will error on those statements. >Note that I did not configure GLib with the --enable-ansi option. > >I noticed this flag is explicitly set in configure.in (line 129). It >should not be set if GLib is not compiled with ansi-compliance. > This should already be fixed in CVS (and in the last pygtk/gnome-python releases). James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] FAQ work.
On Sun, 3 Feb 2002, Skip Montanaro wrote: > still pretty easy) will be modifying the code in faqwiz.py itself to use the > style sheets. If you have a Python distribution look in Tools.faqwiz. If > not, you can pick up copies from the CVS repository: Shandy submitted a change I integrated. Looks good. :) > Christian> By the way, I wrote a script to move faqs from one section to > Christian> the other if anybody wants one. > > I would submit a patch to the Python SourceForge repository. I think this > would be welcome. I did, but it's a shell script; afraid I'll get my sf.net account cancel for blasphemy :-) It's request 512466: http://sourceforge.net/tracker/index.php?func=detail&aid=512466&group_id=5470&atid=305470 Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] FAQ work.
Shandy> What software do you use to create the FAQ? I'd be interested Shandy> in adding a stylesheet... Christian> It's called faqwiz.py, included with python distributions. I Christian> dont know how customizable it is, ... The prologue and epilogue for the HTML are contained in faqconf.py. The prologue should be easy enough to modify. A bit more difficult (though still pretty easy) will be modifying the code in faqwiz.py itself to use the style sheets. If you have a Python distribution look in Tools.faqwiz. If not, you can pick up copies from the CVS repository: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Tools/faqwiz/ Christian> By the way, I wrote a script to move faqs from one section to Christian> the other if anybody wants one. I would submit a patch to the Python SourceForge repository. I think this would be welcome. Skip ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk