Re: [pygtk] Attempting modal window in win32

2008-07-09 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I have a consistent problem with a threaded pyGTK program that freezes
when dialog boxes are displayed on various Linux platforms. Likewise I
also often get a case where a dialog box displays, but the borders
around it do not display. I've been trying to track this down for
several months, but have had no luck so far...I'm fairly sure it's due
to a threading issue that occurs when the dialog box tries to start
its own gtk_mainloop.

- -dave

Volker Helm wrote:
 It does work!

 you can select or edit something in the parent window! But it isn't
 nice that you can activate the parent window!

 # Start test.py import gtk

 w1 = gtk.Window(gtk.WINDOW_TOPLEVEL) w1.connect('delete_event',
 lambda w, e: gtk.main_quit())

 w2 = gtk.Window(gtk.WINDOW_TOPLEVEL) w2.set_transient_for(w1)
 w2.set_modal(True) w2.set_property('skip-taskbar-hint', True)


 vb = gtk.VBox() w1.add(vb) b = gtk.Button('Open Modal')
 b.connect('clicked', lambda w: w2.show_all()) vb.pack_start(b) l =
 gtk.Entry() l.set_text('Test') vb.pack_start(l)

 w1.show_all()

 gtk.main() # End test.py

 In this test you can't edit the Entry if the child is present.

 Bye,

 Volker

  Original-Nachricht  Datum: Tue, 01 May 2007
 20:28:07 -0400 Von: El Croata [EMAIL PROTECTED] An:
 pygtk@daa.com.au Betreff: [pygtk] Attempting modal window in win32

 Hi,

 I've trying to perform a modal window in win32, but it doesn't
 work. I wrote an app for better explanation of the case:

 # Start test.py
 snip
 # End test.py


 The steps for performing the case were:

 1) Run python test.py 2) Click on button Open Modal 3) Switch
 to any other app, clicking in the win taskbar 4) Switch back to
 the python app, clicking in the taskbar

 Diagnosis: When siwtching back to the python app, it only shows
 the parent window, insted of showing both windows with the child
 over its parent

 Versions: Python 2.4.4, PyGTK 2.8.6, PyCairo 1.0.2

 It seems like I'm missing a little detail... thanks! Of couse, in
 Linux it runs as expected, but I can't change the OS :(

 -- Regards, Cro

 ___ 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/


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGOJGnB8JNm+PA+iURAvuzAJ44lRiyVdMfbcyk0LFl8TKasg7+SwCgmgvF
U3qQ1mfKeZoukITdTUkqfTs=
=atoI
-END PGP SIGNATURE-

___
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] gtksourceview bindings for win32

2008-07-09 Thread Jason Day

Are there any pre-built python bindings for gtksourceview available on
windows? I've got gtksourceview installed but the python bindings are part
of the gnome-python-desktop package, and it hasn't been a pleasant
experience trying to build that. So, has anyone already successfully built
this on windows, or have any tips for me doing so?
___
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] simple treeview and glade problem

2008-07-09 Thread Fabian Braennstroem
Hi,

I am having a simple problem with a glade created treeview. I try to
display some lines from a file:

self.bibtex_list= gtk.ListStore(str)
self.bib_treeview=self.get_widget(treeview1)
categ_liste=[]
print self.bibtex_list
for line in open(/home/fab/.pfm/pfm_bibtex).readlines():
linie=line.strip().split('\n')
categ_liste.append(linie)
self.bibtex_list.append(linie)

self.column_names = ['Name']
self.tvcolumn = [None] * len(self.column_names)
cell = gtk.CellRendererText()
self.tvcolumn[0] = gtk.TreeViewColumn(self.column_names[0],
cell)
cell = gtk.CellRendererText()
self.tvcolumn[0].pack_start(cell, False)

self.bib_treeview.append_column(self.tvcolumn[0])
self.bib_treeview.set_model(self.bibtex_list)

Unfortunately, I do not see anything, except colored lines (just on
a new ubuntu system). I am able to create the whole thing without
glade, but ...
I attached the needed files; maybe someone has an idea!?

I am using glade 2 and pygtk 2.4.1

Greetings!
Fabian


 SimpleGladeApp.py
 Module that provides an object oriented abstraction to pygtk and libglade.
 Copyright (C) 2004 Sandino Flores Moreno


# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

import os
import sys
import re

import tokenize
import gtk
import gtk.glade
import weakref
import inspect

__version__ = 1.0
__author__ = 'Sandino tigrux Flores-Moreno'

def bindtextdomain(app_name, locale_dir=None):

Bind the domain represented by app_name to the locale directory locale_dir.
It has the effect of loading translations, enabling applications for 
different
languages.

app_name:
a domain to look for translations, tipically the name of an application.

locale_dir:
a directory with locales like 
locale_dir/lang_isocode/LC_MESSAGES/app_name.mo
If omitted or None, then the current binding for app_name is used.

try:
import locale
import gettext
locale.setlocale(locale.LC_ALL, )
gtk.glade.bindtextdomain(app_name, locale_dir)
gettext.install(app_name, locale_dir, unicode=1)
except (IOError,locale.Error), e:
print Warning, app_name, e
__builtins__.__dict__[_] = lambda x : x


class SimpleGladeApp:

def __init__(self, path, root=None, domain=None, **kwargs):

Load a glade file specified by glade_filename, using root as
root widget and domain as the domain for translations.

If it receives extra named arguments (argname=value), then they are used
as attributes of the instance.

path:
path to a glade filename.
If glade_filename cannot be found, then it will be searched in the
same directory of the program (sys.argv[0])

root:
the name of the widget that is the root of the user interface,
usually a window or dialog (a top level widget).
If None or ommited, the full user interface is loaded.

domain:
A domain to use for loading translations.
If None or ommited, no translation is loaded.

**kwargs:
a dictionary representing the named extra arguments.
It is useful to set attributes of new instances, for example:
glade_app = SimpleGladeApp(ui.glade, foo=some value, 
bar=another value)
sets two attributes (foo and bar) to glade_app.

if os.path.isfile(path):
self.glade_path = path
else:
glade_dir = os.path.dirname( sys.argv[0] )
self.glade_path = os.path.join(glade_dir, path)
for key, value in kwargs.items():
try:
setattr(self, key, weakref.proxy(value) )
except TypeError:
setattr(self, key, value)
self.glade = None
self.install_custom_handler(self.custom_handler)
self.glade = self.create_glade(self.glade_path, root, domain)
if root:
self.main_widget = self.get_widget(root)
else:
self.main_widget = None
self.normalize_names()
self.add_callbacks(self)
self.new()

def __repr__(self):
class_name = 

Re: [pygtk] Expected Behaviour of gnomevfs.XFER_NEW_UNIQUE_DIRECTORY

2008-07-09 Thread Alexander Larsson
On Mon, 2007-04-23 at 17:51 +0200, Gian Mario Tagliaretti wrote:
 2007/4/23, John Stowers [EMAIL PROTECTED]:
 
 Hi John,
 
  I am trying to copy files using gnomevfs using xfer_uri
 
  I am unable to perform a copy from
 
  foo/file1 to
  foo/bar/file1
 
  without first creating the bar directory. I thought that
  gnomevfs.XFER_NEW_UNIQUE_DIRECTORY created all needed directories for
  the copy - this does not seem to be the case however.
 
  Is this a bug or a lack of my understanding? (see example code below)
 
 since I don't think it's a problem of the python bindings I've cc'd
 gnome-vfs-list, maybe you can get more help.

Seems like a bug in the docs. GNOME_VFS_XFER_NEW_UNIQUE_DIRECTORY is a
toplevel operation that causes gnome_vfs_xfer to create a new uniquely
named directory. It doesn't do any copying after that.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander LarssonRed Hat, Inc 
   [EMAIL PROTECTED][EMAIL PROTECTED] 
He's a benighted pirate rock star who hangs with the wrong crowd. She's a 
brilliant hip-hop stripper from the wrong side of the tracks. They fight 
crime! 

___
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] h2defs.py + GDA problem

2008-07-09 Thread Carlos Savoretti
Hi all!

I'm trying to wrap GDA and I've a problem with h2defs.py.

It could be a simple one but I can't solve it.

-

typedef struct _GdaCommand GdaCommand;

struct _GdaCommand {
gchar *text;
GdaCommandType type;
GdaCommandOptions  options;
}
-

h2defs.py gda-command.h   

It seems to miss something, because although enumerations are processed
the struct itself is plainly ignored, so the boxed type is not 
created after.

If I add manually in the .defs


(define-boxed Command
  (in-module Gda)
  (c-name GdaCommand)
  (gtype-id GDA_TYPE_COMMAND)
  (copy-func gda_command_copy)
  (release-func gda_command_free)
)


then the PyGdaCommand_Type and stuff are generated rightly 
by codegen.

What could be wrong ?

I'm using actually FC6 with pygtk2-codegen-2.10.4-1.fc6

I'm really stuck. 

Thanks all!






___
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] How do I get the previous gtk.TreeIter in a TreeModel?

2008-07-09 Thread Rich Burridge


Hi,

Hopefully I'm missing something obvious.

Given a gtk.TreeIter in a gtk.TreeModel, from:

http://www.pygtk.org/docs/pygtk/class-gtktreemodel.html#method-gtktreemodel--iter-next

I can see how to get the gtk.TreeIter pointing to the next row.
But how to I get a gtk.TreeIter pointing to the previous row?

Just in case I'm taking the wrong approach here, what I want to do is move
one (or more) selected rows, up one row.

I was expecting the code for the callback for the Move up one button
to be something like:

   def textMoveUpOneButtonClicked(self, widget):
   textSelection = self.getTextAttributesView.get_selection()
   [model, paths] = textSelection.get_selected_rows()
   for path in paths:
   iter = model.get_iter(path)
   prevIter = model.iter_prev(iter)
   model.swap(iter, prevIter)

but there is no gtk.TreeMode.iter_prev() function.


___
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] Glade + Gtk question...

2008-07-09 Thread cucap

Hello everyone, I'm new to DaniWeb and a sort of beginner at Python. I've
created a GUI in Python using Glade and GTK and I have two questions. I'm
having trouble with comboboxes. Particularly with entering data into a combo
box from Python. I've tried the following

myCombo = self.wTree.get_widget('comboboxentry')
myCombo.append_text('blah blah blah')


to no avail... apparently you have to first do gtk.combo_box_new_text()
before you can append text. Is this possible when using Glade to construct
my GUI?

My second question is this.. How do I create a ListBox using Glade or GTK. I
would like eventually to be able to grab text from a line via mouse click.
For example, a list of files appear in a text area and the user would be
able to double click on the file and be able to delete it etc... Any help
would be greatly appreciated. Thank you.
-- 
View this message in context: 
http://www.nabble.com/Glade-%2B-Gtk-question...-tf3899408.html#a11054474
Sent from the Gtk+ - Python mailing list archive at Nabble.com.

___
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] TreeView reorderable

2008-07-09 Thread Seltzer

Hi,
 I have a tree view which contains a list of media items to be played, and
some information about them.
I would like to be able to let the user re-order this list, but if i just
use set_reorderable(True) than they can actually
drop one item onto another, and make the dropped item the child of the item
it was dropped onto.  I need to disable this some how, so that you can
reorder the list, but not not drop one item into the other, just re arrange
them.
I am also restricted by pygtk version 2.4

thanks for the help,
felix.
___
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] Runtime Updation of GUI

2008-07-09 Thread satyadev yalavarthy

I am doing a project on Network speed meter,
I am running a thread for capturing packets from device of single system,
I had created GUI with pygtk , when i captured a packet this is not updating
to the GUI at run time ...
when i am closing application my thread is completing its work..

when my gui is running .. backend data is not updating on to the gui..
Is there any way to do that in pygtk that backend data is dynamically given
to the GUI..

Waiting for replies..
Thankyou
___
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] Re: unknown freeze bug

2008-07-09 Thread Dave Aitel
For what it's worth, I have similar, very strange race-condition-like
behavior with pop-up dialogs that results in application freezing as
well. I can't quite track down what the problem is either. :

-dave


Seltzer wrote:
 Update: its only the treeviews that are becoming non responsive,
 along with the menu items.  Everything elses refresh rate just
 slows down, and becomes jumpy, but still works.

 I understand this is rather vague, and probably hard to diagnose
 from afar. But what tools would you use to debug a problem like
 this?  Whats out there? Where would you look?

 thanks again, felix.

 On 6/18/07, *Seltzer* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 hi all, iv been getting a weird bug lately from a threaded pygtk
 program, and im not sure where to start. The gui has a pop up
 window that the user can open. This pop up than needs to inactivate
 the main window, stopping user interaction, until the user closes
 the pup up. I also have real time updating of the background
 window, and of the pop up, from the network. The application is
 fine, although it will freeze after the pop up has been around for
 a bit. you can still interact with elements if you know where they
 are, but they don't refresh or something.

 whats the proper way of implementing this behavior? I've tried
 setting the modal value, can i still update the background windows?


 thanks for your help, felix.



 --


 ___ 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 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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Tim Janik

On Fri, 22 Jun 2007, Murray Cumming wrote:


On Fri, 2007-06-22 at 10:27 +0200, Tim Janik wrote:



b) GtkTooltips is going to be deprecated in 2.12 anyways, so there
is little use in continuing to use it anyway.
c) note that the actual compilation changes could easily be ironed out
by Gtk+ by doing s/_tips_data_list/tips_data_list/ but was introduced
deliberately, to catch remaining tips_data_list uses in third-party
code which should be removed now, since tips_data_list became a
mere alias for NULL for future Gtk+ versions.


When was GtkTooltips::tips_data_list deprecated, if it was every public
API?


reppeating what i wrote above, GtkTooltips will be deprecated in 2.12
in favour of GtkTooltip.


Murray Cumming


---
ciaoTJ
___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Tim Janik

On Thu, 21 Jun 2007, Elijah Newren wrote:


Just realized that pygtk and gtk-devel-list subscribers may not be on
d-d-l.  So I'm forwarding this.  See
http://mail.gnome.org/archives/desktop-devel-list/2007-June/msg00109.html
for the thread and discussion.  Please jump in.

-- Forwarded message --
From: Elijah Newren [EMAIL PROTECTED]
Date: Jun 21, 2007 8:05 PM
Subject: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME
2.19.4 released yet?)
To: Gnome Desktop Development List [EMAIL PROTECTED]


Hi,

As noted in bug http://bugzilla.gnome.org/show_bug.cgi?id=449318,
there was a recent gtk+ API change.  jdahlin just barely told me that
the changed API has existed since 1998, long before gtk+-2.11.x (and
pointed me to http://bugzilla.gnome.org/show_bug.cgi?id=447214).  This
API change breaks pygtk and means that much of GNOME cannot be
compiled.  But it doesn't seem clear who should fix this.  Should gtk+
revert it or somehow fix the API break, or is this an API break we
want and expect pygtk to adapt to?


so far, my take on the issue is that PyGtk should adapt to that
change by not using tooltips-tips_data_list, because:
a) i haven't seen a single argument yet about why giving up using
   tips_data_list would be bad for PyGtk or any other application
   for that matter;
b) GtkTooltips is going to be deprecated in 2.12 anyways, so there
   is little use in continuing to use it anyway.
c) note that the actual compilation changes could easily be ironed out
   by Gtk+ by doing s/_tips_data_list/tips_data_list/ but was introduced
   deliberately, to catch remaining tips_data_list uses in third-party
   code which should be removed now, since tips_data_list became a
   mere alias for NULL for future Gtk+ versions.


Elijah


---
ciaoTJ
___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Tim Janik

On Fri, 22 Jun 2007, Murray Cumming wrote:


On Fri, 2007-06-22 at 10:46 +0200, Tim Janik wrote:

On Fri, 22 Jun 2007, Murray Cumming wrote:


On Fri, 2007-06-22 at 10:27 +0200, Tim Janik wrote:



b) GtkTooltips is going to be deprecated in 2.12 anyways, so there
is little use in continuing to use it anyway.
c) note that the actual compilation changes could easily be ironed out
by Gtk+ by doing s/_tips_data_list/tips_data_list/ but was introduced
deliberately, to catch remaining tips_data_list uses in third-party
code which should be removed now, since tips_data_list became a
mere alias for NULL for future Gtk+ versions.


When was GtkTooltips::tips_data_list deprecated, if it was every public
API?


reppeating what i wrote above, GtkTooltips will be deprecated in 2.12
in favour of GtkTooltip.


So, this is deprecation with a break. Breaking normally follows
deprecation after a delay. Deprecation with a break is just a break.


every change is a break in some sense. the question is whether the
change actually affect applications badly or not (not what name is given
to it). so far, no case has been made for tips_data_list=NULL badly
affecting applications or LBs, i'm still waiting.


Murray Cumming


---
ciaoTJ
___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Tim Janik

On Fri, 22 Jun 2007, Murray Cumming wrote:


On Fri, 2007-06-22 at 11:03 +0200, Tim Janik wrote:

On Fri, 22 Jun 2007, Murray Cumming wrote:


On Fri, 2007-06-22 at 10:46 +0200, Tim Janik wrote:

On Fri, 22 Jun 2007, Murray Cumming wrote:


On Fri, 2007-06-22 at 10:27 +0200, Tim Janik wrote:



b) GtkTooltips is going to be deprecated in 2.12 anyways, so there
is little use in continuing to use it anyway.
c) note that the actual compilation changes could easily be ironed out
by Gtk+ by doing s/_tips_data_list/tips_data_list/ but was introduced
deliberately, to catch remaining tips_data_list uses in third-party
code which should be removed now, since tips_data_list became a
mere alias for NULL for future Gtk+ versions.


When was GtkTooltips::tips_data_list deprecated, if it was every public
API?


reppeating what i wrote above, GtkTooltips will be deprecated in 2.12
in favour of GtkTooltip.


So, this is deprecation with a break. Breaking normally follows
deprecation after a delay. Deprecation with a break is just a break.


every change is a break in some sense. the question is whether the
change actually affect applications badly or not (not what name is given
to it). so far, no case has been made for tips_data_list=NULL badly
affecting applications or LBs, i'm still waiting.


I was talking about the renaming of the struct field, which breaks
builds. If the rename is going to be reverted, and the change of
behavior has no bad effect then that's fine.


the structure field renaming is there to catch current third-party uses.
that way we can gather feedback on field usage and figure if there are
cases where the behavior change has bad effects.

as for reverting the structure field rename, i don't think that
is really necessary for 2.12. Gtk+ 2.x stable branches are supposed
to be ABI and API compatible, however not neccessarily source
compatible. when 2.12 deprecates GtkTooltips, the field is not
anymore part of the API, ABI is maintained by its NULL assignment,
and the source incompatibility is covered by README.in (as all
source/API changes have to be).


Murray Cumming


---
ciaoTJ
___
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] positional and keyword parameters

2008-07-09 Thread Jan Michael C. Alonzo
varun_shrivastava [EMAIL PROTECTED] writes:

 hi

 whats the difference between positional and keyword parameter

Hello! You can find more info at 
http://docs.python.org/tut/node6.html#SECTION00670

HTH.

Regards,

Jan
-- 

Take heed: you do not find what you do not seek.
-- English Proverb
___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Tommi Komulainen

On 6/22/07, Tim Janik [EMAIL PROTECTED] wrote:

c) note that the actual compilation changes could easily be ironed out
by Gtk+ by doing s/_tips_data_list/tips_data_list/ but was introduced
deliberately, to catch remaining tips_data_list uses in third-party
code which should be removed now, since tips_data_list became a
mere alias for NULL for future Gtk+ versions.


The real killer I suppose is the change in semantics. Otherwise you
would've used tips_data_list vs. _tips_data_list depending on
GTK_DISABLE_DEPRECATED ?


--
Tommi Komulainen [EMAIL PROTECTED]
___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Matthias Clasen

On 6/22/07, Sven Neumann [EMAIL PROTECTED] wrote:

Hi,

On Fri, 2007-06-22 at 10:27 +0200, Tim Janik wrote:

 so far, my take on the issue is that PyGtk should adapt to that
 change by not using tooltips-tips_data_list

I have attached a patch to
http://bugzilla.gnome.org/show_bug.cgi?id=449318 that removes access to
private GtkTooltips struct members from the pygtk bindings. I can't tell
if this will break any PyGTK apps but I guess that these bindings have
only been added for the sake of completeness.



Thats fine. Can we still please revert the field name change to make existing
pygtk versions compile against 2.11.x ?
___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Sven Neumann
Hi,

On Fri, 2007-06-22 at 10:27 +0200, Tim Janik wrote:

 so far, my take on the issue is that PyGtk should adapt to that
 change by not using tooltips-tips_data_list

I have attached a patch to
http://bugzilla.gnome.org/show_bug.cgi?id=449318 that removes access to
private GtkTooltips struct members from the pygtk bindings. I can't tell
if this will break any PyGTK apps but I guess that these bindings have
only been added for the sake of completeness.


Sven


___
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] Re: Fwd: gtk+ API change; who should fix it? (A.k.a. Why isn't GNOME 2.19.4 released yet?)

2008-07-09 Thread Tim Janik

On Fri, 22 Jun 2007, Tommi Komulainen wrote:


On 6/22/07, Tim Janik [EMAIL PROTECTED] wrote:

c) note that the actual compilation changes could easily be ironed out
by Gtk+ by doing s/_tips_data_list/tips_data_list/ but was introduced
deliberately, to catch remaining tips_data_list uses in third-party
code which should be removed now, since tips_data_list became a
mere alias for NULL for future Gtk+ versions.


The real killer I suppose is the change in semantics. Otherwise you
would've used tips_data_list vs. _tips_data_list depending on
GTK_DISABLE_DEPRECATED ?


yeah, additionally, *all* of GtkTooltips is going to be DEPRECTAED in
2.12, so we don't have the option deprecate uses of this one field
only.


--
Tommi Komulainen [EMAIL PROTECTED]


---
ciaoTJ
___
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] Use of C++ private keyword in API.

2008-07-09 Thread Murray Cumming
The use of the C++ private keyword is causing a build failure in Glom
with the latest pyobject:

  /* private */
  /* using union to preserve ABI compatibility (structure size
   * must not change) */
union {
GSList *closures; /* stale field; no longer updated DO-NOT-USE!
*/
PyGObjectFlags flags;
} private;

Could this be renamed, please.

-- 
Murray Cumming
[EMAIL PROTECTED]
www.murrayc.com
www.openismus.com

___
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] problem with gtk.Notebook embeded in gtk.EventBox

2008-07-09 Thread Jacek Rembisz
Hello,

The problem is that I cannot switch the pages clicking the mouse button.
I have noticed this problem on MS Windows but it also appears on Linux system.
See attached code sample.

Please tell me, is this a pygtk problem or is it necessary to
set_visible_window(True)
in this case.

Best regards,
Jacek Rembisz
import gtk

def does_not_work_on_mswin():
	topwidget = gtk.Window()
	topwidget.set_size_request(200, 150)
	
	place = gtk.EventBox()
	place.set_visible_window(False)
	topwidget.add(place)
	
	n = gtk.Notebook()
	n.append_page(gtk.Button())
	n.append_page(gtk.Button())
	place.add(n)

	topwidget.show_all()

	gtk.main()

def does_not_work_on_linux_too():
	topwidget = gtk.Window()
	topwidget.set_size_request(200, 150)
	
	n1 = gtk.Notebook()
	topwidget.add(n1)

	place = gtk.EventBox()
	place.set_visible_window(False)
	n1.append_page(place)
	n1.append_page(gtk.Button())
	
	n = gtk.Notebook()
	n.append_page(gtk.Button())
	n.append_page(gtk.Button())
	place.add(n)

	topwidget.show_all()

	gtk.main()

	
does_not_work_on_linux_too()
___
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] repositioning svg image on a cairo surface

2008-07-09 Thread Srini
Hi Guys,

I have an application in which I have loaded a SVG(Scalable Vector
Graphics) image on a Cairo surface using rsvg and cairo libraries. Now
hte problem is I am not able to reposition this image to a desired
place on the application screen. The image is sitting at the top left
corner of the screen, at (0,0) co-ordinates.

Guys, please help me out in getting this problem solved out.

Appreciate your help.
Thanks in advance

Srini

___
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] Graphing support in pygtk?

2008-07-09 Thread Dan Stromberg

Hi folks.

Is there any sort of support for graphing in pygtk?

Especially, is there support for graphing incrementally, as information 
arrives - not all at once?

Or would I need to use some sort of canvas and come up with my own graph?

Thanks!

___
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] 2.19.x progress?

2008-07-09 Thread Priit Laes
Hello,

Are there any plans to make a 2.19.x releases soon?

There are some users who would prefer using tarballs to do testing.

Cheers,
Priit
___
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] Re: UI to edit accelerators

2008-07-09 Thread Cousin Stanley


 I would like to add support for customizing the keyboard accelerators
 for an pygtk application that uses UI manager and ActionGroup.
 

Fredrik 

  You might take a look at the  KeyBindings  module
  in the  xpn_src  dir of the Python/GTK based XPN  
  news client for a bit of inspiration 

http://xpn.altervista.org/index-en.html

  I've used XPN as a news client for the past few years
  and it now includes a very nice GUI dialog for letting
  users customize their key bindings  


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona


___
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] problem installing PyGTK on a clean WinXP system

2008-07-09 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I had someone attempting to install Python 2.5.1 on Windows Vista
recently as well and failing. For some reason the .msi is not
compatible with Vista.

It would be great to have a community supported installer for all of
the PyGTK requirements for Windows. I'm happy to host it if we get one!

- -dave


John Ehresman wrote:
 John Pye wrote:
 That was a good thought; I missed that. The installer executable
 itself is broken. Which confirms that this is an issue with
 distutils.

 Yes, it does look like the pyobject installer .exe is relying on
 msvcr71.dll being available -- which is a bad assumption because it
  is not an operating system provided .dll.  I suggest that the next
  step is to report or fix the bug in that installer (or not use it
 and just install the files directly).

 Cheers,

 John ___ 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/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGzarXB8JNm+PA+iURAnN3AJ9JQpqNveVa/QkWUXa/xJFTYej79ACeNELB
yY76D7GIcF7T+w4QVlUMm/o=
=zr5F
-END PGP SIGNATURE-

___
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] Re: Python 3.0 plans

2008-07-09 Thread Behdad Esfahbod
On Wed, 2007-08-29 at 13:52 -0400, Behdad Esfahbod wrote:
 
   - Do things more Pythonesque.  Looking at Pango bindings, for
 example
 replace all to_string() methods with __str__.  Same for compare(),
 equal(), etc.  Or should it be in addition? 

Other example I once really wanted was generator iterators on
PangoLayoutIter such as lines(), clusters(), ... so I can do:

i = layout.get_iter()
for line in i.lines():
print line

But then the iterator object becomes redundant, so maybe add lines() on
the layout itself:

for line in layout.lines():
print line


-- 
behdad
http://behdad.org/

Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin, 1759



___
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] Re: adjust height of textview

2008-07-09 Thread JustFillBug
On 2007-09-13, Vincent Schut [EMAIL PROTECTED] wrote:
 Hi all,

 anyone knows how to change the (default) height of a textview? It seems
 to default to something like 5 or 6 lines, and I can't seem to get it
 shrink. I'd like it to have a height of 3 or 4 lines max, but have no
 idea how to accomplish that... (I've searched the net to no avail).


You have to put it in a scrolledwindow and set a wrap mode.

___
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] Using glade in large applications

2008-07-09 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

We use Glade exclusively for CANVAS (which I consider fairly large at
this point). It's working well, even for very complex projects.

That said, there ARE some pretty annoying bugs - especially related to
image paths which it will break for no reason. You'll end up cleaning
it up by hand after using it sometimes. And the programming model is
fantastic. We have multiple Glades for multiple devices. For the N800
(small handheld device) you can expose your UI as three big buttons
and for real Linux machines you can expose it in all its complex crazy
glory. It's great. I think we use Gazpacho for the N800 .glade
creation now, but that's because the Maemo guys do I think.

So have no fear. :

- -dave

steve george wrote:


 Saw the following text at http://www.exit1.org/Gtk2-Ex-FormFactory/


 RAD tools like Glade are fine for small applications but not if
 you want to have a consistent look and feel in bigger and modular
 applications

 Got me wondering, .. how do you all feel about using Glade for
 large scale applications?

 Any other recommendations for 'frameworks or other' that help large
  scale python application development?

 (Just started reading kiwi documentation, so already looking at
 that)

 Steve ___ 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/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG7oFkB8JNm+PA+iURAuloAJ0bPjAT2beGFGswITR8p/ZQjl5TfgCfULyJ
jB+yI0YVgCUqKkZa2sEAiUI=
=KiqB
-END PGP SIGNATURE-

___
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] help

2008-07-09 Thread k0rfain Mathurin
checking for PYGOBJECT... configure: error: Package requirements (
pygobject-2.0 = 2.11.1) were not met:

Requested 'pygobject-2.0 = 2.11.1' but version of PyGObject is 2.8.6

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables PYGOBJECT_CFLAGS
and PYGOBJECT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.



thats what I get when i try to do ./configure
it works and all but at the end it says that, I look in the package manager
for pygobject but no luck.
on debian etch.
___
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] pygobject-2-4 branch

2008-07-09 Thread [EMAIL PROTECTED]
Hi!
I'm trying to compile a python application that requires pygobject.
However compiling pygobject does not work with my glib2-2.6.3-4 (comes 
from opensuse 9.3)
The configure script claims I can use pygobject-2-4 branch. But I 
really couldn't find it anywhere. Could you someone point it to me 
please?
I can't update to a newer distro because I have a lot of things 
recompiled from sources, so it would require too much work to create 
again the same environment, and I fear that updating glib2 to 2.8 could 
broke something..
(please CC me as i'm not subrscribed to the list).

Thanks
Andrea




_
Rendi Sicuro il tuo Pc con Norton Antivirus!
Fino al 15 ottobre hai 2 mesi gratis.
http://vas.tiscali.it/internet_security//

___
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] Re: Python 3.0 plans

2008-07-09 Thread Behdad Esfahbod
On Wed, 2007-08-29 at 12:37 -0300, Johan Dahlin wrote:
 Greetings

Heya,

 I'd like to ask for input on how the Python 3.0 transition is going to 
 affect GNOME.
 
 Python 3.0 is the current development focus of the Python community.
 It is different from the old 2.x series in the sense that it will not be 
 backwards compatible with the old python releases. A program written for 
 Python 2.x will not run under Python 3.x unless it restricts itself to a 
 tiny tiny subset which is really not practical (for instance, unicode can't 
 be used).

So this is a great opportunity to break APIs and go GNOME 3.0...

Ok, lame jokes aside.

 The first alpha release of Python 3.0 is going to be released in the next 
 couple of weeks, this is a good opportunity to discuss this before the
 transition actually starts. 3.0 is scheduled for release in August 2008.
 
 All the python bindings needs to be ported over to the new C Python API.
 We'd like to take this opportunity to clean up a bit of the cruft we 
 collected during the years of strict backwards compatibility.
 For instance it's not possible to significantly optimize the loading
 of the gtk+ bindings without breaking the API, both OLPC and Nokia has been 
 running into this problem.
 
 What I'd like to  propose is a to branch of pygobject and pygtk to a 
 python-3 branch where backwards compatibly can be broken.
 Transition will be done by a tool similar to 2to3.py[1] used by Python which
 will help automate the process of converting a program using the old api to
 the new.

Couple thoughts:

  - Do things more Pythonesque.  Looking at Pango bindings, for example
replace all to_string() methods with __str__.  Same for compare(),
equal(), etc.  Or should it be in addition?

  - Finish and use gobject-introspection.

behdad


 When this branch is mature enough I'll propose it for inclusion in the GNOME 
   bindings release, which will be an addition, not a replacement for the old 
 bindings.
 
 The current version of the python bindings will be maintained as long as 
 there is interest in the Python 2.x platform. But maintenance will 
 eventually cease as the general focus moves over to Python 3.x.
 
 Parallel installability is not a direct issue for us, since it's already 
 solved at the python level. The current bindings will not compile under
 3.x and the new ones will not compile under 2.x.
 
 Thoughts?
 
 Johan
 
 [1]: http://svn.python.org/view/sandbox/trunk/2to3/
 
 ___
 desktop-devel-list mailing list
 [EMAIL PROTECTED]
 http://mail.gnome.org/mailman/listinfo/desktop-devel-list
-- 
behdad
http://behdad.org/

Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin, 1759



___
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] GtkSourceView in PyGTK on Windows

2008-07-09 Thread maddog39
Hello all,

I am trying to port my pygtk application to Windows but I'm a bit stuck
since I haven't been able to find GtkSourceView for Python on windows. I've
searched all around and haven't found anything. So I'm just curious if its
possible to get GtkSourceView working in python under windows.

Thanks!
-- 
Alec Hussey
___
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] AttributeError: 'module' object has no attribute 'CAPI'

2008-07-09 Thread Simon Burton

Python 2.5.1 (r251:54863, Jun 21 2007, 12:28:02)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type help, copyright, credits or license for more information.
Make it so.
 import gtk
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py, line 
48, in module
from gtk import _gtk
AttributeError: 'module' object has no attribute 'CAPI'



Any ideas ?
___
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] Pipes and freezes

2008-07-09 Thread Kristin Hillenbrand
Just wondering if this is an email address for Steven Howe who is
originally from Sidcup, Kent, UK and may be living in Australia?

 

Thanks

 

Kristin Hillenbrand (Storey)

 

Kristin Hillenbrand

Acting Senior Manager, Social Policy

Strategic Policy and Supports

Workforce Supports Division

Employment, Immigration and Industry

12th Floor, Capital Health Centre

10030 - 107th Street

Edmonton, AB  T5J 3E4

 

Phone (780) 422-6332

Cell (780) 718-5643

Fax (780) 422-6324

[EMAIL PROTECTED]

 

 


This communication is intended for the use of the recipient to which it is 
addressed, and may contain confidential, personal, and or privileged 
information. Please contact us immediately if you are not the intended 
recipient of this communication, and do not copy, distribute, or take action 
relying on it. Any communication received in error, or subsequent reply, should 
be deleted or destroyed.
___
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] widget containers for free placement

2008-07-09 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

For what it's worth we do a similar sort of thing for these:
http://www.immunityinc.com/downloads/NodeView.png (You can click on
the nodes and they pop up a menu)
http://www.immunityinc.com/documentation/mappingbeta.html (flash movie
of a map with little icons)

Just as some ideas as to what's possible. I'm not sure how we do this
stuff under the covers, but it's all pure pyGTK.

- -dave


Greg Ewing wrote:
 If I understand correctly, firstly you're trying to create a kind
 of graphical GUI-building environment, but using your own unique
 kinds of widgets rather than the standard ones.

 It's hard to say what would be the best way to go about it. Basing
 each of your pseudo-widgets on an actual gtk widget would buy you
 some things -- a parent-child hierarchy, nested coordinate systems
 and clipping, and handling input events. But you may end up
 fighting against gtk in various ways, in order to handle things
 like dragging widgets from one container to another, which really
 needs to be managed by something outside the widget that was
 clicked on.

 Also, if you're going to want transparency or nonrectangular shaped
 widgets, you may find a real gtk widget to be too restrictive. And
 if you try to have thousands of widgets, I wouldn't be surprised if
 things get bogged down. A gtk widget is a fairly heavyweight thing,
 involving a Python object, a gtk object, and some state in the X
 server that all need to be coordinated.

 Donn wrote:
 Can one have living visual objects without making them
 widgets?

 At some level, yes, of course -- you can draw whatever you want and
 handle input events however you want.

 The question is whether the freedom you get from doing it all
 yourself is worth the extra effort it would take. I've never tried
 to do anything like this with gtk, so I'm not really sure how all
 the tradeoffs would work out.

 Either way, it sounds like a fairly major project, and one that
 will be bending gtk in ways it wasn't really designed to go. It
 might be better to get some experience using gtk in the normal way
 before diving into this.

 You might also want to look at PythonCard, which I haven't seen,
 but from what I've heard it may be doing something along similar
 lines. It's based on wxPython rather than gtk, but there might be
 some ideas in it that you could use.

 I realize it's counter to where GUI's go at the moment

 I don't want to discourage you -- a Flash-like environment sounds
 like it would be a cool thing to have -- but as a GUI for a mundane
 application, it's probably not a good idea to depart too far from
 the platform standards. If it's too weird and wonderful, it will
 tend to repel users rather than attract them!

 -- Greg ___ 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/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHJemMB8JNm+PA+iURAmQcAJ9LazV9+/gt4G57MzQwbw3Sr+AgLwCgwPim
KdrL9TMzaO6iQdhye9c4gAw=
=8QjG
-END PGP SIGNATURE-

___
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 window with switchable views, howto?

2008-07-09 Thread Basil Shubin

Hi friends,

First, excuse me for my english :)

Second, I am shiny new in GTK programming and I have several questions 
to ask:


Here a task, I need a GTK window with a switchable views/panels, for 
example there is default view/panel with a widgets and so on, then if 
user has selected a menu item, then default view/panel should be 
replaced/switched by other view/panel with their own widgets.


Right now I am using Glade3 to layout frame with widget, but I don't 
clearly understanding how I can create a custom panel and then how to 
insert it inside main window. I need several predefined views to switch 
between...


Main problem is: how to accomplish this task by using Glade3 and PyGTK

Thanks for any suggestions.

___
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] PyGtk Mac OS top level windows does not show up on top

2008-07-09 Thread Vlad
Dear group,

  Could someone help me with the problem I am having with  PyGtk on
Mac OS X.   Every time I start an application its window is always
burried beneath other windows on the screen, rather then poping up on
the top like all normal application's windows do.   Am I doing
something wrong?   Here is an example of such application:

#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gtk

class App:

def __init__(self):

self.win = gtk.Window(gtk.WINDOW_TOPLEVEL)
button = gtk.Button(Hello)
button.set_size_request(200,300)
button.show ()

self.win.add(button)

self.win.connect ( destroy , gtk.main_quit )
self.win.connect ( delete_event, self.delete_event )

self.win.show()

def delete_event(self, widget, event, data = None ):
return False


app = App ()
gtk.main ()

 Vlad

___
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] Installing pygtk on Solaris

2008-07-09 Thread Shalom Kramer
I am trying to install PyGTK on Solaris 8. When I run:
$ ./configure
I get -
checking for GLIB - version = 2.2.0... no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log for
the
*** exact error that occurred . This usually means GLIB is incorrectly
installed

But when I run
$ pkginfo -l SMCglib
I get --

VERSION:   2.6.2


What am I missing here?
___
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] Re: [cairo] pycairo - translate question

2008-07-09 Thread Carl Worth
On Mon, 5 Nov 2007 17:38:19 +0200, Donn wrote:
 Hi, not sure if this is the appropriate list.

Yes, definitely the right list. Welcome, Donn!

 Can one, within a single cairo context, do this:

 while True:
   ctx.translate(0,0)
   pycairo commands to draw a square at 0,0
   ctx.translate(10,10)
   pycairo commands to draw a circle at 0,0
   ctx.translate(50,50)
   pycairo commands to draw a Black Night at 11,44

Absolutely!

 The idea is to keep all the drawing commands relative to 0,0 and use
 translate (and scale etc later) to actually move the results around the
 canvas.

That's a good model to use, and cairo supports it quite well.

 At the moment my tests are all over the place. Is there a way to reset the
 overall transform between each  section?

What you're looking for is save/restore, like so:

ctx.save()
ctx.translate()
scale.scale()
draw_something()
ctx.restore()

Often I will code all of my draw_something functions to also call
save() at the beginning and restore() at the end, which helps them to
act idempotently, (things like change to the source pattern won't
accidentally leak out, for example).

I hope that helps. And have fun with cairo!

-Carl


pgpmQpfQmjKn6.pgp
Description: PGP signature
___
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] Re: [cairo] pycairo - translate question

2008-07-09 Thread Carl Worth
On Mon, 5 Nov 2007 19:57:58 +0200, Donn wrote:
 Thanks. Having fun so far!

That warms my heart.

 Is there a way to set the drawing origin of a set of pycairo drawing
 commands such that it starts at 0,0 but in the center of the page? (Or
 should that be context, I am still fuzzy about that.)

Center of the surface is what I would have said, (a context is an
extra piece of state that allows one to direct drawing operations to a
particular surface).

 I guess this will be a width/2, height/2 extra transform, but I'm not sure.

Yes, after ctx.translate(width/2, height/2) a user-space coordinate of
(0,0) will map to a device-space position at the center of the target
surface.

Do note that in general cairo doesn't allow you to query for surface
dimensions, (though it does for an image surface), so you'll generally
need to hang on to the width and height yourself.

-Carl





pgpDOmTPjfxwd.pgp
Description: PGP signature
___
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] To put gnome-terminal in a pygtk application

2008-07-09 Thread wolf wolf
import vte
(the python vte wrapper is installed from RH5 by default. On RH4 I
took the debian package, done a dep-to-rpm conversion and installed
it)

term = vte.Terminal()
term.fork_command(command)

I found some help in the Ruby manual for vte and of course in google
code search.

On Nov 18, 2007 5:30 AM, Osmo Salomaa [EMAIL PROTECTED] wrote:
 la, 2007-11-17 kello 11:20 +0100, François Ingelrest kirjoitti:
  You should take a look at the VTE widget, which is used by gnome-terminal:
 
  http://library.gnome.org/devel/vte/
 
  On Nov 17, 2007 11:15 AM, airton arantes [EMAIL PROTECTED] wrote:
   I already searched in the google but nothing were found.
  
   I wonder in how to do to put a gnome-terminal in my pygtk
   applications, what I have that to search?

 If you specifically want the terminal to look and behave exactly like
 gnome-terminal, take a look at gedit's terminal plugin, which sets the
 vte properties to match those defined for gnome-terminal in gconf.

 http://svn.gnome.org/viewvc/gedit-plugins/trunk/plugins/terminal/

 --
 Osmo Salomaa [EMAIL PROTECTED]

 ___
 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 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] Installing PyGTK on solaris 8

2008-07-09 Thread Roberto Cavada

Shalom Kramer wrote:

*** The test program failed to compile or link. See the file config.log 
for the
*** exact error that occurred . This usually means GLIB is incorrectly 
installe


Have you followed the suggestion?
r.

___
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] [Fwd: PyGTK in Vista?]

2008-07-09 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Likewise, everything you need should be in
http://www.immunityinc.com/downloads/PyGTK.tar.gz

I've gotten it working on Vista using this. There are bugs in the Vista
version of GTK (highlighted pop-up menu's disappear, for example). But
it is usable.

- -dave


Yann Leboulanger wrote:
 Rafael Villar Burke a écrit :

 

 Sujet:
 PyGTK in Vista?
 Expéditeur:
 Nicklas Larsson [EMAIL PROTECTED]
 Date:
 Sat, 1 Dec 2007 07:44:48 +0100
 Destinataire:
 [EMAIL PROTECTED]

 Destinataire:
 [EMAIL PROTECTED]


 Hi,

 I have tried to install PyGTK in Microsoft Windows Vista but failed. I
 have installed GTK+ runtime, and that wen well, but I got dialogs
 during installation of PyCairo, PyGObject, and PyGTK telling me that
 some things could not be created. At the end however, they tell me
 that it is installed. From python, I get DLL load failed when I do
 import gtk.

 I am in no way a Windows Vista expert, I just thought it would be nice
 to be able to also run my graphical python applications both on Linux
 and on Windows.

 The package of PyGTK I found was from November 2006.

 I found no information on your site about Microsoft Windows Vista.

 Regards,
 Nicklas Larsson

 
 you installed pycairo, pygobject and pygtk from there?
 
 http://pygtk.org/downloads.html
 
 pygtk version there is from 30 August 2007
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHVFl0tehAhL0gheoRAlSZAJ9SI73/1b9fZY10gAy55l8/PcHm3wCfZey/
51Ew7DjuuaNaGcnYlNC+6V4=
=XhOU
-END PGP SIGNATURE-
___
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] accelerator for an image button.

2008-07-09 Thread Neil Dugan

Gian Mario Tagliaretti wrote:

2007/11/3, Neil Dugan [EMAIL PROTECTED]:

Hi Neil,



I am trying to make an python/gtk+ app.  One problem I am having is
attaching an accelerator to a image button.

This is the code I am using to create the buttons.

--- cut ---
   def index_control(self):
   hbox = gtk.HBox()
   for stock in
[gtk.STOCK_GOTO_FIRST,gtk.STOCK_GO_BACK,gtk.STOCK_GO_FORWARD,gtk.STOCK_GOTO_LAST]
 :
   image = gtk.Image()
   image.set_from_stock(stock,gtk.ICON_SIZE_MENU)
   button = gtk.Button()
   button.set_image(image)
   hbox.pack_start(button,False,False)
   return hbox
--- cut ---
I can give the full source if needed.



I don't see any code with accelerators here, btw here we go with a
small example:

import gtk

w = gtk.Window()
w.connect(destroy, gtk.main_quit)
w.set_default_size(200, 300)

b = gtk.Button(None, gtk.STOCK_QUIT)
b.connect(clicked, gtk.main_quit)

ag = gtk.AccelGroup()
w.add_accel_group(ag)

b.add_accelerator(clicked, ag, ord('q'), gtk.gdk.SHIFT_MASK,
gtk.ACCEL_VISIBLE)

w.add(b)
w.show_all()
gtk.main()

cheers


Thanks for that.  I didn't know about the add_accelerator() function. 
 I found the gtk.accelerator_parse() function, once I found out what 
to parse (e.g. ALTLeft) it didn't take me long to get everything 
working.


Regards Neil.
___
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] Re: [Glade-users] Translation, gtk labels, and gettext

2008-07-09 Thread Tristan Van Berkom
On Dec 7, 2007 4:06 AM, Caleb Marcus [EMAIL PROTECTED] wrote:

  I'm now having issues with glade and gettext. I can run xgettext directly
 on the glade file, but that just produces a file with ALL the strings, not
 just the translatable ones. I can run intltool-extract on the glade file to
 produce a .h file, but running xgettext on the result doesn't produce any
 output unless I use the -a argument, which just extracts all the strings,
 which I don't want. What should I do?


I was under the impression that there is an intltool rule for this
(similar to INTLTOOL_XML_NOMERGE_RULE) that you can
add to your project's makefile to create myproject.glade from
myproject.glade.in .

although I just noticed that glade 2 used to dump translatable strings
into a file for this purpose; IMO this should be the domain of intltool
to extract translations from glade files (or gtkbuilder files).

I would recommend that you verify that such a rule doesnt exist
yet and file an rfe under intltool for that.

Cheers,
 -Tristan
___
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] spam?

2008-07-09 Thread Yann Leboulanger
Am I the only one to be spammed by quoll.daa.com.au with mails from
pygtk ML from 2007 ?

-- 
Yann
___
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.Notebook

2008-07-09 Thread [EMAIL PROTECTED]

In gtk notebook page_num(child) being a widget
Returns :   the index of the page containing child, or -1

So here is the problem:

Added button to tab for close so I need the page the button is on since the
button grabs focus rather than the tab. I tried emit back to parent and that 
failed to produce anything.

The code segements:

Creation:
   #--
   def new_page(self, arg, filename):
  self.z = self.z + 1
  # create  scroller, gtksourceview, buffer and set mime
  scroller = gtk.ScrolledWindow()
  scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
  bufferS = gtksourceview.SourceBuffer()
  manager = gtksourceview.SourceLanguagesManager()
  if arg:
 type = gnomevfs.get_mime_type(arg)
 language = manager.get_language_from_mime_type(type)
  else:
 language = manager.get_language_from_mime_type('text')
  bufferS.set_language(language)
  view = gtksourceview.SourceView(bufferS)
  scroller.add(view)
  # set defaults for gtksourceview and buffer
  bufferS.set_highlight(self.HIGHLIGHT)
  bufferS.set_check_brackets(self.CHECK_BRACKETS)
  view.set_show_line_numbers(self.SHOW_LINE_NUMBERS)
  view.set_show_margin(self.SHOW_MARGIN)
  view.set_auto_indent(self.AUTO_INDENT)
  view.set_tabs_width(int(self.TABS_WIDTH))
  view.set_insert_spaces_instead_of_tabs(self.INSERT_SPACES_INSTEAD_OF_TABS)
  view.set_margin(int(self.MARGIN))
  # add close button
  image = gtk.Image()
  image.set_from_file(data/images/close.png)
  btn = gtk.Button()
  btn.add(image)
  btn.connect('clicked',self.on_close_btn)
  #btn.set_size_request(16,16)
  # add label
  hbox = gtk.HBox(False,3)
  if not arg:
 self.key[self.z] = gtk.Label(filename)
  else:
 self.key[self.z] = gtk.Label(filename.rsplit('/',1)[1])
  hbox.add(self.key[self.z])
  hbox.add(btn)
  hbox.show_all()
  # load and set text
  if arg:
 try:
bufferS.begin_not_undoable_action()
f = open(arg, 'r')
bufferS.set_text(f.read())
f.close()
bufferS.end_not_undoable_action()  
 except:
print 'File Error: '+arg
  else:
 bufferS.set_text('')
  # populate tree
  iter = None
  iter = self.mod.append(iter)
  if arg:
 self.mod.set(iter,0, arg)
  else:
 self.mod.set(iter,0, filename)
  self.mod.set(iter,1, self.key[self.z].get_text())
  self.mod.set(iter,2, view)
  self.mod.set(iter,3, bufferS)
  self.mod.set(iter,4, self.key[self.z])
  self.view = view
  self.bufferS = bufferS
  # add page
  page = self.mdi_book.append_page(scroller,hbox)
  self.mdi_book.show_all()
  # switch to page
  self.mdi_book.set_current_page(page)
 
 Callbacks:
#--
   def on_close_btn(self, widget):
  p = self.mdi_book.page_num(widget)
  self.on_update_tree('delete')
  self.mdi_book.remove_page(p)   
   #--
   def on_close(self, widget):
  p = self.mdi_book.get_current_page()
  self.on_update_tree('delete')
  self.mdi_book.remove_page(p)   

 




___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


___
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] Re: help fixing max/minimum size of a widgets

2008-07-09 Thread JustFillBug
On 2008-01-07, Steven Howe [EMAIL PROTECTED] wrote:

 My situation:
 I have a gtk.HBox with three widgets, a gtk.Progressbar, a 
 gtk.HSeperator and a gtk.Statusbar in the gtk.HBox. I would like the 
 gtk.Progressbar and gtk.Statusbar to have minimum fixed widths and fixed 
 heights, similar to what one expects from a Menu. I've tried 
 gtk.Widget.set_size_request, which set the minimum size width and 
 height very nicely. Now how do I fix the height i.e. maximum = minimum ?


You don't set the size of the widget. When you add the widget to the
hbox, you set the set expand=False:

hbox.pack_start(progressbar, expand=False)


___
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] Bug w/ MenuItem on Vista?

2008-07-09 Thread Dave Aitel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

That's not just you - we get that all the time with our popup menus in
CANVAS. Perhaps there's a white on white highlighted text
colorization by default ? It's on our list of things to look into but
hopefully someone else has already fixed it...

- -dave


Maximilian Wilson wrote:
 Hi,

 I've been having some trouble with MenuItem. When I create a simple
  PyGTK application with a MenuBar and one MenuItem, there's a
 graphical glitch: clicking on Item produces a white square.
 Screen shot attached; source code follows.

 I'm running PyGTK 2.12.3-1 on Vista. I'd like to know if anyone
 else has, or hasn't, seen this problem on different OSes and/or
 versions so I can narrow down what's wrong with my system. Any help
  would be appreciated.

 -Max

 import pygtk pygtk.require('2.0') import gtk

 win = gtk.Window() menu = gtk.MenuBar()
 menu.append(gtk.MenuItem(Item)) menu.show_all() win.add(menu)
 win.show_all() win.connect('delete-event', gtk.main_quit)
 gtk.main()


 --




 --



 ___ 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/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHi4RXB8JNm+PA+iURAi35AKDOSD8m9B8TmJzisAuBce0pJkvgpwCeOkqi
29QGRpRy63jsdYePNAUubq4=
=urRs
-END PGP SIGNATURE-

___
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] Using an RC file to set the background colout of Gtk.Button

2008-07-09 Thread Martin A Conaghan
I am trying to use an RC file to set the background colour of a button. I am 
able to change the colour of the font usinf the RC file, but not the background 
colour or font. I am able to change the background of the window. The RC file 
is;

style window

{

font = -Adobe-Times-Bold-I-Normal--14-100-100-100-P-77-ISO8859-1

# Yellow background

bg[NORMAL] = {1.0, 1.0, 0}

}


style button

{

font = -Adobe-Times-Bold-I-Normal--14-100-100-100-P-77-ISO8859-1


# Change font colour, WORKS

fg[PRELIGHT] = { 0, 0, 1.0 }

fg[ACTIVE] = { 0, 1.0, 0 }

fg[NORMAL] = { 1.0, 0, 0 }

fg[INSENSITIVE] = { 1.0, 1.0, 0 }

#Try to change background colour, DOES NOT WORK

bg[PRELIGHT] = { 0, 0, 1.0 }

bg[ACTIVE] = { 0, 1.0, 0 } 

bg[INSENSITIVE] = { 1.0, 1.0, 0 }

bg[NORMAL] = { 0, 1.0, 1.0 }





base[PRELIGHT] = { 0, 0, 1.0 }

base[ACTIVE] = { 0, 0, 1.0 }

base[NORMAL] ={ 0, 0, 1.0 }

base[INSENSITIVE] = { 0, 0, 1.0 }


}


widget_class GtkWindow style window

widget_class *GtkButton* style button



I am able to set the colour of the button by editing the style in this method;

def setWidgetColour(widget, colour_string):

 Takes a widget and sets the colour. 

r, g, b = colourToRGB16Bit(colour_string)

color = widget.get_colormap().alloc_color(r, g, b)


s = widget.get_style().copy()

for i in range(5):

s.fg[i] = color

s.bg[i] = color

s.base[i] = color

widget.set_style(s) 

The problem is that when I use this method I lose the rounded corners which I 
want to keep. Plus I'd rather use the RC files for ease of modification.

Having searched around for similar problems some people say that you need to 
set the colour of the label, but then some people say that the label is 
invisible. Others say you need to add the Button to a gtk.EventBox, so I'm a 
little confused

I am using the most recent version of PyGTK (as of yesterday) with Python2.5. 

Any help would be greatly appreciated- Thanks
___
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] Pygtk problems with DrawingArea redraw

2008-07-09 Thread Antonio Caruso
Hi,

I cannot understand why the program below, is not able to update the
draw when I push the button.

I.e. when the button is pushed the code in Plot::calc is executed.
At the end of this code I must emit a expose-event but the call
to self.queue_draw_area is not working at all..

help, please.

Thanks,
 A. Caruso
from numpy import *
import pysmm_graphlib as gl
import numpy.random
import framework
from math import pi

n = 50
x = numpy.random.random(n)
y = numpy.random.random(n)
(ll, hh, dist) = gl.PYSMMGL_Emst(x,y)
triangles = gl.PYSMMGL_Delaunay(x,y)


class Plot(framework.Screen):
def calc(self):
x = numpy.random.random(n)
y = numpy.random.random(n)
(ll, hh, dist) = gl.PYSMMGL_Emst(x,y)
triangles = gl.PYSMMGL_Delaunay(x,y)
(w,h) = self.window.get_size()
self.queue_draw_area(0,0,w,h)

def draw(self, cr, width, height):
		# draw the background
		cr.set_source_rgb(1,1,1)
		cr.rectangle(0,0,width,height)
		cr.fill()

		# draw points
		cr.set_source_rgb(0,0,0)
		for i in xrange(len(x)):
			cr.arc(x[i]*width,y[i]*height,2,0,2*pi)
			cr.fill()

		# draw the triangulation
		cr.set_source_rgb(0,0,0.5)
		cr.set_line_width(0.3)
		for t in triangles:
			cr.move_to(x[t[0]] *width,y[t[0]]*height)
			cr.line_to(x[t[1]] *width,y[t[1]]*height)
			cr.line_to(x[t[2]] *width,y[t[2]]*height)
			cr.line_to(x[t[0]] *width,y[t[0]]*height)
			cr.stroke()
		cr.set_source_rgb(1,0,0)
		cr.set_line_width(2)
		for i in xrange(len(ll)):
			cr.move_to(x[ll[i]]*width, y[ll[i]]*height)
			cr.line_to(x[hh[i]]*width, y[hh[i]]*height)
			cr.stroke()

framework.run(Plot)
		
#! /usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk, gobject, cairo

# Create a GTK+ widget on which we will draw using Cairo
class Screen(gtk.DrawingArea):
# Draw in response to an expose-event
__gsignals__ = { expose-event: override }

# Handle the expose-event by drawing
def do_expose_event(self, event):
	
# Create the cairo context
cr = self.window.cairo_create()

# Restrict Cairo to the exposed area; avoid extra work
cr.rectangle(event.area.x, event.area.y,
event.area.width, event.area.height)
cr.clip()
self.draw(cr, *self.window.get_size())

def calc(self):
print Redefine this method in the Derived class

def draw(self, cr, width, height):
# Fill the background with gray
cr.set_source_rgb(0.5, 0.5, 0.5)
cr.rectangle(0, 0, width, height)
cr.fill()

# GTK mumbo-jumbo to show the widget in a window and quit when it's closed
def run(Widget):
window = gtk.Window()
window.connect(delete-event, gtk.main_quit)
vbox = gtk.VBox(False,2)
widget = Widget()
widget.set_size_request(500,500)
vbox.pack_start(widget,False,False,0)
widget.show()
button = gtk.Button(Recalc)
vbox.pack_start(button,False,False,0)
button.connect(clicked, (lambda s,w: w.calc()), widget)
button.show()
vbox.show()
window.add(vbox)
window.present()
gtk.main()

if __name__ == __main__:
run(Screen)

___
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] TreeView - Making whole row colored

2008-07-09 Thread Neil Dugan

Stephen George wrote:

Hi,

I am trying to get a treeview (with liststore model) to display rows in 
different colors based on content in the list.


 From what I've read in GTK+ 2.0 Tree View Tutorial - Tim-Philipp Muller 
( c code based)


The most suitable approach for most cases is that you add two columns 
to your model, one for
the property itself (e.g. a column COL_ROW_COLOR of type G_TYPE_STRING), 
and one for the boolean flag of
the property (e.g. a column COL_ROW_COLOR_SET of type G_TYPE_BOOLEAN). 
You would then connect these
columns with the foreground and foreground-set properties of each 
renderer. Now, whenever you set
a row’s COL_ROW_COLOR field to a colour, and set that row’s 
COL_ROW_COLOR_SET field to TRUE, then
this column will be rendered in the colour of your choice. If you only 
want either the default text colour or one
special other colour, you could even achieve the same thing with just 
one extra model column: in this case you
could just set all renderer’s foreground property to whatever special 
color you want, and only connect the
COL_ROW_COLOR_SET column to all renderer’s foreground-set property 
using attributes.


Which I've implemented as attached.

The setting of foreground seems to be working (half list blue, half red)
However my implementation seems to be ignoring the foreground-set flag.

I am expecting to ONLY see my 'special' foreground color when the 
modified flag is also set to true, and grey/black writing when the 
foreground-set flag is False.


I can get grey writing by setting the foreground to None, but I don't 
belive this was the intent of the above description.


Am I mis-understanding how this functionality should work, .. or made 
some errors in my code?


Thanks for any suggestions.
Steve



Hi Steve,

I can't see the pattern in why the colors are how they are.  I think 
some of the trouble has to be with some 'foreground-color' set as None.


It would probably be better to not use the 'Modified' column to affect 
the color, and just put the color you want the row in the 
'foreground-color' column (i.e. red,black or blue) and change the 
set-up to.


column.add_attribute(mycell, 'foreground', COLUMN_FOREGROUND)
mycell.set_property('foreground-set', True)




If you must stay with this set-up, this function seems to do what you want

def _cell_data_func(self, column, cell, model, iter):
		(modified,foreground) = 
model.get(iter,COLUMN_MODIFIED,COLUMN_FOREGROUND)

if foreground == None : foreground = 'black'
if modified :
cell.set_property('foreground',foreground)
else :
cell.set_property('foreground','black')
cell.set_property('foreground-set',True)
return False

And use column.set_cell_data_func(mycell, self._cell_data_func) to 
set it up.


Regards Neil.


77a78,84
 def _cell_data_func(self, column, cell, model, iter):
   #print totalcelldatamethod()
   (modified,foreground) = 
 model.get(iter,COLUMN_MODIFIED,COLUMN_FOREGROUND)
   cell.set_property('foreground',foreground)
   cell.set_property('foreground-set',modified)
   return False
 
92,93c99,101
 column.add_attribute(mycell, 'foreground', COLUMN_FOREGROUND)
 column.add_attribute(mycell, 'foreground-set', COLUMN_MODIFIED)
---
 #column.add_attribute(mycell, 'foreground', COLUMN_FOREGROUND)
 #column.add_attribute(mycell, 'foreground-set', COLUMN_MODIFIED)
 column.set_cell_data_func(mycell, self._cell_data_func)
___
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] Re: TreeView - Making whole row colored

2008-07-09 Thread Jacek Wolszczak

Stephen George pisze:

Hi,

I am trying to get a treeview (with liststore model) to display rows in 
different colors based on content in the list.



cut

Hi

Just try changing the order of foreground and foreground-set and it'll work.

column.add_attribute(mycell, 'foreground-set', COLUMN_MODIFIED)
column.add_attribute(mycell, 'foreground', COLUMN_FOREGROUND)

It seems that order of adding attributes does matter and first 
foreground-set should be checked if it's True before foreground colour 
is changed.


___
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] Clickable image not clickable in transparent areas?

2008-07-09 Thread Christian Siegert

Hi,

I want to display a clickable image which is not clickable in transparent areas.

The way I failed:
The image is child of an event box. The event box receives the 
button_press_event. If I click in a transparent area of the image the event box 
still receives an event. How can I change this behaviour? Apparently, I can 
only mask windows, not widgets.

Are there other ways to do what I want? Is there a way at all?

Thank you in advance
Christian
___
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] Hello world etc.

2008-07-09 Thread Peter Stahlir
Hi!

I have two suggestions for your documentation:

1. Hello world

I had to go through

http://www.pygtk.org/
http://www.pygtk.org/tutorial.html
http://www.pygtk.org/pygtk2tutorial/index.html
http://www.pygtk.org/pygtk2tutorial/ch-GettingStarted.html#sec-HelloWorld

to find it. Could you link it from the main page?

2. Hello world again

My hello world reads:

import gtk;
button = gtk.Button( 'Hello world!' )
button.connect( clicked, gtk.main_quit )
button.show()
window = gtk.Window()
window.add( button )
window.show()
gtk.main()

This is 8 lines compared to 82 from your example.
I think a helloworld is there for getting a quick idea how things work.
I _really_ hate them if it takes more than 5 seconds to get it.
(By the way, glade is the reason I coded my last program with Qt (*cough*) )

3. API reference

I am not able to find definitions of gtk.main or gtk.main_quit in the reference.

Thanks,

ps
___
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] PolicyKit from Python

2008-07-09 Thread David Zeuthen

On Wed, 2008-02-06 at 13:32 +0100, Murray Cumming wrote:
 On Tue, 2008-02-05 at 15:58 +0100, Murray Cumming wrote:
  Does anyone know if there are already PolicyKit (and
  policykit-gnome) python bindings?
 
 I discovered that I can probably do this with just the D-Bus API. I made
 the attached test case after some googling, but the call to PolicyKit's
 ObtainAuthorization() doesn't seem to have any effect. I'd welcome any
 advice.
 
 I'm on Ubuntu Hardy Heron, where PolicyKit is definitely working, as
 seen when I try to use the Services control panel, for instance, which
 has an Unlock button.
 
 I believe that I need to call ShowDialog() if ObtainAuthorization()
 denies authorization, but I want to understand this first part.

The names of interfaces and objects changed a bit since 0.6 to 0.7 to
make it desktop agnostic (so in some future if the user is running
non-GNOME he will get a native authentication agent etc.); this is what
you should use

http://hal.freedesktop.org/docs/PolicyKit/model-authentication-agent.html
http://hal.freedesktop.org/docs/PolicyKit-gnome/ref-auth-daemon.html

There is no ShowDialog() any more. Does that clear it up?

  David


___
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] PolicyKit from Python

2008-07-09 Thread David Zeuthen

On Thu, 2008-02-07 at 16:19 +0100, Murray Cumming wrote:
 On Thu, 2008-02-07 at 22:55 +0800, David Zeuthen wrote:
  On Wed, 2008-02-06 at 13:32 +0100, Murray Cumming wrote:
   On Tue, 2008-02-05 at 15:58 +0100, Murray Cumming wrote:
Does anyone know if there are already PolicyKit (and
policykit-gnome) python bindings?
   
   I discovered that I can probably do this with just the D-Bus API. I made
   the attached test case after some googling, but the call to PolicyKit's
   ObtainAuthorization() doesn't seem to have any effect. I'd welcome any
   advice.
   
   I'm on Ubuntu Hardy Heron, where PolicyKit is definitely working, as
   seen when I try to use the Services control panel, for instance, which
   has an Unlock button.
   
   I believe that I need to call ShowDialog() if ObtainAuthorization()
   denies authorization, but I want to understand this first part.
  
  The names of interfaces and objects changed a bit since 0.6 to 0.7 to
  make it desktop agnostic (so in some future if the user is running
  non-GNOME he will get a native authentication agent etc.); this is what
  you should use
  
  http://hal.freedesktop.org/docs/PolicyKit/model-authentication-agent.html
  http://hal.freedesktop.org/docs/PolicyKit-gnome/ref-auth-daemon.html
  
  There is no ShowDialog() any more. Does that clear it up?
 
 Thanks. I figured out a bit more since I sent the email, but I'm still
 having no luck. I blogged about it:
 http://www.murrayc.com/blog/permalink/2008/02/07/gnome-lirc-properties-using-policykit-to-get-sudo-access/

OK, unfortunately I won't have time to look at this until I'm back from
vacation late next week. But it's worth checking if just dbus-send works

 $ dbus-send --session --print-reply \
 --dest=org.freedesktop.PolicyKit.AuthenticationAgent / \
 org.freedesktop.PolicyKit.AuthenticationAgent.ObtainAuthorization \
 string:the_action_id \
 uint32:0 \
 uint32:$PPID

where the_action_id is something like

 org.freedesktop.hal.storage.crypto-setup-fixed

or whatever comes out of polkit-action. If that works it's probably just
a dbus-python issue...

You asked for a website in your blog entry. What's wrong with

http://hal.freedesktop.org/docs/PolicyKit/
http://hal.freedesktop.org/docs/PolicyKit-gnome/

On a more serious note, yeah, I should move the docs to e.g.
policykit.freedesktop.org or something like that.

   David



___
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] PolicyKit from Python

2008-07-09 Thread David Zeuthen

(Dunno if you got my other reply, I think Evolution ate it)

On Thu, 2008-02-07 at 16:19 +0100, Murray Cumming wrote:
 Thanks. I figured out a bit more since I sent the email, but I'm still
 having no luck. I blogged about it:
 http://www.murrayc.com/blog/permalink/2008/02/07/gnome-lirc-properties-using-policykit-to-get-sudo-access/

Does this work

 $ dbus-send --session --print-reply \
 --dest=org.freedesktop.PolicyKit.AuthenticationAgent / \
 org.freedesktop.PolicyKit.AuthenticationAgent.ObtainAuthorization \
 string:org.freedesktop.hal.storage.crypto-setup-fixed \
 uint32:0 \
 uint32:$PPID

replacing org.freedesktop.hal.storage.crypto-setup-fixed of course with
what you need. If so it should work from python too. Assuming of course
the application is running unprivileged.

  David


___
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] Need help in Gtk Textview widget's background image

2008-07-09 Thread Dharmosoth Seetharam
Hi All,

I got struck at setting the background image
to the textview widget.


Can you pleae help me in the regard.

Thanks in advance

regads,
Seetharam



  5, 50, 500, 5000 - Store N number of mails in your inbox. Go to 
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html

___
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] spam?

2008-07-09 Thread Johan Dahlin
On Wed, Jul 9, 2008 at 8:43 AM, Yann Leboulanger [EMAIL PROTECTED] wrote:
 Am I the only one to be spammed by quoll.daa.com.au with mails from
 pygtk ML from 2007 ?


No, it's the whole list.
It's because I just finished cleaned up the pending moderation
requests for the list.
It had been badly neglected for some time, that's why you see messages from
2007 showing up.

listadmin is still processing so we'll see a few more mails over the
next couple of hours.
mailman is apparently rather slow when it has to process 3600
moderation requests :-)

Johan
___
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] spam?

2008-07-09 Thread Walter Leibbrandt
No, you are certainly not. I currently have about 60 PyGtk ML messages 
from April 2007 through January 2008. And I've only been a member for 
about a month! Weird...


Yann Leboulanger wrote:

Am I the only one to be spammed by quoll.daa.com.au with mails from
pygtk ML from 2007 ?

  
begin:vcard
fn:Walter Leibbrandt
n:Leibbrandt;Walter
org:Translate.org.za
adr:;;;Pretoria;Gauteng;;South Africa
email;internet:[EMAIL PROTECTED]
title:Developer
tel;work:(012) 460 1095
x-mozilla-html:FALSE
url:http://translate.org.za
version:2.1
end:vcard

___
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] Problem with simple custom widget

2008-07-09 Thread Johan Dahlin

Jeffrey Barish wrote:

As an exercise in preparation for bigger things, I am trying to create a
custom widget that is a gtk.Entry with an added label.  I borrowed
liberally from examples, but I am not aware of any examples that do quite
what I am trying to do.  I can make this widget work by subclassing gtk.Bin
and adding the entry as a child, but what I really want is to have
a self-contained widget.  I think that I am close, but I have two
problems (that I know about) that have me completely stumped.  The first is
that I can't get the label to appear, although there appears to be space
for it.  The second is that the entry does not resize when I resize the
window.  Any suggestions would be greatly appreciated.  I'm hoping that
creating custom widgets gets easier after the first one.


I am not sure if it's actually possible to do what you want to do.
But, you could try to set the parent of the widget to the same parent the 
entry has. It may or might not help you.

The parent is responsible for propagating the drawing requests to all children.

Johan
___
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] Python/Gnome new application skeleton

2008-07-09 Thread Ruben Fonseca

Hi.

I'm trying to create a new application with python/gtk for gnome. 
However, I always go blind when I look to autotools and friends.


Since I'm planning the application to be portable between the Linux and 
UNIX flavours, I thought that I should include autotools.


Is there any other alternative? What do you recommend to start a new 
python/gnome application?


TIA
Ruben

___
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] User Interface Designer

2008-07-09 Thread Amar
Hi all

Is there a user interface designer that produces pygtk source.

Thnaks
Amar___
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] New Gtk+ 2.12 functions

2008-07-09 Thread Vreixo Formoso Lopes
Hi!

I'm a java-gnome developer. Since some days we're
working on updating our .defs data with new gtk+ 2.12
functions. I have noticed that your .defs data (pygtk
2.12.1 release) misses many of this new functions. We
have added some of them, and we're working to add all
new gtk 2.12 stuff. Given our .defs data is based on
yours, you may find interesting the attached patch,
that adds several of the new functions. I hope to send
you a new one next days.

Cheers,
Vreixo Formoso

PS: I'm not subscribe to the list, please CC me any
question you have.



  Abra sua conta no Yahoo! Mail, o único sem limite de espaço para 
armazenamento!
http://br.mail.yahoo.com/
___
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] Missing autoconf macros in pygobject

2008-07-09 Thread Rafał Mużyło
I'd like to know what package pygobject expects to be installed in order
to be autotoolized, cause at least AM_CHECK_PYTHON_HEADERS and
AM_CHECK_PYMOD aren't provided in acinclude.m4 or otherwise.
___
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] re: pygobject duplicate symbol _g_bit_nth_lsf OS X 10.5

2008-07-09 Thread Peter Bartoli


Was a solution ever found for this one?

-peter
Hello, i tried to build pygobject but got an duplicate symbol error  
message.
I tried the svn and pygobject 2.14 and also in fink, always the same  
error.
thanks, frank My Build output: make all-recursive Making all in docs  
make all-am make[3]: Nothing to be done for `all-am'. Making all in  
gobject
if /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. - 
I.. - I/sw/include/python2.5 -I/sw/include/python2.5 -D_REENTRANT -I/ 
sw/ include/glib-2.0 -I/sw/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN - 
I/ sw/include -D_REENTRANT -I/sw/include/glib-2.0 -I/sw/lib/ 
glib-2.0/ include -I/sw/include -Wall -fno-strict-aliasing -std=c9x - 
MT _gobject_la-gobjectmodule.lo -MD -MP -MF .deps/_gobject_la-  
gobjectmodule.Tpo -c -o _gobject_la-gobjectmodule.lo `test - 
f'gobjectmodule.c' || echo './'`gobjectmodule.c; \ then mv -f .deps/ 
_gobject_la-gobjectmodule.Tpo .deps/_gobject_la-  
gobjectmodule.Plo; else rm -f .deps/_gobject_la- 
gobjectmodule.Tpo; exit 1; fi

mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/include/python2.5 -I/sw/  
include/python2.5 -D_REENTRANT -I/sw/include/glib-2.0 -I/sw/lib/  
glib-2.0/include -DPY_SSIZE_T_CLEAN -I/sw/include -D_REENTRANT -I/ 
sw/ include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include -Wall - 
fno- strict-aliasing -std=c9x -MT _gobject_la-gobjectmodule.lo -MD - 
MP - MF .deps/_gobject_la-gobjectmodule.Tpo -c gobjectmodule.c -fno- 
common -DPIC -o .libs/_gobject_la-gobjectmodule.o if /bin/sh ../ 
libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. - I/sw/ 
include/python2.5 -I/sw/include/python2.5 -D_REENTRANT -I/sw/  
include/glib-2.0 -I/sw/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN -I/  
sw/include -D_REENTRANT -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/  
include -I/sw/include -Wall -fno-strict-aliasing -std=c9x -MT  
_gobject_la-pygboxed.lo -MD -MP -MF .deps/_gobject_la-pygboxed.Tpo  
- c -o _gobject_la-pygboxed.lo `test -f 'pygboxed.c' || echo  
'./'`pygboxed.c; \ then mv -f .deps/_gobject_la-pygboxed.Tpo  
.deps/_gobject_la- pygboxed.Plo; else rm -f .deps/_gobject_la- 
pygboxed.Tpo; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/ 
include/python2.5 -I/sw/include/python2.5 -D_REENTRANT -I/sw/include/ 
glib-2.0 -I/sw/lib/ glib-2.0/include -DPY_SSIZE_T_CLEAN -I/sw/ 
include -D_REENTRANT -I/sw/ include/glib-2.0 -I/sw/lib/glib-2.0/ 
include -I/sw/include -Wall -fno- strict-aliasing -std=c9x -MT  
_gobject_la-pygboxed.lo -MD -MP -MF .deps/_gobject_la-pygboxed.Tpo - 
c pygboxed.c -fno-common -DPIC -o .libs/ _gobject_la-pygboxed.o if / 
bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -  
I/sw/include/python2.5 -I/sw/include/python2.5 -D_REENTRANT -I/sw/  
include/glib-2.0 -I/sw/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN -I/  
sw/include -D_REENTRANT -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/  
include -I/sw/include -Wall -fno-strict-aliasing -std=c9x -MT  
_gobject_la-pygenum.lo -MD -MP -MF .deps/_gobject_la-pygenum.Tpo - 
c - o _gobject_la-pygenum.lo `test -f 'pygenum.c' || echo  
'./'`pygenum.c; \ then mv -f .deps/_gobject_la-pygenum.Tpo .deps/ 
_gobject_la- pygenum.Plo; else rm -f .deps/_gobject_la- 
pygenum.Tpo; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/ 
include/python2.5 -I/sw/ include/python2.5 -D_REENTRANT -I/sw/ 
include/glib-2.0 -I/sw/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN -I/sw/ 
include -D_REENTRANT -I/sw/ include/glib-2.0 -I/sw/lib/glib-2.0/ 
include -I/sw/include -Wall -fno- strict-aliasing -std=c9x -MT  
_gobject_la-pygenum.lo -MD -MP -MF .deps/ _gobject_la-pygenum.Tpo -c  
pygenum.c -fno-common -DPIC -o .libs/_gobject_la-pygenum.o if /bin/ 
sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/ 
include/python2.5 -I/sw/include/python2.5 -D_REENTRANT -I/sw/  
include/glib-2.0 -I/sw/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN -I/  
sw/include -D_REENTRANT -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/  
include -I/sw/include -Wall -fno-strict-aliasing -std=c9x -MT  
_gobject_la-pygflags.lo -MD -MP -MF .deps/_gobject_la-pygflags.Tpo  
- c -o _gobject_la-pygflags.lo `test -f 'pygflags.c' || echo  
'./'`pygflags.c; \ then mv -f .deps/_gobject_la-pygflags.Tpo  
.deps/_gobject_la- pygflags.Plo; else rm -f .deps/_gobject_la- 
pygflags.Tpo; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/ 
include/python2.5 -I/sw/ include/python2.5 -D_REENTRANT -I/sw/ 
include/glib-2.0 -I/sw/lib/ glib-2.0/include -DPY_SSIZE_T_CLEAN -I/ 
sw/include -D_REENTRANT -I/sw/ include/glib-2.0 -I/sw/lib/glib-2.0/ 
include -I/sw/include -Wall -fno- strict-aliasing -std=c9x -MT  
_gobject_la-pygflags.lo -MD -MP -MF .deps/ _gobject_la-pygflags.Tpo - 
c pygflags.c -fno-common -DPIC -o .libs/ _gobject_la-pygflags.o if / 
bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -  
I/sw/include/python2.5 -I/sw/include/python2.5 -D_REENTRANT -I/sw/ 
include/glib-2.0 -I/sw/lib/glib-2.0/include -DPY_SSIZE_T_CLEAN -I/  
sw/include -D_REENTRANT -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/  

[pygtk] invisible character

2008-07-09 Thread Yo

Hi all,

how I can hide the values in a TreeViewColumn, replacing
each character with an asterisk '*', like a 'entry.set_visibility' function?

Thanks in advance

___
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] Binding for gnome.ui / GnomeThumbnail

2008-07-09 Thread nico
Hello,
I develop an application running under pygtk, and I need to handle some
thumbnails.


I try to use the GnomeThumbnail from liggnomeui, and so use the handling
of thumbnail from Gnome

Is there a python binding for that ? If yes where I can find
doc/examples to do a such thing ? Or I have to mange my own thumbnail
generation ?

Thanks in advance

Nico.



___
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] [Fwd: PyGTK in Vista?]

2008-07-09 Thread Steffi

Hi Nicklas,

did you find a  acceptable solution? I have the same problem with PyGTK and
Windows Vista.

Regards,

Stefanie


Rafael Villar Burke-2 wrote:
 
 
 
 Hi,
 
 I have tried to install PyGTK in Microsoft Windows Vista but failed. I
 have installed GTK+ runtime, and that wen well, but I got dialogs
 during installation of PyCairo, PyGObject, and PyGTK telling me that
 some things could not be created. At the end however, they tell me
 that it is installed. From python, I get DLL load failed when I do
 import gtk.
 
 I am in no way a Windows Vista expert, I just thought it would be nice
 to be able to also run my graphical python applications both on Linux
 and on Windows.
 
 The package of PyGTK I found was from November 2006.
 
 I found no information on your site about Microsoft Windows Vista.
 
 Regards,
 Nicklas Larsson
 
 
 ___
 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/
 
 

-- 
View this message in context: 
http://www.nabble.com/-Fwd%3A-PyGTK-in-Vista---tp14129871p16627540.html
Sent from the Gtk+ - Python mailing list archive at Nabble.com.

___
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] Pygtk does not play nicely with speech-dispatcher

2008-07-09 Thread Dave Aitel

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Threading and pyGTK can be very complex - do your callbacks get called 
right out of your main thread (where I assume pyGTK's loop is running?)


It might be worth you posting a bit to the list. There are lots of 
programs that both do network processing and use PyGTK quite a bit, so 
it is possible. A simple fix to the threads will probably be in order. :


FWIW, I would use this:

o Main thread running pyGTK with a gui_queue, that handles GUI events 
and also clears the gui_queue when it is idle. One of the gui_queue 
commands would be trigger speech dispatcher callback which would then 
use a speech dispatcher queue to tell that thread what to do.
o speech dispatcher thread which then clears it's own queue and does 
callbacks based on that. You don't want the GUI thread doing speech, of 
course.


- -dave


- -dave

James Simmons wrote:
| I have been working on a Pygtk pgrogram for the OLPC project which is 
a reading program for Project Gutenberg Etexts.  Several people on the 
OLPC mailing list suggested enhancing it to work with speech-dispatcher 
so that the program could read the texts aloud, at the same time 
highlighting the word as it is spoken.  They felt it would be useful to 
students trying to improve their reading skills, etc.  What I have found 
is that getting the program to read aloud is easy, getting a Pygtk 
program to highlight words one a a time is easy, but getting the two to 
work together might be impossible.

|
| Speech-dispatcher runs in its own thread.  It has callbacks that I 
have configured to execute a Python method every time a word ends.  
Using this it *should* be trivial to highlight the word as it is 
spoken.  Trouble is, when the Pygtk event loop is allowed to run at the 
same time as speech-dispatcher, none of the callbacks are ever invoked.  
If I do a wait loop after invoking speech-dispatcher, then all of the 
callbacks work but the screen does not get updated to show the words 
being highlighted.  Only the final word on the page gets highlighted.  
Hynek Hanke of the speech-dispatcher project has noticed that 
socket.recv() does not work in speech-dispatcher if it is allowed to run 
at the same time as the event loop.

|
| I can supply code to demonstrate this problem.  I am hoping that one 
of you can suggest a good workaround.

|
| Thanks,
|
| James Simmons
|
|
|
| Hynek Hanke wrote:
|
|
| Hello James,
|
| it is an interesting problem. I think pygtk needs to be fixed if it
| seems to behave so badly with other libraries using threads.
| This has little to do with speech callbacks specifically. More
| important is the thing that when you run basic system functions
| like socket.recv() from other threads, they behave badly.
| Would you like to raise this issue with the PyGTK developers
| to see if it is possible to fix it or to use PyGTK in some other
| way that avoids the conflict?
|
| As a workaround, you can try to avoid the pygtk loop and do
| your own asynchronous thread to highlight the words. Threads
| are easy in Python. However, unless we find out where in
| PyGTK the problem lies exactly, it is always possible, that you will
| run into the very same problems and they will prevent your
| thread to work correctly.
|
| Anyway, old or new implementation of speechd, threads will
| always be used in the python communication library, since they
| are technically necessary to handle asynchronous callbacks.
| So it would be very useful to try to find a solution with pygtk.
|
| With regards,
| Hynek Hanke
|
|
|
| ___
| 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/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIEJ+YtehAhL0gheoRAi2bAJoCzDKr1+dOUSoBTFzphV2W4Y0JowCfchcQ
NnY0OLqwU66X1LHlPfHZZQc=
=YgAY
-END PGP SIGNATURE-

___
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] python-gtkhtml2 docs

2008-07-09 Thread Tom Cato Amundsen
Have a look at src/htmlwidget.py in gnu solfege. You find the tarball at
http://www.solfege.org/Solfege/Download . See the GtkHtml2Widget class in
that file. It loads images. I don't remember on the fly if css works too.

Tom Cato
___
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] Pygtk does not play nicely with speech-dispatcher

2008-07-09 Thread Hynek Hanke

John Finlay napsal(a):
The problem is that gtk and by extension pygtk has an event loop, and 
the python speechd api has implemented its own event loop within a 
thread. The speechd protocol is synchronous and sounds similar to 
RPCs. This event loop conflict was in general a problem with RPC 
programming with GUIs. The best solution is to integrate the two event 
loops using io_add_watch but that would entail throwing away the 
python speechd api and you would not have to use threads. This is the 
course I would take if I was doing your project.

Hello John,

please, I'm quite confused with this, because I have no experience with 
pygtk. What kind of conflict do you speak about? Do you propose the 
Speech Dispatcher Python API to be changed in some way?


The protocol itself is synchronous TCP protocol except for the events, 
which are handled asynchronously. Thus the Python API handles the 
communication and calls event callbacks in a separate thread. This 
should be totally independent of the pygtk event loop, isn't it?
If you want to use the speechd python api you have to make your pygtk 
program threaded

and that is more than just calling threads_init.
What else then needs to be done by a program if it wants to use pygtk in 
combination with another library that uses threads?


Thanks for your help,
Hynek Hanke


___
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] Pygtk does not play nicely with speech-dispatcher

2008-07-09 Thread Hemant Goyal
Hi,

I was reading through the conversation and while I am no expert what I
realized was that a lot of background networking tasks are executed in
separate threads when pyGTK is used. There is a standardized method that
needs to be followed when such network processing has to be combined with UI
updating. It has been elegantly explained here :
http://aruiz.typepad.com/siliconisland/2006/04/threads_on_pygt.html

Best,
Hemant

On Mon, Apr 28, 2008 at 2:06 PM, Hynek Hanke [EMAIL PROTECTED] wrote:

 John Finlay napsal(a):

  The problem is that gtk and by extension pygtk has an event loop, and
  the python speechd api has implemented its own event loop within a thread.
  The speechd protocol is synchronous and sounds similar to RPCs. This event
  loop conflict was in general a problem with RPC programming with GUIs. The
  best solution is to integrate the two event loops using io_add_watch but
  that would entail throwing away the python speechd api and you would not
  have to use threads. This is the course I would take if I was doing your
  project.
 
 Hello John,

 please, I'm quite confused with this, because I have no experience with
 pygtk. What kind of conflict do you speak about? Do you propose the Speech
 Dispatcher Python API to be changed in some way?

 The protocol itself is synchronous TCP protocol except for the events,
 which are handled asynchronously. Thus the Python API handles the
 communication and calls event callbacks in a separate thread. This should be
 totally independent of the pygtk event loop, isn't it?

  If you want to use the speechd python api you have to make your pygtk
  program threaded
  and that is more than just calling threads_init.
 
 What else then needs to be done by a program if it wants to use pygtk in
 combination with another library that uses threads?

 Thanks for your help,
 Hynek Hanke

___
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] gtk.Entry confusion

2008-07-09 Thread Seth Mahoney
Are you saying you have a bunch of entries, and need to read the text of all
of them in response to an event?  If so, you could use a set of entries and
just iterate through them, like:

for entries in entry_set:
  dict[key] = entries.get_text()

Or you could try a dict of entries, iterate through the keys (which would be
the entries) and store the text in the values, something like:

for entries in entry_dict.keys():
  entry_dict[entries] = entries.get_text()

--Seth

On Tue, Apr 29, 2008 at 12:03 PM, Andrea Caminiti [EMAIL PROTECTED]
wrote:

 hi:

 i was trying to figure how to read text from the entry widget. but i need
 to read them all at the same time and store the value of each different
 entry in a dictionary. this action need to be performed or when the text is
 inserted or clicking on a button. any suggestions?

 i know that gtk.Entry has an activate signal, but it uses the enter as
 a signal. is there any way to modify the value of the signal to use?

 thanks for your help and support.

 andrea caminiti




  
 
 Be a better friend, newshound, and
 know-it-all with Yahoo! Mobile.  Try it now.
 http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

 ___
 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 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] Gnome VFS problems

2008-07-09 Thread Justin Hibbits
When testing the example gnome-python VFS module (pyfs.py) I receive the error

Fatal Python error: could not import gnomevfs.

When I test it using the command line

%  gnomevfs-ls pyfs:///

However, running the string

python -c 'import gnomevfs'

works.  I tracked this down to the line 'from _gnomevfs import *', where it 
could not locate _gnomevfs.so.  Why can it find it when running it from the 
python interpreter, but it can't find it when running from gnomevfs-ls?  This 
does not make any sense.

Thanks,

Justin Hibbits

___
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] gnome-python _gnomevfs.so error

2008-07-09 Thread Justin Hibbits
After battling the Python Gnome VFS module plugin, I've tracked the issue down
to dlopen() of _gnomevfs.so, by disassembling the code surrounding it.  I
found that it is not reading any of the Python symbols when performing the
dlopen(), so dlopen() is returning the error:

Undefine symbol: PyType_GenericAlloc

And likely other Python symbols will be errors as well.

This was done on FreeBSD 7.0 with latest py-gnome (gnome-python 2.22.0)

Any help on this?

Thanks,

Justin
___
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] gnomekeyring incomplete

2008-07-09 Thread Maciej Katafiasz
Hi,

from what I can see, it looks like gnomekeyring bindings are very 
incomplete. Basically only the specialised functions 
(*_network_password_* and friends) are bound, and all the generic 
mechanisms (password functions other than network_password, schema 
manipulation, etc.) are inaccessible. Is that true? 

I'm writing an Epy extension to interface with GMail, and wanted to store 
passwords in the keyring. I *could* mangle it into the network_password 
structure by doing something silly like setting the protocol to 'gmail', 
but it feels wrong. Well, actually I guess it might even be beneficial if 
you happen to have passwords for http://mail.google.com already saved, 
but the question remains: why are the python bindings so limited? Not all 
data you might want to store fits into the schema of network password, 
and that's as true in C as it is in Python.

Cheers,
Maciej

___
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] Splash for app

2008-07-09 Thread shakaran
Hello, I'm starting with python and I am amazed with its potential.

I'm trying to make an application with PyGtk and I need a splash.
Googling I found very little information about it, only a couple of
blogs explaining well above with wxwidget and Gtk
pure.

With lines Gtk I fought and I managed to do something like this
:

---

#! / usr / bin / env python
# -*- Coding: UTF-8 -*-

Import pygtk
pygtk.require ('2 .0 ')
Import GTK
Import GObject

Splash Class:
 def start (self):
 print Creating SPLASH ...
 self.v = gtk.Window (gtk.WINDOW_TOPLEVEL)
 self.v.set_position (gtk.WIN_POS_CENTER)
 self.v.set_modal (True)
 self.v.set_size_request (150.100)
 self.v.set_title ( 'MiAplicación')
 self.v.AppPaintable = True

 image = gtk.Image ()
 image.set_from_file ( logo.gif)

 gtk.VBox box = ()
 box.pack_start (text, false, false, 0)
 self.v.add (box)
 image.show ()
 box.show ()

 gtk.Label label = ( MyApp 0.0.0.1)
 box.pack_start (label, True, False, 0)
 label.show ()

 self.v.show ()
 self.timeout = gobject.timeout_add (5000, self.AutoClose)

 # MiAplicacion ()
 # self.AutoClose ()

 def AutoClose (self):
 self.v.destroy ()
 False Return

MiAplicacion Class:

 def __init__ (self):
 gtk.Window window = (gtk.WINDOW_TOPLEVEL)

 Many operations #
 Cargo # BD
 # Load interfaces
 # Etc.
 # To simulate that, nothing like a big loop of 10 million
 print Starting loop
 i = 1
 while i 1000:
 i = +1

 print Loop finished
 window.show ()



def main ():
 gtk.main ()


if __name__ == __main__:
 print Loading GUI ...
 Splash s = (). start ()
 print Loading application
 Miaplicacion ()
 Main ()

---

The problem is that the splash is released, but only when everything
is loaded
the application process, hence, not
makes its main objective, which is to remain until the implementation
is
load.
The code I tried to throw the kind of application from within the
splash and closing with a timeout or
when the class of the application is completed loading.

It must be something very simple wrong but I can not see. Nor do I
references in any application of open source
This programmed with PyGtk and use a Splash, so I could not watch
and learn anything from it.

Another problem I have is not as remove all other parts of the
Window (title, and buttons to maximize, minimize and close)
Splash window.

Any comment is welcome.

Greetings.


--
Shakaran
My online role-playing game: www.apogeus.es
___
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] [Glade-users] Translation, gtk labels, and gettext

2008-07-09 Thread Rajaram

I do not know if you are still facing the issue. However, this link below
provides a good example of the way it is done, with a python script
specifically to extract translatable strings from glade and python files. 

http://lucumr.pocoo.org/articles/internationalized-pygtk-applications

HTH.
Rajaram A R


Caleb Marcus wrote:
 
 On Fri, 2007-12-07 at 14:42 -0200, Tristan Van Berkom wrote:
 
 On Dec 7, 2007 4:06 AM, Caleb Marcus [EMAIL PROTECTED] wrote:
 
 I'm now having issues with glade and gettext. I can run
 xgettext directly on the glade file, but that just produces a
 file with ALL the strings, not just the translatable ones. I
 can run intltool-extract on the glade file to produce a .h
 file, but running xgettext on the result doesn't produce any
 output unless I use the -a argument, which just extracts all
 the strings, which I don't want. What should I do?
 
 I was under the impression that there is an intltool rule for this
 (similar to INTLTOOL_XML_NOMERGE_RULE) that you can
 add to your project's makefile to create myproject.glade from
 myproject.glade.in .
 
 although I just noticed that glade 2 used to dump translatable
 strings 
 into a file for this purpose; IMO this should be the domain of
 intltool
 to extract translations from glade files (or gtkbuilder files). 
 
 I would recommend that you verify that such a rule doesnt exist
 yet and file an rfe under intltool for that.
 
 Cheers,
  -Tristan
 
 I don't have a makefile... I'm just using the .glade file with libglade
 in Python.
 
  
 ___
 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/
 
 

-- 
View this message in context: 
http://www.nabble.com/Translation%2C-gtk-labels%2C-and-gettext-tp14186759p17647954.html
Sent from the Gtk+ - Python mailing list archive at Nabble.com.

___
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: ANN Re: [pygtk] Text widget that allows for adding annotations

2008-07-09 Thread Seth Mahoney
Oh wow, thanks!  This could actually come in handy for a project I'm working
on now.

On Tue, Jun 10, 2008 at 10:32 AM, Samuel Abels [EMAIL PROTECTED]
wrote:

 On Sun, 2008-06-08 at 22:01 +0200, Samuel Abels wrote:
  I am looking for a hopefully painless way to create a text widget that
  supports annotations similar to the ones found on this picture:
 
  http://words.ibritt.com/images/loremIpsumSampleDoc.gif

 Alright, I hacked one of my own. This is what it looks like:
 http://debain.org/stuff/annotated_text_view.png

 The colors of the annotations are configurable, and annotations are
 editable.
 For example usage, see tests/SpiffGtkWidgets/show_text_view.py.

 Known caveat: The widget does not work when used in a scrolled window
 without a viewport. Since the widget can no longer automatically scroll
 when used in a viewport, this means you will have to find a way to do
 the scrolling manually. This is due to the following documented
 misbehavior in the gtk.TextView:

 The child coordinates are given relative to the gtk.gdk.Window
 specified by which_window, and these coordinates have no sane
 relationship to scrolling. [...]


 http://www.pygtk.org/docs/pygtk/class-gtktextview.html#method-gtktextview--add-child-in-window

 Here is the code:
 http://dl.debain.org/spiff_gtkwidgets/spiff_gtkwidgets.tar.bz2

 I will package this into a more official release with documentation in a
 few weeks, possibly with some additional polish.

 Enjoy,
 -Samuel


 ___
 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 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] Formatting floats in treeview

2008-07-09 Thread Neil Dugan

Jeremy S wrote:

If you put a float in a treeview, you get a really long decimal, which
is almost always not desired.  So, after playing around with it for a
while, I came up with this code to truncate floats at 1 decimal place:
column.set_cell_data_func(renderer,
lambda column, cell, model, iter:
cell.set_property('text', '%.1f' % model.get_value(iter,
column.get_sort_column_id(

The problem with this is that it uses
GtkTreeViewColumn::get_sort_column_id() to get the column number,
which only works if the column is sortable.  Can anyone tell me what
to do if I want the formatting to work on any column, not just
sortable columns?  Thank you.


I use a text renderer with a right justify setting.  And convert the 
float to a string for the model.  That way I can have any number of 
decimal points I feel like.


right = gtk.CellRendererText()
right.set_property('xalign',1.0)
column = gtk.TreeViewColumn('number',right)
view.append_column(column)

Hope this helps..

Regards Neil.

___
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] Retrieve data from a TextView

2008-07-09 Thread proveyourselfthom
Hi. How can I retrieve data from a TextView or TextBuffer? I read the
pygtk reference section and can't understand it...
Thanks.
___
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] question about dnd

2008-07-09 Thread Bóris Marin
Hi
I'm trying to create an image that can be dragged to the desktop (using
gnome) and dropped there as a .png file. I've taken a look at
dragndrop.py, which is part of the tutorial
http://www.pygtk.org/pygtk2tutorial/examples/dragndrop.py
But I still don't understand the desktop' behavior as a drag destination
- if the pixmap in the above example is dragged to the desktop, a new
text file is created (the source widget acts as a text data source,
instead of image data) when dropped.
Thanks, 
Boris Marin



___
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] A Multilevel Liststore

2008-07-09 Thread Shadi Azoum

Hi,

I am trying to make a hierarchal structure using the PyGTK ListStore.  
What would the code look like for a multilevel structure such as the  
one below:


Parent 1
   Child 1.1
   Child 1.2
   Parent 1.3
  Child 1.3.1
  Child 1.3.2
   Child 1.4
Parent 2
   Child 1
   Child 2
...

I know the code if it was just one parent with multiple children, but  
not when those children are the parents of others.


Any help would be greatly appreciated.

___
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] User Interface Designer

2008-07-09 Thread Mathias Uebelacker
Hello,

did you checked the combination Wing IDE, Glade  pyGTK?

br
Mathias


2008/3/11, Amar [EMAIL PROTECTED]:

  Hi all

 Is there a user interface designer that produces pygtk source.

 Thnaks
 Amar

 ___
 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 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] Re: How do I get the previous gtk.TreeIter in a TreeModel?

2008-07-09 Thread Jeffrey Barish
Rich Burridge wrote:
 Given a gtk.TreeIter in a gtk.TreeModel, from:

http://www.pygtk.org/docs/pygtk/class-gtktreemodel.html#method-gtktreemodel--iter-next
 
 I can see how to get the gtk.TreeIter pointing to the next row.
 But how to I get a gtk.TreeIter pointing to the previous row?
 
 Just in case I'm taking the wrong approach here, what I want to do is move
 one (or more) selected rows, up one row.
 
 I was expecting the code for the callback for the Move up one button
 to be something like:
 
 def textMoveUpOneButtonClicked(self, widget):
 textSelection = self.getTextAttributesView.get_selection()
 [model, paths] = textSelection.get_selected_rows()
 for path in paths:
 iter = model.get_iter(path)
 prevIter = model.iter_prev(iter)
 model.swap(iter, prevIter)
 
 but there is no gtk.TreeMode.iter_prev() function.

Perhaps {TreeStore,ListStore}.insert_{before,after} would be useful.  Also,
you could manipulate path arithmetically (e.g., path[0] - 1) and then
convert path to iter.  Beware, though, if you are using a TreeStore rather
than a ListStore.  Also, I wonder whether you have considered using
drag-and-drop for rearranging rows rather than move buttons.
-- 
Jeffrey Barish

___
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] Re: How do I get the previous gtk.TreeIter in a TreeModel?

2008-07-09 Thread Jeffrey Barish
In fact, there's a FAQ on the subject:

http://faq.pygtk.org/index.py?req=showfile=faq13.030.htp
-- 
Jeffrey Barish

___
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] Re: TreeView reorderable

2008-07-09 Thread Jeffrey Barish
Seltzer wrote:

 Hi,
   I have a tree view which contains a list of media items to be played,
   and
 some information about them.
 I would like to be able to let the user re-order this list, but if i just
 use set_reorderable(True) than they can actually
 drop one item onto another, and make the dropped item the child of the
 item
 it was dropped onto.  I need to disable this some how, so that you can
 reorder the list, but not not drop one item into the other, just re
 arrange them.
 I am also restricted by pygtk version 2.4
 
 thanks for the help,
 felix.

You can define a drag_motion handler in which you detect drop position with
INTO (i.e., TREE_VIEW_DROP_INTO_OR_{AFTER,BEFORE}) and then invalidate the
position by calling the enable_model_drag_dest method with a bogus target.

def on_drag_motion(self, treeview, drag_context, x, y, timestamp):
dest_row = treeview.get_dest_row_at_pos(int(x), int(y))
if dest_row is not None:
path, drop = dest_row
if drop in (gtk.TREE_VIEW_DROP_INTO_OR_AFTER,
gtk.TREE_VIEW_DROP_INTO_OR_BEFORE):
self.view['queue_treeview'].enable_model_drag_dest(
[('invalid-position', 0, -1)],
gtk.gdk.ACTION_DEFAULT)
else:
{enable model drag dest with valid target}

-- 
Jeffrey Barish

___
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] Re: A Multilevel Liststore

2008-07-09 Thread Jeffrey Barish
Shadi Azoum wrote:

 Hi,
 
 I am trying to make a hierarchal structure using the PyGTK ListStore.
 What would the code look like for a multilevel structure such as the
 one below:
 
 Parent 1
 Child 1.1
 Child 1.2
 Parent 1.3
Child 1.3.1
Child 1.3.2
 Child 1.4
 Parent 2
 Child 1
 Child 2
 ...
 
 I know the code if it was just one parent with multiple children, but
 not when those children are the parents of others.

Use a TreeStore instead of a ListStore.
-- 
Jeffrey Barish

___
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] spam?

2008-07-09 Thread Newell Jensen
I am in the same boat..

2008/7/9 Walter Leibbrandt [EMAIL PROTECTED]:

 No, you are certainly not. I currently have about 60 PyGtk ML messages from
 April 2007 through January 2008. And I've only been a member for about a
 month! Weird...


 Yann Leboulanger wrote:

 Am I the only one to be spammed by quoll.daa.com.au with mails from
 pygtk ML from 2007 ?




 ___
 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/




-- 
Newell

Before enlightenment, chop wood and carry water
After enlightenment, code and build circuits
___
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] New Gtk+ 2.12 functions

2008-07-09 Thread Gian Mario Tagliaretti
On Tue, Mar 11, 2008 at 11:24 AM, Vreixo Formoso Lopes
[EMAIL PROTECTED] wrote:

Hi,

 I'm a java-gnome developer. Since some days we're
 working on updating our .defs data with new gtk+ 2.12
 functions. I have noticed that your .defs data (pygtk
 2.12.1 release) misses many of this new functions. We
 have added some of them, and we're working to add all
 new gtk 2.12 stuff. Given our .defs data is based on
 yours, you may find interesting the attached patch,
 that adds several of the new functions. I hope to send
 you a new one next days.

Interesting, do you have a list of missing functions and methods? that
will really help us.

cheers
-- 
Gian Mario Tagliaretti
___
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] gtk.IconView random segfault

2008-07-09 Thread Mitko Haralanov
On Tue, 08 Jul 2008 19:57:23 -0400
Felipe Reyes [EMAIL PROTECTED] wrote:

 I added a test case that shows (at least on my system) my trouble.
 
 somebody can give me a clue?

The issue is locking. Changing the code to this seems to have solved
the problem:

class FillListStore(threading.Thread):
def run(self):
gtk.gdk.threads_enter ()
model.clear()
for i in range(600):
a = random.randint(0, len(img)-1)
model.append ([gtk.gdk.pixbuf_new_from_file_at_size(rootdir + 
img[a], 64, 64),
   str (i)])
gtk.gdk.threads_leave ()

thread = FillListStore()
thread.start()
win.show_all()
gtk.gdk.threads_enter ()
gtk.main()
gtk.gdk.threads_leave ()


-- 
Mitko Haralanov
==
67. Well, _my_ files were backed up.

--Top 100 things you don't want the sysadmin to say
___
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] gtk.IconView random segfault

2008-07-09 Thread Felipe Reyes
El mié, 09-07-2008 a las 16:02 -0700, Mitko Haralanov escribió:
 On Tue, 08 Jul 2008 19:57:23 -0400
 Felipe Reyes [EMAIL PROTECTED] wrote:
 
  I added a test case that shows (at least on my system) my trouble.
  
  somebody can give me a clue?
 
 The issue is locking. Changing the code to this seems to have solved
 the problem:
 
 class FillListStore(threading.Thread):
 def run(self):
 gtk.gdk.threads_enter ()
 model.clear()
 for i in range(600):
 a = random.randint(0, len(img)-1)
 model.append
 ([gtk.gdk.pixbuf_new_from_file_at_size(rootdir + img[a], 64, 64),
str (i)])
 gtk.gdk.threads_leave ()
 
 thread = FillListStore()
 thread.start()
 win.show_all()
 gtk.gdk.threads_enter ()
 gtk.main()
 gtk.gdk.threads_leave ()
 
Yes, with the locks everything works fine, but the locks added some
overhead (about 10 secons when loading 2500 pictures), I suppose that
this is normal, right?

regards,
-- 
Felipe Reyes Astorga
counter.li.org #316380


signature.asc
Description: Esta parte del mensaje está firmada	digitalmente
___
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] gtk.IconView random segfault

2008-07-09 Thread Mitko Haralanov
On Wed, 09 Jul 2008 19:41:31 -0400
Felipe Reyes [EMAIL PROTECTED] wrote:

 Yes, with the locks everything works fine, but the locks added some
 overhead (about 10 secons when loading 2500 pictures), I suppose that
 this is normal, right?

I guess it is possible for the locking to add overhead since the entire
gtk uses one master lock.
Also, are you sure that it's the locks? Have you been able to load all
2500 images before without segfaults so you can measure the time?
The alternative would be to not use a separate thread for loading the
model.

-- 
Mitko Haralanov
==
Everybody needs a little love sometime; stop hacking and fall in love!
___
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/