Re: [pygtk] gtk.TextIter

2002-02-05 Thread Christian Robottom Reis

On Sat, 2 Feb 2002, Pier Carteri wrote:

> 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)?

With the new object system, I understand it is much easier to actually do
this than it was before. How much work depends of course on how much you
are going to implement, but it should be pretty straightforward - no big
set of hoops to jump to get started.

> 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)

There is an example in the faq IIRC. http://www.async.com.br/faq/pygtk/

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] gtk.TextIter

2002-02-04 Thread Johan Dahlin

mån 2002-02-04 klockan 08.39 skrev James Henstridge:
> 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 
FYI: It's called glade-gnome2-branch

> 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


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] gtk.TextIter

2002-02-04 Thread Christian Robottom Reis

On Mon, 4 Feb 2002, James Henstridge wrote:

> >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)

Added to faq,
http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq14.002.htp

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] gtk.TextIter

2002-02-03 Thread James Henstridge

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



[pygtk] gtk.TextIter

2002-02-02 Thread Pier Carteri

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)?
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) 

[An off topic question: does anybody know when we can have a glade2 program 
to play with?]

Thank you very much!

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk