Re: [pygtk] Turning the PyGTK+ brand into something more than it currently is

2012-11-19 Thread pier carteri
Hi to all,
After a long time I'm back on python and gtk. I'm using gobject and I like
it a lot...

I totally agree with Rafael; we must start contributing to the Python GTK+3
in order to have a guide as complete as the one for pygtk.
The second step can be to help Dieter as beta tester with his effort on
windows... To have a good support on windows platform is essential and ca
be the key feature

If we create an hype  on giobject, people will expect to have at least the
same level of functionality and documentation of pygtk...

Just my 2 cent
Thanks !
Pier




On Sun, Nov 18, 2012 at 6:36 PM, Pachi pa...@rvburke.com wrote:

 El 17/11/2012 23:28, John Stowers escribió:

  I think we could do a lot more with the PyGTK+ name and
 http://www.pygtk.org/ to promote gobject-introspection as our new,
 exciting
 solution. If nothing else, it rolls off the tongue much easier. Say it a
 few
 times.

 Anybody have any other ideas here?

 I think the stupidest mistake in recent times was calling it pygobject
 and not inheriting the pygtk name (and I objected strongly at the time
 too).

 I think we can still change our mind here.

 But more worryingly, I am not confident promoting pygobject as a
 replacement for pygtk unless it (and gtk+g-i) is supported on windows.
 In my experience, in the scientific computing sphere, people still use
 pygtk/gtk2 because it works on windows, gtk3 gets destroyed by qt for
 the same reason.

 I don't really know what to do thought.

 John

 Same feeling here.

 PyGObject is now alreay useful for people writing Linux only code, but
 without good win32 support it won't replace PyGTK for a vast majority of
 users that either want a cross platform solution or need to run their apps
 also on windows. IMHO that's the problem with PyGObject, not the brand.

 But, perhaps, a more prominent section about PyGObject could be added to
 the www.pygtk.org website.

 Dieter Verfaillie has beeing doing a lot of work to get Python + GTK+ 3
 working on windows and he even has a experimental version for win32 that
 works but still nees more work to be generally useful. He wrote a report
 on his work here http://article.gmane.org/**gmane.comp.gnome.gtk%2B.**
 python/16049http://article.gmane.org/gmane.comp.gnome.gtk%2B.python/16049and
  this means that the remaining work needs to focus on Glib
 (object-introspection) and GTK+, as PyGObject is apparently working fine on
 win32.

 So, to improve windows support more volunteers are needed, with enough
 patience to find out and understand what's missing.

 Meanwhile, the pygtk.org website is kept alive for those that can't
 migrate to pygobject, even if no development effort is being done now on
 PyGTK. We are doing small updates from time to time and the website is
 still somewhat active (you can find updated PDF and html versions of the
 docs and occasional additions to the PyGTK application list), but it is
 indeed in maintenance mode.

 Some ideas to improve the situation are:

 - Getting involved in improving the glib (gobject-introspection) and gtk+
 win32 branches
 https://github.com/dieterv (Dieter's github repos with his patches to
 those modules)
 
 http://optionexplicit.be/**projects/gnome-windows/GTK+3/http://optionexplicit.be/projects/gnome-windows/GTK+3/(experimental
  builds and instructions on how to build them)
 https://bugzilla.gnome.org/**buglist.cgi?classification=**
 Platform;op_sys=Windows;query_**format=advanced;bug_status=**
 UNCONFIRMED;bug_status=NEW;**bug_status=ASSIGNED;bug_**
 status=REOPENED;bug_status=**NEEDINFO;version=3.0.x;**
 version=3.1.x;version=3.2.x;**version=3.3.x;version=3.4.x;**
 version=3.5.x;version=3.6.x;**version=3.7.x;product=gtk%2Bhttps://bugzilla.gnome.org/buglist.cgi?classification=Platform;op_sys=Windows;query_format=advanced;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;bug_status=NEEDINFO;version=3.0.x;version=3.1.x;version=3.2.x;version=3.3.x;version=3.4.x;version=3.5.x;version=3.6.x;version=3.7.x;product=gtk%2B(open
  bugs related to gtk+ 3 on win32)
 https://bugzilla.gnome.org/**buglist.cgi?classification=**
 Platform;op_sys=Windows;query_**format=advanced;bug_status=**
 UNCONFIRMED;bug_status=NEW;**bug_status=ASSIGNED;bug_**
 status=REOPENED;bug_status=**NEEDINFO;version=unspecified;**
 component=introspection;**product=glibhttps://bugzilla.gnome.org/buglist.cgi?classification=Platform;op_sys=Windows;query_format=advanced;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;bug_status=NEEDINFO;version=unspecified;component=introspection;product=glib(open
  bugs related to glib introspection)

 - Help the PyGObject documentation efforts.
 The Python GTK+3 tutorial is an ongoing work, a great resource, and it
 will grow faster if more people work on it. Just think what could happen if
 a bunch of us contribute a new section (porting a PyGTK tutorial chapter or
 crafting totally new content).
 
 

[pygtk] pygoocanvas questions

2011-04-26 Thread pier carteri
Hi to all,
I've a couple of questions regarding pygoocanvas.
(I'm asking here but if there is a better place let me know! )

-suppose you have a canvas with many items (rects, text, lines), how can i
empty the canvas?

-with a GridItem I can create a grid with both vertical and horizontal
lines; is it possible to create a grid with only vertical lines

Thank you!
Pier
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

[pygtk] just for info [a bit OT]

2006-03-14 Thread pier carteri
Hi to all,I've just discover this:http://mail.python.org/pipermail/python-announce-list/2006-March/004773.htmlIt's not directly relate to pygtk but I think it' s a very nice project and someone on 
this list may help with ideas or code.thank you for your attention! Pier
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Whole App Cursor Setting

2005-10-30 Thread pier carteri
Hi Loris,
this works for me 
--8import gtk 


m_win = gtk.Window()
m_win.set_title(Test Window)
box = gtk.VBox()
m_win.add(box)
label = gtk.Label(Just a label)
box.pack_start(label)
button = gtk.Button( and a button)
box.pack_start(button)
m_win.connect(destroy, gtk.main_quit)
m_win.show_all()

gdk_win = gtk.gdk.Window(m_win.window,

gtk.gdk.screen_width(),

gtk.gdk.screen_height(),

gtk.gdk.WINDOW_CHILD,

0,

gtk.gdk.INPUT_ONLY)
gdk_cursor = gtk.gdk.Cursor(gtk.gdk.WATCH)
gdk_win.set_cursor(gdk_cursor)
gdk_win.show()
gtk.main()
--8
you can get more infos about gdk.window on
http://www.pygtk.org/pygtk2reference/gdk-class-reference.html

Regards

Pier
On 10/28/05, Loris Caren [EMAIL PROTECTED] wrote:
I'm trying to put up a watch cursor while my app is busy. I've foundhow to do it for one widget, but I really want to freeze up the wholeGUI.
http://www.daa.com.au/pipermail/pygtk/2000-October/000435.htmllooks just what I'm after. However, it seems to have suffered fromsoftware ageing and half the calls don't seem to be present (in2.6.2). Can anybody offer a current equivalent of his fragment?
___pygtk mailing list pygtk@daa.com.auhttp://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] create help for a multiplatform app

2005-07-28 Thread pier carteri
Hi to all,
I'm developing a multiplatform app with python and gtk. It must work fine in linux and in window (maybe also OsX). 
As every good app It must have an help (better a contextual help) showing how to use it.
But at this point I'm not sure what to do. I can see more than one option:

1) Using text capabilities of gtk (TextView, TextBuffer) I can create a doc browser that can
display help, images and also simulate hyperlink.
Pro
-easy to implement
-no other packages needed
-work on all gtk platform

Con
-Doc must be stored plain text file (i.e. no html support)
-No real print capabilities 
-Producing doc also requires some programming knoledge

2)I can create a pdf manual (have you any suggestion about tools I can use for this task?)
Pro
-Multiplatform
-Print support
-No programming knowledge

Con
-Need external app
-Not sure how well AcrobatReader/evince/gpdf/(others?) can be manipulated from a pygtk-app: should I write 
specific code for every apps?

3)I can use an external widget like gtkhtml to create a
simple browser for html pages (open
a real browser like firefox for 
display a simple plain html page is a waste of resources IMHO)
Pro 
-Doc in html

Con
-Need external package (not sure if these widget are also available for windows) and they must have also python bindings

4) Other ideas?

Which street should I follow?

Thank you!

Pier


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Is this the most reasonable way to put a stock icon in a Button?

2005-07-27 Thread pier carteri
Hi Francesco,
probably I didn't undestand you question but:
close_button = gtk.Button(stock =gtk.STOCK_CLOSE )

Is that what you need?

For more info
http://www.pygtk.org/pygtk2reference/class-gtkbutton.html#constructor-gtkbutton

Regards

Pier
On 7/26/05, Francesco Marchetti-Stasi [EMAIL PROTECTED] wrote:
Well, basically, the subject says it all. I'd just like to add that I'mdoing it in a small command bar, where I have a label, a text entry,and a few buttons laid around, so a Toolbar does not look like a
reasonable option. close_button = gtk.Button() pixbuf = close_button.render_icon( gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU ) image = gtk.Image() image.set_from_pixbuf( pixbuf )
 image.show() close_button.add( image )Still, I could use a Toolbar with a single button inside, and the codewouldn't be much longer, I suppose. Are there other ways to do it? Or is
it better to stick with the above code?Thanks,Francesco.___pygtk mailing list pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtkRead the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] set_text problem

2005-07-25 Thread pier carteri
Hi Ogz,On 7/25/05, Ogz [EMAIL PROTECTED] wrote:
Here is a code that should show a text at a label and continue withssh connection:...some code...txt = testself.lbl_burn.set_text(txt)self.MainWindow_Sefir.show_all
()
I suspect (but I'm not completely sure) that here you should use

while gtk.event_pending():
 gtk.main_iteration()

Regards 

Pier

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] sourceview and gtkmozembed for windows

2005-06-01 Thread pier carteri
Hi to all,
any idea where I can find packages for windows platform of gtksourceview and gtkmozembed.
I know both of them should be portable to win but I'm not able
to find any infos on how to
do it .
At the moment I don't have an environment for compiling C code under
windows so if you answer is download the tarball and compile yourself
 please give me some infos about the simplest way to obtain the
environment (cygwin, ..others?)

Thank you!

Pier  
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] gtk dock widget

2005-05-16 Thread pier carteri
Hi to all,
I'm looking for a dock widget to use in my pygtk app. I' ve searched a
bit with google and I' ve found that
probably gdl is what i need. But I was not able
to find any infos/homepage of this project.
Have you any tips or ideas?

Thanks

Pier
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] gdl.DockBar question

2005-05-16 Thread pier carteri
Hi to all,
I've played a bit with gdl package (thanks John for you previous mail).
In my example (see attach) I've problems with the DockBar because it
never shows icons when items are minimized. Please consider that I
don't have any documents about these widget, and my code is merely
based on gnome-python-extra example and on the C example test-dock.c,
so probably I' ve missed somethings.

Any ideas?

Thanks


DockExample.py
Description: Binary data
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] error loading gtksourceview

2005-02-20 Thread pier carteri
Hi to all,
I' ve downloaded and installed gtksourceview v 1.1.92 and then
downloaded and installed gnome-python-extra 2.9.4.
But when I try to load gtksourceview in python I get the following error:
 import gtksourceview
Traceback (most recent call last):
  File stdin, line 1, in ?
ImportError: /usr/lib/python2.3/site-packages/gtk-2.0/gtksourceview.so:
undefined symbol: gtk_source_view_set_highlight_current_line

Any idea?

Thank you!
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gnomeprint questions

2003-11-28 Thread Pier Carteri
Hi to all,
I'm replying to myself after a night spent on gnomeprint I've found some
answers:

-the basic method for print string with gnomeprint is to use the show()
method of the GnomePrintContext object. First you have to set the cursor
position using the move() method (the origin is on the bottom-left
corner) and than you can show your string. if you want to know width and
height of the string you can use the method get_width_utf8(the string)
of object GnomePrintFont. For height info is more obscure; I'm using
this but I don't know if there is a better solution:

font_height = font.get_ascender() + font.get_descender()

where font is a GnomePrintFont.

-there is no easy way for print the contens of a TextBuffer according
with tags. I've looked on some C sources of gtkSourceView project
assuming that they know very well gnomeprint internals, (at least better
than me :-) and the procedure they use is the following:
basically for every chars in a line, you must look at its tags, take the
one with highest priority and set the font according with the tag (i.e.
weight foreground color, ). As said before you have to do this for every
char.

Once again I'm not sure this is the only solution (or the best solution)
because I'm not an expert of gnomeprint. So if someone has more infos,
please share with us! :-) 

I've attached an example and I hope that it can be useful to someone
else; just a few words about it. It is inspired by the examples of
Gustavo Carneiro (great work Gustavo!), you can grab it on gnome CVS.
You start the example passing a file to print. Please note that the
program save your print configuration on a file conf so you can have
persistence of your settings over executions. If you make a selection
into the TextView the gnomeprint Dialog will add the print selection
option. You can enable/disable the line_number on output and you can
change its step (change the self.print_line_number and
self.line_number_step on __init__ method). If the line is too long, the
program simply truncate it (and put a small arrow to indicate it). This
is ok for my needs but probably not for your, so change it...


I hope this can help!

Regards
Pier





Il mer, 2003-11-26 alle 17:18, Fernando San Martn W. ha scritto:
 El mi, 26-11-2003 a las 12:51, Pier Carteri escribi:
  Hello!
  I'm trying to print the contens of a gtkTextBuffer using gnomeprint, and
  I've some questions:
  -I'm using the show() function to print the line and I would like to
  know how to wrap the line if it's too long; more precisely, how can I
  have infos about the width and height of the string I'm showing?
  
  -Are there any easy way to print text according with the tags into the
  textBuffer (at least for foreground-color, weight and style properties)?
  Thanks to all!
  
 
 have you any code to show, i'm trying to do the same!
 
 regards
-- 
Pier Carteri [EMAIL PROTECTED]
import pygtk; pygtk.require(2.0)
import gtk, gnome, gnomeprint, gnomeprint.ui

import time,os

CONFIG_FILE_NAME=conf

class PrintAssistant:

def __init__(self, source, file_name):


self.source = source
self.file_name = file_name
self.config = self.load_config()
self.job = gnomeprint.Job(self.config)

self.print_line_number = gtk.TRUE
self.line_number_step = 5

self.print_range = all





def show_print_dialog(self):
dlg = gnomeprint.ui.Dialog(self.job, Print dialog, 
gnomeprint.ui.DIALOG_RANGE|
gnomeprint.ui.DIALOG_COPIES)

#check if there is a selection into the current buffer
if len(self.source.get_selection_bounds())0:
dlg.construct_range_page(gnomeprint.ui.RANGE_ALL|
 gnomeprint.ui.RANGE_SELECTION,
 1, 1, A, Pages)
else:
dlg.construct_range_page(gnomeprint.ui.RANGE_ALL,
 1, 1, A, Pages)
 
dlg.connect(response, self.actions)
dlg.show()


def actions(self, dialog, ans): 
if ans == gnomeprint.ui.DIALOG_RESPONSE_CANCEL:
self.quit(dialog)
if dialog.get_range() == gnomeprint.ui.RANGE_SELECTION:
self.print_range = selection
if ans == gnomeprint.ui.DIALOG_RESPONSE_PRINT:
self.start_print() 

if ans == gnomeprint.ui.DIALOG_RESPONSE_PREVIEW:
self._show_preview(dialog)




def render_text_buffer(self):
Read information from a TextBuffer and create a PrintJob

width, height = gnomeprint.job_get_page_size_from_config(self.config)
# obtain font infos
font = gnomeprint.font_find_closest(Bitstream Charter Regular, 12)
font_height = font.get_ascender() + font.get_descender()
line_spacing = font.get_size() * 1.2

[pygtk] gnomeprint coordinates

2003-11-22 Thread Pier Carteri
Hi to all,
I'm playing with gnomeprint  and I've the following question: as default
the origin of the coordinates is on the bottom-left corner but I prefer
it on the top-left, how can I change it? 
Thank you!

Best regards!
Pier
-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Py_Shell.py

2003-11-05 Thread Pier Carteri
Hi Yang,
 I'm not sure to undestand well you question (feel free to correct me).
There are two possibilities: the former is use Py_Shell to load your
program, but this way can be really difficult especially if the program
you load is a gui (with gui I mean something that call the
gtk.main_loop) because the second call to main_loop will freeze the
Py_Shell interface; a lot of work should be done to avoid possible
deadlock etc., and this is a bit out of scope for Py_Shell.
 
The latter way is create your gui which embed Py_Shell  and pass to the
shell a local dictionary. I'm going to explain last sentence (that's not
clear also to me :-))
Py_Shell is based on InteractiveConsole (IC) (InteractiveConsole and
InteractiveInterpreter are located into the code module, you can see the
python doc for more infos). When you create an IC object you can pass it
a dictionary; every command send to the IC will be executed into the
environment based on that dictionary so this is probably what you are
looking for . 

So try somethings like this: in Py_Shell change the line where it's
created the InteractiveConsole (around line 287)

self.core=code.InteractiveConsole()

and replace with

self.core=code.InteractiveConsole(locals())

Hope this helps

Best regards!
Pier 

Il mar, 2003-11-04 alle 23:55, Yang Zheng ha scritto:
 Hello Pier,
 
 That fixed my problem, thanks a lot for your program and help!
 
 I know this is going to be a bit out of scope of the GUI, but I was
 wondering if it's possible for this Py_Shell to be the original shell
 that is used to load up the gui in the first place.  Say I have this
 Gui.py that loads up functions, variables, and the glade stuff.  When I
 run it, the gui pops out, with your Py_Shell embedded inside. 
 Currently, the Py_Shell inside the gui is a completely new one that has
 no knowlege of the Gui.py functions/variables.  Is there a way for
 Py_Shell to have acess to them?
 
 thanks again,
 ~ Yang
 
 
 On Tue, 2003-11-04 at 11:46, Pier Carteri wrote:
  Hi Yang!
  main_shell=Py_Shell.Shell_Gui(with_window=0)
   xml.get_widget(vpaned1).add2(main_shell.gui)
  
  I've looked to my code, I think the solution is that you miss a
  main_shell.gui.show_all()
  In my code I call it with the empty frame, that's why you see only the
  frame.
  You ca fix it: 
  put line 313  frame.show_all() after line 314  frame.add(box)
  
import pygtk
pygtk.require('2.0')
   Traceback (most recent call last):
 File stdin, line 1, in ?
 File pygtk.py, line 73, in require
   assert versions.has_key(version), \
   AssertionError: required version '2.0' not found on system
  
  It seems that somethings is wrong with your configuration; are you sure
  you have installed pygtk into the right location? The script doesn't
  find  the required version of pygtk  
  
  Hope this help!
  
  Best regards!
  
  Pier
  
  ___
  pygtk mailing list   [EMAIL PROTECTED]
  http://www.daa.com.au/mailman/listinfo/pygtk
  Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
 
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Py_Shell.py

2003-11-05 Thread Pier Carteri
Hi John,
yes I know, Py_Shell does not handle correctly pasted text or dragdrop,
sorry :-(
Theese are  features that I must implement. Next version will have
theese capabilities but don't expect it in the near future because I'm
busy with my thesis now. I hope to do it within weeks but I'm not
sure...

Best regards!
Pier


Il mer, 2003-11-05 alle 14:23, John Hunter ha scritto:
  Pier == Pier Carteri [EMAIL PROTECTED] writes:
 
 Pier I attached a new version of Py_Shell that fix a couple of
 Pier problem: - avoid duplicated entry into the autocompletetion
 Pier list - the width of the autocompletation popup is calculated
 Pier with respect to the length of the strings This version
 Pier requires pygtk 2.0 due to some function (pango.PIXELS) not
 Pier present in previous release (at least 1.99.16)
 
 I Pier -- your shell looks quite nice.  I use Jon Anderson's
 interactive shell with my pygtk plotting library -
 http://matplotlib.sourceforge.net.  One thing I have been dissatisfied
 with, which perhaps you know how to address, is the pasting of
 formatted blocks of code into the shell.  Eg, on my system (RHL9), if
 I mouse-2 paste the following 
 
 class Base:
 def __init__(self):
 print 'hi'
 
 b = Base()
 
 into the python shell it works fine, but if I paste it into Py_Shell
 or Jon's shell, I get the error Base not defined.
 
 Any ideas?
 John Hunter
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Py_Shell.py

2003-11-04 Thread Pier Carteri
Hi to all!

Malcom has right, if you want to  use the shell inside another
application, simply create this with:
gui = Shell_Gui(0)
you will have a frame instead of a window

I'm using Py_Shell inside a bigger app and this is the code I use for
create the shell and put into vpaned widget:

self.main_shell=Py_Shell.Shell_Gui(with_window=0)
glade_file.get_widget(vpaned1).add2(self.main_shell.gui)

Also two things to notice:
if you start the shell with with_window=0, you don't have the exit
button in the button's bar, and the quit method of the Shell_Gui class,
simply hide the frame (if you use with_window=1 this method call a
gtk.main_qiut())


I attached a new version of Py_Shell that fix a couple of problem:
- avoid duplicated entry into the autocompletetion list
- the width of the autocompletation popup is calculated with respect to
the length of the strings
This version requires pygtk 2.0 due to some function (pango.PIXELS) 
not present in previous release (at least 1.99.16)

I'm sorry to post this into the list instead of giving you a link to a
page. I hope to have a web-page for my project (which includes Py_Shell)
in a week or two (I've register it on SF, so the only things that
remains is write the pages.. ). I will post the link ASAP

Best regards!
Pier

  
Il mar, 2003-11-04 alle 02:52, Malcolm Tredinnick ha scritto:
 On Tue, 2003-11-04 at 12:26, Yang Zheng wrote:
  Instead of a popup, I would like to embed your console into a window
  with other existing features (constructed with Glade).  Do you have any
  tips on how to do that?  I am looking into Glade's custom widget, am I
  going in the right direction?
 
 I have not tested what I am about to say -- I just had a quick read over
 Pier's code...
 
 It may not require all the trickiness of using a custom widget. The
 Shell itself is just a frame widget (it you set with_window = 0). If you
 construct the widget as s = Shell_Gui(0), s.gui will be the frame widget
 that you can put into your widget hierarchy at the appropriate point.
 
 So inside your larger application you will have some kind of
 GtkContainer for holding the embedded shell. Just add the new frame
 widget (s.gui) to this container and it should work. There are probably
 a couple of details missing here, but I think the theory is correct. In
 any case, look at the frame created in the Shell_Gui class and utilise
 that directly.
 
 Cheers,
 Malcolm
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Pier Carteri [EMAIL PROTECTED]

#
#   Py_Shell.py : inserts the python prompt in a gtk interface
#

import sys, code, os
import __builtin__


import gtk, gobject, pango

PS1= 
PS2=... 
TAB_WIDTH=4

BANNER=Python +sys.version+\n




class Completer:
  
  Taken from rlcompleter, with readline references stripped, and a local dictionary to use.
  
  def __init__(self,locals):
self.locals = locals

  def complete(self, text, state):
Return the next possible completion for 'text'.
This is called successively with state == 0, 1, 2, ... until it
returns None.  The completion should begin with 'text'.


if state == 0:
  if . in text:
self.matches = self.attr_matches(text)
  else:
self.matches = self.global_matches(text)
try:
  return self.matches[state]
except IndexError:
  return None

  def global_matches(self, text):
Compute matches when text is a simple name.

Return a list of all keywords, built-in functions and names
currently defines in __main__ that match.


import keyword
matches = []
n = len(text)
for list in [keyword.kwlist, __builtin__.__dict__.keys(), self.locals.keys()]:
  for word in list:
if word[:n] == text and word != __builtins__:
  matches.append(word)
return matches

  def attr_matches(self, text):
Compute matches when text contains a dot.

Assuming the text is of the form NAME.NAME[NAME], and is
evaluatable in the globals of __main__, it will be evaluated
and its attributes (as revealed by dir()) are used as possible
completions.  (For class instances, class members are are also
considered.)

WARNING: this can still invoke arbitrary C code, if an object
with a __getattr__ hook is evaluated.


import re
m = re.match(r(\w+(\.\w+)*)\.(\w*), text)
if not m:
  return
expr, attr = m.group(1, 3)
object = eval(expr, self.locals, self.locals)
words = dir(object)
if hasattr(object,'__class__'):
  words.append('__class__')
  words = words + get_class_members(object.__class__)
matches = []
n = len(attr)
for word in words:
  if word[:n] == attr and word != __builtins__:
matches.append(%s.%s % (expr, word))
return matches

def get_class_members(klass):
  ret = dir(klass)
  if hasattr(klass,'__bases__'):
 for base

Re: [pygtk] Py_Shell.py

2003-11-04 Thread Pier Carteri
Hi Jan!

thanks a lot for your feedback and you fix!
I've produced another diff against my Py_Shell.py which includes your
fix and somethings else; a small changelog:

-check for pygtk 2.0 (Jan)
-close/hide when Ctrl-D event is pressed  (Jan)
 enabling this only when Py_Shell is in it's own window 
 (I need it for my app but you can change it ...)
-scrolling back in history returns to an empty prompt
-press Home key into the last line, puts cursor to the start of the
logical line (I mean after )
-the same happens with Left key
- fix a bug with autocompletation (missing a = in separators)

Best regards!

Pier

Il mar, 2003-11-04 alle 12:35, Jan Weil ha scritto:
 Hi Pier,
 
 nice work! Thanks a lot!
 
 Just some comments:
 
 1) I had to add an
 'import pygtk
 pygtk.require('2.0')'
 to make it work.
 
 2) If I scroll back in history using 'up' I am not able to get back to 
 the empty prompt afterwards.
 
 3) Maybe the standalone version could react on 'CTRL-d' by exiting?
 
 Attached is a little diff which solves 1) and 3).
 I didn't try to dig deeper into 2) yet.
 
 Regards,
 
 Jan
 
 Am 2003.11.04 09:55 schrieb(en) Pier Carteri:
 [...]
  
  I attached a new version of Py_Shell that fix a couple of problem:
  - avoid duplicated entry into the autocompletetion list
  - the width of the autocompletation popup is calculated with respect
  to
  the length of the strings
  This version requires pygtk 2.0 due to some function (pango.PIXELS)
  not present in previous release (at least 1.99.16)
  
  I'm sorry to post this into the list instead of giving you a link to a
  page. I hope to have a web-page for my project (which includes
  Py_Shell)
  in a week or two (I've register it on SF, so the only things that
  remains is write the pages.. ). I will post the link ASAP
  
 
 __
 
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Pier Carteri [EMAIL PROTECTED]
9c9,10
 
---
 import pygtk
 pygtk.require('2.0')
227c228
 while start.get_char() not in  ,()[]:
---
 while start.get_char() not in  ,()[]=:
295c296
 self.history=[ ]
---
 self.history=[]
348c349
 if self.history_pos0:
---
 if self.history_pos=0:
365c366
 if self.history_poslen(self.history)-1:
---
 if self.history_pos=len(self.history)-1:
370a372,374
 if self.history_pos==len(self.history)-1:
 gtk.gdk.beep()
 return
375,377c379
 
 else:
 gtk.gdk.beep()
---
 
385c387,406
 
---
 
 elif event.keyval ==gtk.gdk.keyval_from_name(Home):
 last_line=self.buffer.get_end_iter().get_line()
 
 cur_line=self.buffer.get_iter_at_mark(self.buffer.get_insert()).get_line()
 if last_line == cur_line:
 iter=self.buffer.get_iter_at_line(cur_line)
 iter.forward_chars(4)
 self.buffer.place_cursor(iter)
 self.view.emit_stop_by_name(key-press-event)
 return gtk.TRUE
  
 elif event.keyval ==gtk.gdk.keyval_from_name(Left):
 last_line=self.buffer.get_end_iter().get_line()
 cur_pos=self.buffer.get_iter_at_mark(self.buffer.get_insert())
 cur_line=cur_pos.get_line()
 if last_line == cur_line:
 if cur_pos.get_line_offset()==4:
 self.view.emit_stop_by_name(key-press-event)
 return gtk.TRUE 
   
398c419,425
 
---
 elif (event.keyval ==gtk.gdk.keyval_from_name(d) and 
  event.state  gtk.gdk.CONTROL_MASK and 
  isinstance(self.gui, gtk.Window)) :
 #enable Ctrl-D only if Shell is in a separate window
 self.quit()
 return gtk.TRUE
 
554a582
 Return the cursor line without the  or ... 
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Py_Shell.py

2003-11-04 Thread Pier Carteri
Hi Yang!
main_shell=Py_Shell.Shell_Gui(with_window=0)
 xml.get_widget(vpaned1).add2(main_shell.gui)

I've looked to my code, I think the solution is that you miss a
main_shell.gui.show_all()
In my code I call it with the empty frame, that's why you see only the
frame.
You ca fix it: 
put line 313  frame.show_all() after line 314  frame.add(box)

  import pygtk
  pygtk.require('2.0')
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File pygtk.py, line 73, in require
 assert versions.has_key(version), \
 AssertionError: required version '2.0' not found on system

It seems that somethings is wrong with your configuration; are you sure
you have installed pygtk into the right location? The script doesn't
find  the required version of pygtk  

Hope this help!

Best regards!

Pier

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] put small images into a TextView border window

2003-11-03 Thread Pier Carteri
Hi to all!
I reply to myself, because I've found the solution of my question.
To better undestand what I mean with small images into a gtk.TextView
border window you can have a look to the screenshot I attached.

So, step one obtain a reference to the border window you want to use

left_win= view.get_window(gtk.TEXT_WINDOW_LEFT) #view is an instance
#of gtk.TextView
than create a color to use as background color for your image; to obtain
a color you can do the follow:

colormap=left_win.get_colormap()
color=colormap.alloc_color(seashell)  

(seashell is the border color of the screenshot)

 
At this point you can create a pixmap from file. I use the function
gtk.gdk.pixmap_create_from_xpm:

(pixmap, mask)= gtk.gdk.pixmap_create_from_xpm(left_win, color, 
file_name )

Obtain image width and height

(width, height)= pixmap.get_size()

Finally you can put the pixmap into the border window with draw_drawable
method

left_win.draw_drawable(gc, pixmap, src_x, src_y, des_x , des_y, width,
height)

gc is the graphics context obtained with a call like this

gc = left_win.new_gc()

I hope this can be useful to someone else..

Best regards!
Pier




Il gio, 2003-10-30 alle 10:22, Pier Carteri ha scritto:
 Hi to all,
 can someone tell me how to put an image into the border window of a
 gtkTextView? 
 Any examples?
 

-- 
Pier Carteri [EMAIL PROTECTED]
attachment: shot.png___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] put small images into a TextView border window

2003-10-30 Thread Pier Carteri
Hi to all,
can someone tell me how to put an image into the border window of a
gtkTextView? 
Any examples?

Thank you!
Best regards

Pier Carteri
-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] control pasted text

2003-10-28 Thread Pier Carteri
Hi to all!
I'm developing an editor based on gtkTextView and gtkTextBuffer.
I'm looking for the possibility to perform some actions with pasted
text. More precisely if a user paste some text into the editor, I must
be able to control if there are not permitted chars (for example tabs)
or at least to know the length of pasted text.
For the second problem (to know the length of pasted text)the only
solution I've found is to get the char_count before and after
paste_clipboard is emitted, so the difference of the two values is the
length of pasted text, but I'm not sure that this is the correct
solution.
Has anyone some tips about this? Where should I look for clipboard
informations?

Thank you!

Best Regards
Pier Carteri


-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] gnome-print tutorial

2003-10-13 Thread Pier Carteri
Hi to all,
I'm looking for a tutorial about gnome-print library because the example
in gnome-python is not enough... The gnome-print website seems to have
outdated informations (Jul 2000) and a quick search with google gives me
nothings interesting. 

Any links or more complicated examples?
Thankyou!

Best regards

Pier

 
-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Get characters in a TextView

2003-10-11 Thread Pier Carteri
Hi,
for have an iter at the current cursor position you can do:

iter=buffer.get_iter_at_mark(buffer.get_insert())

at this point you use iter.get_char() for obtain the current char,
then move the iter with iter.backward_char() and again iter.get_char()
for check the previous char

Best Regards!

Pier

Il sab, 2003-10-11 alle 06:37, Dvik ha scritto:
 Hi!
 
 I'd like to know what are the 2 characters around the cursor in a
 TextView in a given moment. How should I do it?
 
 I found TextIter.get_char(), but it only gets the next character, not
 the previous. Besides, I don't know how to create a TextIter of the
 current offset of the cursor.
 
 Why all this? I want a TextView where no 2 spaces can be written one
 after the other, just like in lyx.
 



-- 
Pier Carteri [EMAIL PROTECTED]

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Py_Shell.py

2003-10-04 Thread Pier Carteri
Hi to all,
I'm sending a file with my version of a Python console inside a gtk Gui.
Features:
-autocompletation using a nice popup window (Ctrl-space)
-possibility to save session (command only or command+output)

This code is strongly inspired by

Johan Dahlin for console.py 
Jon Anderson for pygtk-console.py
James Henstridge for gtkcons.py (Gtk 1 version)
so many thanks to them!

I' sending this with the hope it can be usefull to someone else.

Best regards
Pier Carteri

-- 
Pier Carteri [EMAIL PROTECTED]

#
#   Py_Shell.py : inserts the python prompt in a gtk interface
#
#Author: Pier Carteri [EMAIL PROTECTED]
#This script provides an interactive Python shell with :
#-autocompletation (using a nice popup window); try Ctrl+space..
#-save sessions (only command or command+output)
#
#Many thanks to:
#Johan Dahlin for console.py 
#Jon Anderson for pygtk-console.py
#James Henstridge for gtkcons.py (Gtk 1 version)
#
#In the code below the class Completer is from pygtk-console.py of Jon Anderson
#
#



import sys, code, os
import __builtin__


import gtk, gobject

PS1= 
PS2=... 
TAB_WIDTH=4

BANNER=Python +sys.version+\n




class Completer:
  
  Taken from rlcompleter, with readline references stripped, and a local dictionary to use.
  
  def __init__(self,locals):
self.locals = locals

  def complete(self, text, state):
Return the next possible completion for 'text'.
This is called successively with state == 0, 1, 2, ... until it
returns None.  The completion should begin with 'text'.


if state == 0:
  if . in text:
self.matches = self.attr_matches(text)
  else:
self.matches = self.global_matches(text)
try:
  return self.matches[state]
except IndexError:
  return None

  def global_matches(self, text):
Compute matches when text is a simple name.

Return a list of all keywords, built-in functions and names
currently defines in __main__ that match.


import keyword
matches = []
n = len(text)
for list in [keyword.kwlist, __builtin__.__dict__.keys(), self.locals.keys()]:
  for word in list:
if word[:n] == text and word != __builtins__:
  matches.append(word)
return matches

  def attr_matches(self, text):
Compute matches when text contains a dot.

Assuming the text is of the form NAME.NAME[NAME], and is
evaluatable in the globals of __main__, it will be evaluated
and its attributes (as revealed by dir()) are used as possible
completions.  (For class instances, class members are are also
considered.)

WARNING: this can still invoke arbitrary C code, if an object
with a __getattr__ hook is evaluated.


import re
m = re.match(r(\w+(\.\w+)*)\.(\w*), text)
if not m:
  return
expr, attr = m.group(1, 3)
object = eval(expr, self.locals, self.locals)
words = dir(object)
if hasattr(object,'__class__'):
  words.append('__class__')
  words = words + get_class_members(object.__class__)
matches = []
n = len(attr)
for word in words:
  if word[:n] == attr and word != __builtins__:
matches.append(%s.%s % (expr, word))
return matches

def get_class_members(klass):
  ret = dir(klass)
  if hasattr(klass,'__bases__'):
 for base in klass.__bases__:
   ret = ret + get_class_members(base)
  return ret







class Dummy_File:

def __init__(self, buffer, tag):
Implements a file-like object for redirect the stream to the buffer

self.buffer = buffer
self.tag = tag

def write(self, text):
Write text into the buffer and apply self.tag
iter=self.buffer.get_end_iter()
self.buffer.insert_with_tags(iter,text,self.tag)

def writelines(self, l):
map(self.write, l)

def flush(self):
pass

def isatty(self):
return 1



class PopUp:

def __init__(self, text_view, list, position):
self.text_view=text_view
self.list=list
self.position=position
self.list.sort()
self.popup=gtk.Window(gtk.WINDOW_POPUP)
frame=gtk.Frame()
sw=gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
model=gtk.ListStore(gobject.TYPE_STRING)
for item in self.list:
iter=model.append()
model.set(iter, 0, item)
self.list_view=gtk.TreeView(model)
self.list_view.connect(row-activated, self.hide)
self.list_view.set_property(headers-visible, gtk.FALSE)
selection=self.list_view.get_selection()
selection.connect(changed,self.select_row)
selection.select_path((0,))
renderer=gtk.CellRendererText()
column=gtk.TreeViewColumn(,renderer,text=0)
self.list_view.append_column(column)
sw.add(self.list_view)
frame.add(sw

[pygtk] draw on TextView borders

2003-02-15 Thread Pier Carteri
Hi to all,
I would like to know if it's possible to draw somethings on TextView
borders. According with testtext example it can be done with the C
version of gtk but I can't undestand how to do it with pygtk. (with draw
I mean the possibility to  add small images or line numbers...)
Has anyone already done this? How?
Any tips or code example will be great

Thank you!

Pier Carteri



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] error with libglade

2002-12-12 Thread Pier Carteri
Hi to all,
I was playing a bit with pygtk+Glade+libglade. I've created a minimal
Gnome gui with Glade (just click on the Glade Palette the
Gnome-Application-Window button and save the file). When I've tried to
display the gui I've received the following errors/warnings.

(test:814): GLib-GObject-WARNING **: invalid cast from (NULL) pointer to
`GObject'

(test:814): GLib-GObject-CRITICAL **: file gobject.c: line 972
(g_object_get): assertion `G_IS_OBJECT (object)' failed

(test:814): GLib-GObject-WARNING **: invalid cast from (NULL) pointer to
`GObject'

(test:814): GLib-GObject-CRITICAL **: file gobject.c: line 972
(g_object_get): assertion `G_IS_OBJECT (object)' failed

(test:814): Gnome-CRITICAL **: file gnome-program.c: line 738
(gnome_program_get_app_id): assertion `program != NULL' failed

(test:814): GConf-CRITICAL **: file gconf-client.c: line 545
(gconf_client_add_dir): assertion `gconf_valid_key (dirname, NULL)'
failed

(test:814): Gnome-CRITICAL **: file gnome-program.c: line 869
(gnome_program_locate_file): assertion `program != NULL' failed

(test:814): Gnome-CRITICAL **: file gnome-program.c: line 869
(gnome_program_locate_file): assertion `program != NULL' failed


The gui was correctly displayed so my question is: what does this
warnings/errors mean? Can I simply ignore it?

I'm on RH 8.0 with pygtk2-1.99.12 gnome-python2-1.99.11 libglade2-2.00

Thank you!

Regards
Pier
 

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re:[2] [pygtk] replace tab with spaces

2002-07-22 Thread Pier Carteri

Hi again,
Thanks Mr Reis for your answer, but this is not what I want to do; probably my 
question was not so clear, 
so I rewrite it in a more accurate way (at least I hope :-)

I'm writing a simple editor, and I want that when a user press a tab-key this char is 
automatically replaced 
with some spaces. I've tried to added a callback to the insert-text signal but using 
this event I obtain a 
buffer with some spaces after a tab  (instead of one with only spaces).
Which signal should i use?

Thank you

Pier Carteri

Christian Reis [EMAIL PROTECTED] wrote on 21/07/02 21.21.26:

On Sun, Jul 21, 2002 at 07:13:50PM +0200, [EMAIL PROTECTED] wrote:
 
 
 Hi to all,
 i'm looking for the easiest way to automatically replace tab with spaces into a
 GtkTextBuffer. Has anyone already found the solution?

string.replace(\t, ,buffer.get_text()) ?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] TextBuffer and g_utf8_validate

2002-03-04 Thread Pier Carteri

Hi,
as said in my previous post (I hope not boring you ) I'm working on a
code editor based on GtkTextBuffer and GtkTextView; the method for load
a file is something like this:
try:
file=open(self.name,'r')
text=file.read()
start=self.buffer.get_start_iter()
self.buffer.insert(start,text,-1)
self.set_save_point()
except:
do somethings

Usually everythings works as supposed but sometimes I have the following
error:

editor(pid:1549): Gtk-CRITICAL **: file gtktextbuffer.c line 476
(gtk_text_buffer_emit_insert): assertion 'g_utf8_validate (text, len,
NULL)' failed

The files are normal text file; where is the error?

(gtk2 1.3.14 python2.2 pygtk 1.99.7)

Thank you!

Pier


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



Re: [pygtk] gtkMessageDialog

2002-03-03 Thread Pier Carteri

Hi,
the solution of this problem was simply to update my configuration:
I've download and install more recent rpm for rawhide (1.3.14) and pygtk
1.99.7
So for other RedHat user that want to use precompiled binaries I
strongly raccomanded not use the following packages:
gtk2-1.3.12-90
gtk2-devel-1.3.12-90
glib2-1.3.12-90
glib2-devel-1.3.12-90
because they seems to be incomplete packages.

Have a nice week!

Pier


Il ven, 2002-03-01 alle 16:59, [EMAIL PROTECTED] ha scritto:
 
 Hi to all,
 for create a gtkMessageDialog I do the following (according with gtk
 demo):
 dlg=gtk.MessageDialog(win,gtk.DIALOG_DESTROY_WITH_PARENT,gtk.MESSAGE_ERROR,
   gtk.BUTTONS_CANCEL,some text)
 
 but I've an error because DIALOG_DESTROY_WITH_PARENT (or DIALOG_MODAL)
 is not defined into the gtk module. Where can I found it?
 
 (I've pygtk 1.99.6 gtk2 1.3.12-90 python2.2)
 Thank
 
 Pier
 
 ___
 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



[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



[pygtk] mainloop vs mainiterator

2001-10-12 Thread Pier Carteri


Hi to all,
I've created a small class that show a splash screen with an image and a
progressbar. At the end of my module I've add some lines for test the
class:

if __name__==__main__:
sp=Splash_screen(splash_screen.png,1)
sp.show()
sp.bar_update(carico, 0.1)
time.sleep(4)
sp.bar_update(carico, 0.4)
time.sleep(3)
sp.bar_update(carico, 0.9)
time.sleep(0.1)
gtk.mainloop()

The window is not shown correctly (basically the bar was never updated
)and I'm quite sure that the problem is the mainloop call. I've noticed
that the gtk module has also a mainiterator method that probably is what
I need: can you please tell me what's the difference between mainloop
and mainiterator ?

Best Regards

Pier Carteri

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



Re: [pygtk] mainloop vs mainiteration

2001-10-12 Thread Pier Carteri

I'm sorry, I've mispelled: the method is not mainiterator but
mainiteration; the question is the same: mainiteration vs mainloop


On 12 Oct 2001 10:36:19 +0200, Pier Carteri wrote:
 
 Hi to all,
 I've created a small class that show a splash screen with an image and a
 progressbar. At the end of my module I've add some lines for test the
 class:
 
 if __name__==__main__:
 sp=Splash_screen(splash_screen.png,1)
 sp.show()
 sp.bar_update(carico, 0.1)
 time.sleep(4)
 sp.bar_update(carico, 0.4)
 time.sleep(3)
 sp.bar_update(carico, 0.9)
 time.sleep(0.1)
 gtk.mainloop()
 
 The window is not shown correctly (basically the bar was never updated
 )and I'm quite sure that the problem is the mainloop call. I've noticed
 that the gtk module has also a mainiterator method that probably is what
 I need: can you please tell me what's the difference between mainloop
 and mainiterator ?
 
 Best Regards
 
 Pier Carteri
 
 ___
 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



[pygtk] pixmap and label on notebook

2001-02-03 Thread Pier Carteri

Hi,
first of all thanks to Ricardo Caesar Lenzi and Dave Reed for their
mails; now my CList manages the double click
very well.
Now I have another question: I'd like to have a notebook that shows on
its tabs not only a label but also a pixmap;
Using Glade it's quite easy to obtain it , but it will be better if i
create it by code; can you suggest me how to do it?

Thanks a lot


Pier Carteri
[EMAIL PROTECTED]


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