[pygtk] gnomeprint questions

2004-03-04 Thread Alex Roitman
Hello,

I have a few questions about gnomeprint. Some of them are not specific to
python bindings, but in case anybody on this list knows the answer I would 
greatly appreciate any help.

1. How do I set the paper size for a job? I know that it can be later
selected from the menu, but I would like to set it to the specified
size before the job is laid out. Right now I have this:

job = gnomeprint.Job(gnomeprint.config_default())
pc = job.get_context()

I also read Pier Carteri's mail with the snippet using config.to_string()
and config.from_string() which would involve using file or on-the-fly
assembled XML. Is there any other method for setting the page size?
Something like config.set("PAGE_SIZE","US-Letter") ?

2. How do I find the proper line spacing for the font? I can see
get_ascender() and get_descender() methods of gnomeprint.Font()
as well as properties like XHeight and CapHeight. Is there any specific
property for a correct spacing?

3. Along the same line, what would be a proper superscript size/elevation
for a given font? I seem to like size two points smaller than the
regular text's font and the elevation of 1/4 of the line spacing,
but I'm sure there are well established standards. What are they?

4. What font does one use to print non-latin characters? I thought that
Sans, Serif, and Monospace are the ones that are guaranteed to exist
on gnome desktop, but none of them can print e.g. cyrillic. I can print
cyrillic with Times New Roman, but there's no guarantee that each user
will have this font installed. Any advice on "standard" solution?

I apologize if the above questions are too silly, but I just can't find 
good answers.

Thanks for any help,
Alex

-- 
Alexander Roitman   http://ebner.neuroscience.umn.edu/people/alex.html
Dept. of Neuroscience, Lions Research Building
2001 6th Street SE, Minneapolis, MN  55455
Tel (612) 625-7566   FAX (612) 626-9201


signature.asc
Description: Digital signature
___
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] Focus and CList

2004-03-04 Thread Christian Robottom Reis
On Thu, Mar 04, 2004 at 03:52:02PM -0500, Jamey Cribbs wrote:
> I have a CList with several columns on a window.  When the you click on 
> a clist column header, it puts a dashed-line around the column header (I 
> guess it is making it the focused widget).  Is there a way to turn this 
> off.  I don't like the look of the dashed-line around the column header.

The default GTK+ theme doesn't add a dashed line around CList, so I'm
really wondering what theme you're using at your site. The default theme
has the selected CList column header rendered with a thicker border.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
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] Focus and CList

2004-03-04 Thread Jamey Cribbs
I have a CList with several columns on a window.  When the you click on 
a clist column header, it puts a dashed-line around the column header (I 
guess it is making it the focused widget).  Is there a way to turn this 
off.  I don't like the look of the dashed-line around the column header.

Thanks.

Jamey

Confidentiality Notice: This email message, including any attachments, is for the sole 
use of the intended recipient(s) and may contain confidential and/or privileged 
information. If you are not the intended recipient(s), you are hereby notified that 
any dissemination, unauthorized review, use, disclosure or distribution of this email 
and any materials contained in any attachments is prohibited. If you receive this 
message in error, or are not the intended recipient(s), please immediately notify the 
sender by email and destroy all copies of the original message, including attachments.
___
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] Gnome panel output

2004-03-04 Thread Peter Tennekes
Thank to thoose who helped, butI found the solution somewhere else.
Putting the applet in a windew helps to detect most problems, but thoose
related to the specific panel environment are not shown. What I did was
simply redirecting the stdout and stderr:

def redirect_out(self,file):
stdo = open(file+".out", 'w',0)
stde = open(file+".err",'w',0)
sys.stderr = stde
sys.stdout = stdo

and that in a terminal tail -f .out or .err

the 0 buffer is needed to ensure that output is directly going to the
file instead of only after it is closed.

On Wed, 2004-03-03 at 18:43, Gustavo J. A. M. Carneiro wrote:
> A Qua, 2004-03-03 às 16:22, Peter Tennekes escreveu:
> > Hi I am working on a gnome panel applet and works fine, however problems
> > and bugs, of course, arise from time to time. The question is how to
> > intercept the output generated by errors and commands like print?
> 
>  tail -f ~/.xsession-errors
> 
> > 
> > thanks in advance!
> > 
> > 
> > ___
> > 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/


Re: [pygtk] Is a bug in gtk.Menu - Motion/Enter/Leave_Notify Event ???

2004-03-04 Thread Martin Grimme
Am Do, den 04.03.2004 schrieb [EMAIL PROTECTED] um 15:20:
> I want to make a menubar.deselect() when the mouse leave the application 
> (i want avoid, that the popupmenu will still on top, if the user change 
> into a other application). 
> 
> Problem: When the menu is popup i get only events from this menu. 
> I can move the mousepointer around the toplevel window but i get the 
> motion event from the menu. When i leave the toplevel window, i get a 
> leave event from the menu. 

Menu windows grab the mouse pointer globally. Therefore other windows
cannot receive events.

> I think its wrong (bug), because leave the toplevelwindow i shout get the 
> event from the window, not from the menu. 

The grabbing is not a bug but intentional. That way you can safely click
anywhere on the screen to close the menu without action.
> If it is correct - Why (and how can i  solve my problem) ?

If you really need to work around this, then consider implementing your
own menu widget instead of using the one of GTK.
Or you could run a timer that regularly checks if the mouse pointer is
still within the application window (gtk.Window.get_position(),
gtk.Window.get_size()) and close the menu if not.


Martin Grimme


___
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] Is a bug in gtk.Menu - Motion/Enter/Leave_Notify Event ???

2004-03-04 Thread Martin . Zohlhuber
I want to make a menubar.deselect() when the mouse leave the application 
(i want avoid, that the popupmenu will still on top, if the user change 
into a other application). 

Problem: When the menu is popup i get only events from this menu. 
I can move the mousepointer around the toplevel window but i get the 
motion event from the menu. When i leave the toplevel window, i get a 
leave event from the menu. 

I think its wrong (bug), because leave the toplevelwindow i shout get the 
event from the window, not from the menu. 

The leave and enter event of the menu also occur, when i move the mouse in 
the popup menu and the menuitem change. I think this is not a very good 
implementation,  because the menu-widget was not leaved. 

For better understanding a add a small program. 

Have i make something wrong ? 
Is this a bug  ?  (use w2k, pygtk 2.0, gtk 2.2.4)
If it is correct - Why (and how can i  solve my problem) ?
Have somebody other the same failure ?

Thanks for any help !

martin

---
import gtk

def _cb_win_leave(widget, event, data=None):
print "window leave", widget
def _cb_win_enter(widget, event, data=None):
print "window enter", widget
def _cb_win_motion(widget, event, data=None):
print "window motion", widget
def _cb_menu_leave(widget, event, data=None):
print "_menu_ leave", widget
def _cb_menu_enter(widget, event, data=None):
print "_menu_ enter", widget
def _cb_menu_motion(widget, event, data=None):
print "_menu_ motion", widget


window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.show()
window.set_default_size(210, 300)
window.add_events(gtk.gdk.LEAVE_NOTIFY|gtk.gdk.ENTER_NOTIFY|gtk.gdk.MOTION_NOTIFY)
window.connect("leave_notify_event", _cb_win_leave)
window.connect("enter_notify_event", _cb_win_enter)
window.connect("motion_notify_event", _cb_win_motion)

menu_items = ( # menupath, accel, callback, callbackaction, itemtype, 
stock
 ( "/File",  None,  None , 0, "" ),
 ( "/File/Open", None,  None , 1, None),
 ( "/Edit",  None,  None , 0, "" ),
 ( "/Edit/Undo", None,  None , 1, None),
 ( "/Edit/Cut", None,  None , 1, None),
 ( "/Edit/Paste", None,  None , 1, None),
 ( "/Edit/Copy", None,  None , 1, None)
 )

accel_group = gtk.AccelGroup()
item_factory = gtk.ItemFactory(gtk.MenuBar, "", accel_group)
item_factory.create_items(menu_items)
menubar = item_factory.get_widget("")
menubar.show()
item = item_factory.get_widget("/Edit") 
item.add_events(gtk.gdk.LEAVE_NOTIFY|gtk.gdk.ENTER_NOTIFY|gtk.gdk.MOTION_NOTIFY)
item.connect("leave_notify_event", _cb_menu_leave)
item.connect("enter_notify_event", _cb_menu_enter)
item.connect("motion_notify_event", _cb_menu_motion)

item = item_factory.get_widget("/File") 
item.add_events(gtk.gdk.LEAVE_NOTIFY|gtk.gdk.ENTER_NOTIFY|gtk.gdk.MOTION_NOTIFY)
item.connect("leave_notify_event", _cb_menu_leave)
item.connect("enter_notify_event", _cb_menu_enter)
item.connect("motion_notify_event", _cb_menu_motion)

box = gtk.VBox()
box.show()
box.pack_start(menubar, gtk.FALSE, gtk.FALSE)
b = gtk.Button("Fill rest of the area")
b.connect("clicked", gtk.mainquit)
b.show()
box.pack_start(b)
window.add(box)
gtk.main()

___
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] Tree View Widget

2004-03-04 Thread Christian Robottom Reis
[Thomas Moore]
> > Hi:
> > 
> > I've found tutorial Chapter 14, "Tree View Widget" is empty.
> > Is there any example to demonstrate how to use this widget?

[Ling Li]
> Following is a scratch of code in one of my program, it only uses ListStore.
> I hope it will be some help.

Note that the sources to the PyGTK tutorial and reference documentation
have been checked into GNOME CVS by John Finlay. We've also created a
Bugzilla "documentation" component that is under the "pygtk" product. So
file bugs there on what you feel is needed:

http://bugzilla.gnome.org/enter_bug.cgi?product=pygtk

By doing this, we're encouraging people to actively open bugs on parts
of the tutorial/reference that are missing or incomplete. We're also
interested in receiving patches to the docs which add or fix these bits.

Help us keep our docs as high-quality as you'd like them to be!

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
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] Tree View Widget

2004-03-04 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I used a treeview in the LinuxJournal article as well. It might be
worth a read...
- -dave


Ling Li wrote:

| Following is a scratch of code in one of my program, it only uses
| ListStore. I hope it will be some help.
|
| class Local():
|
| COL_ICON = 0 COL_FILENAME = 1 COL_FILESIZE = 2 COL_FILETYPE = 3
| COL_FILEMTIME = 4 COL_ISDIR = 5 COL_SIZE_IN_BYTES = 6 COL_MTIME = 7
|
|
| def __init__(self): # a lot of lines omitted here
|
| # file list # init a ListStore which implements TreeModel
| self.__model = ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING,
| gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,
| gobject.TYPE_INT, gobject.TYPE_ULONG, gobject.TYPE_ULONG)
| self.__model.set_sort_func(self.COL_ICON,
| self.filelist_sort_by_name)
| self.__model.set_sort_func(self.COL_FILENAME,
| self.filelist_sort_by_name)
| self.__model.set_sort_func(self.COL_FILESIZE,
| self.filelist_sort_by_size)
| self.__model.set_sort_func(self.COL_FILETYPE,
| self.filelist_sort_by_type)
| self.__model.set_sort_func(self.COL_FILEMTIME,
| self.filelist_sort_by_mtime)
|
| # create a TreeView widget self.__list = TreeView() # connect the
| model with it self.__list.set_model(self.__model)
| self.__list.set_headers_visible(TRUE)
| self.__list.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
|
| # add columns to TreeView and they maybe connect with fields in
| model column = TreeViewColumn("Name") renderer =
| CellRendererPixbuf() column.pack_start(renderer, expand=FALSE)
| column.add_attribute(renderer, 'pixbuf', self.COL_ICON) renderer =
| CellRendererText() column.pack_start(renderer, expand=TRUE)
| column.add_attribute(renderer, 'text', self.COL_FILENAME)
| column.set_sort_column_id(self.COL_FILENAME)
| column.set_resizable(TRUE) self.__list.append_column(column)
|
| renderer = CellRendererText() renderer.set_property('xalign', 1)
| column = TreeViewColumn("Size", renderer, text=self.COL_FILESIZE)
| column.set_resizable(TRUE)
| column.set_sort_column_id(self.COL_FILESIZE)
| self.__list.append_column(column)
|
| renderer = CellRendererText() column = TreeViewColumn("Type",
| renderer, text=self.COL_FILETYPE) column.set_resizable(TRUE)
| column.set_sort_column_id(self.COL_FILETYPE)
| self.__list.append_column(column)
|
| renderer = CellRendererText() column = TreeViewColumn("Modified",
| renderer, text=self.COL_FILEMTIME)
| column.set_sort_column_id(self.COL_FILEMTIME)
| column.set_resizable(TRUE) self.__list.append_column(column)
|
| # a lot of lines omitted here
|
| * Thomas Moore <[EMAIL PROTECTED]> [2004-03-04 16:05:13
| +0800]:
|
|> Hi:
|>
|> I've found tutorial Chapter 14, "Tree View Widget" is empty. Is
|> there any example to demonstrate how to use this widget?
|>
|>
|>
|> ___ 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/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFARyizzOrqAtg8JS8RAie6AJ4rlq8tUMG+SCXT4i1u4deBTfaZ0gCfesUK
tKseayI4UXrQgNEPBBrHZXo=
=i/rB
-END PGP SIGNATURE-
___
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] FAQ 18.8: What basic pattern should I follow when using a DrawingArea?

2004-03-04 Thread Gustavo J. A. M. Carneiro
A Qui, 2004-03-04 às 09:26, Andrew P. Lentvorski, Jr. escreveu:
> On Tue, 2 Mar 2004, Gustavo J. A. M. Carneiro wrote:
> 
> >   That is a sign of bad design.  This only happens if you do this:
> > def expose_event_cb(widget, event):
> > #  start some drawing
> > while more_work:
> > # do some heavy work to obtain results
> > # draw some more stuff based on results
> > # end drawing and return
> >
> > But this kind of algorithm is completely incorrect in pygtk.
> 
> No heavy work is required, just a boatload of objects.
> 
> The use case is a VLSI polygon editor.  Several million objects have to be
> drawn in multiple layers at top level.  Note that this may be more objects
> than the number of pixels in the DrawingArea!  Those objects absolutely
> must appear on screen to let the user know that drawing is going on, that
> the action is abortable/has aborted, as well as give feedback so that the
> user can make a choice of zoom even before all the objects appear.
> 
> Since PyGtk has no way of providing a guaranteed time callback timer, the
> only way to ensure a user interface which feels responsive is to render to
> both the screen and the backing buffer simultaneously while checking the
> event queue.  Causing a flush on every object slows the entire system down
> by factors of 10-100 (unacceptable as the drawing is already taking
> minutes) as well as increases the tearing artifacts which occur when not
> synchronized with the vertical refresh.

  pygtk does have gobject.timer_add, you know... it is not strictly
guaranteed timer, but close enough.  Your scenario could be implemented
in pygtk with the following structure:

def expose_event(widget, event):
global offscreen_pixmap
# render exposed area of offscreen pixmap to widget.window

def timeout_cb():
widget.queue_draw()
if more_objects_to_draw:
return True
else:
return False

def idle_handler():
global offscreen_pixmap
# draw one object to offscreen_pixmap
if more_objects_to_draw:
return True
else:
widget.queue_draw()
return False

def start_drawing(): # called when you want to redraw the whole thing
# clear offscreen_pixmap
gobject.idle_add(idle_handler)
gobject.timeout_add(50, timeout_cb)

  However, this is not much better than your solution, I admit.  Also,
this is one case when _automatic_ double buffering by gtk is not
desired, since we do our own double buffering.

> 
> > > Most GtkDrawingArea folks with complex drawing needs probably want
> > > set_double_buffered(False).
> >
> >   I disagree.  "Having an application pause a long time with a blank
> > DrawingArea and then suddenly having all the drawing miraculously
> > appear" => that is exactly the purpose of double buffering.  The user
> > should _not_ see the application redrawing.
> 
> This is only correct in the case of UI primitives (buttons, scrollbars,
> ruler, etc.).  UI primitives have lightweight atomic drawing tasks easily
> finished within user perception limits.
> 
> For data displays, this is absolutely *wrong*.  A data display UI that
> pauses or fails to give feedback within .1 seconds violates most accepted
> principles of UI design.  In many cases, continuous update of the
> displayed data is not just okay but is often expected (waterfall FFT
> analysis, polar mapping of radar images, finite element modeling data from
> electromagnetic analysis, etc.).

  Correct.  But, your use case is so extreme that there is no good
solution except getting faster hardware ;)

  An alternative to make it work with slower hardware is simplify the
drawing during user interaction, and then revert to the full precision
drawing when the user stops interacting.  Another option is draw
everything with full precision, but during user interaction only draw
the parts that change.  XOR line drawing is usually very good for this.

> 
> I would, in fact, make the argument that if the double buffering that a
> DrawingArea does is good enough, then you should probably being using a
> Canvas instead.

  Well, a Canvas-like drawing model for all gtk+ widgets has been
discussed in the past and may be on the horizon for gtk+ 3.0 ;-)

  But we are deviating from topic.  I think that putting all this in the
FAQ is a bit overkill.  A FAQ is supposed to have simple question and
simple answers.

  Regards.

-- 
Gustavo João Alves Marques Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic.

___
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] Tree View Widget

2004-03-04 Thread Ling Li
Following is a scratch of code in one of my program, it only uses ListStore.
I hope it will be some help.

class Local():

COL_ICON = 0
COL_FILENAME = 1
COL_FILESIZE = 2
COL_FILETYPE = 3
COL_FILEMTIME = 4
COL_ISDIR = 5
COL_SIZE_IN_BYTES = 6
COL_MTIME = 7

def __init__(self):
# a lot of lines omitted here

# file list
# init a ListStore which implements TreeModel
self.__model = ListStore(gtk.gdk.Pixbuf,
 gobject.TYPE_STRING,
 gobject.TYPE_STRING,
 gobject.TYPE_STRING,
 gobject.TYPE_STRING,
 gobject.TYPE_INT,
 gobject.TYPE_ULONG,
 gobject.TYPE_ULONG)
self.__model.set_sort_func(self.COL_ICON, self.filelist_sort_by_name)
self.__model.set_sort_func(self.COL_FILENAME,
   self.filelist_sort_by_name)
self.__model.set_sort_func(self.COL_FILESIZE,
   self.filelist_sort_by_size)
self.__model.set_sort_func(self.COL_FILETYPE,
   self.filelist_sort_by_type)
self.__model.set_sort_func(self.COL_FILEMTIME,
   self.filelist_sort_by_mtime)

# create a TreeView widget
self.__list = TreeView()
# connect the model with it
self.__list.set_model(self.__model)
self.__list.set_headers_visible(TRUE)
self.__list.get_selection().set_mode(gtk.SELECTION_MULTIPLE)

# add columns to TreeView and they maybe connect with fields in model
column = TreeViewColumn("Name")
renderer = CellRendererPixbuf()
column.pack_start(renderer, expand=FALSE)
column.add_attribute(renderer, 'pixbuf', self.COL_ICON)
renderer = CellRendererText()
column.pack_start(renderer, expand=TRUE)
column.add_attribute(renderer, 'text', self.COL_FILENAME)
column.set_sort_column_id(self.COL_FILENAME)
column.set_resizable(TRUE)
self.__list.append_column(column)

renderer = CellRendererText()
renderer.set_property('xalign', 1)
column = TreeViewColumn("Size", renderer, text=self.COL_FILESIZE)
column.set_resizable(TRUE)
column.set_sort_column_id(self.COL_FILESIZE)
self.__list.append_column(column)

renderer = CellRendererText()
column = TreeViewColumn("Type", renderer, text=self.COL_FILETYPE)
column.set_resizable(TRUE)
column.set_sort_column_id(self.COL_FILETYPE)
self.__list.append_column(column)

renderer = CellRendererText()
column = TreeViewColumn("Modified", renderer, text=self.COL_FILEMTIME)
column.set_sort_column_id(self.COL_FILEMTIME)
column.set_resizable(TRUE)
self.__list.append_column(column)

# a lot of lines omitted here

* Thomas Moore <[EMAIL PROTECTED]> [2004-03-04 16:05:13 +0800]:

> Hi:
> 
> I've found tutorial Chapter 14, "Tree View Widget" is empty.
> Is there any example to demonstrate how to use this widget?
> 
> 
> 
> ___
> 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/


Re: [pygtk] FAQ 18.8: What basic pattern should I follow when using a DrawingArea?

2004-03-04 Thread Andrew P. Lentvorski, Jr.
On Tue, 2 Mar 2004, Gustavo J. A. M. Carneiro wrote:

>   That is a sign of bad design.  This only happens if you do this:
>   def expose_event_cb(widget, event):
>   #  start some drawing
>   while more_work:
>   # do some heavy work to obtain results
>   # draw some more stuff based on results
>   # end drawing and return
>
> But this kind of algorithm is completely incorrect in pygtk.

No heavy work is required, just a boatload of objects.

The use case is a VLSI polygon editor.  Several million objects have to be
drawn in multiple layers at top level.  Note that this may be more objects
than the number of pixels in the DrawingArea!  Those objects absolutely
must appear on screen to let the user know that drawing is going on, that
the action is abortable/has aborted, as well as give feedback so that the
user can make a choice of zoom even before all the objects appear.

Since PyGtk has no way of providing a guaranteed time callback timer, the
only way to ensure a user interface which feels responsive is to render to
both the screen and the backing buffer simultaneously while checking the
event queue.  Causing a flush on every object slows the entire system down
by factors of 10-100 (unacceptable as the drawing is already taking
minutes) as well as increases the tearing artifacts which occur when not
synchronized with the vertical refresh.

> > Most GtkDrawingArea folks with complex drawing needs probably want
> > set_double_buffered(False).
>
>   I disagree.  "Having an application pause a long time with a blank
> DrawingArea and then suddenly having all the drawing miraculously
> appear" => that is exactly the purpose of double buffering.  The user
> should _not_ see the application redrawing.

This is only correct in the case of UI primitives (buttons, scrollbars,
ruler, etc.).  UI primitives have lightweight atomic drawing tasks easily
finished within user perception limits.

For data displays, this is absolutely *wrong*.  A data display UI that
pauses or fails to give feedback within .1 seconds violates most accepted
principles of UI design.  In many cases, continuous update of the
displayed data is not just okay but is often expected (waterfall FFT
analysis, polar mapping of radar images, finite element modeling data from
electromagnetic analysis, etc.).

I would, in fact, make the argument that if the double buffering that a
DrawingArea does is good enough, then you should probably being using a
Canvas instead.

-a
___
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] Tree View Widget

2004-03-04 Thread Thomas Moore
Hi:

I've found tutorial Chapter 14, "Tree View Widget" is empty.
Is there any example to demonstrate how to use this widget?



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