[pygtk] Different panel applet on each workspace?!

2004-11-23 Thread Henrik Brink
Hello!

I'm writing a panel applet for gnome using python. 

I want this applet to display different content on each workspace. How
do I do that?

I've tried to connect the gdk root window to the property-notify-event
in the hope that it would pick up the change in _NET_CURRENT_DESKTOP
when the user switches workspace, but it does not.

Can this be done using libwnck? Is that the only way? I would like to
find another way because libwnck has no python bindings. I think...

Thanks in advance...

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


Re: [pygtk] Cell height depending on amount of text

2004-11-23 Thread Johan Dahlin
 All cells of a treeview have to be the same height? Is there any way to
 make the height of every cell depend on the amount of text it
 contains?

No, the default behavior is to allow cells of different height.
I'm not sure how flexible the mechanism is though. If all cells in the
same row needs to have the same height or not.

I have never done this myself, but try playing around with
GtkCellRender.set_fixed_height.

-- 
Johan Dahlin [EMAIL PROTECTED]

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


[pygtk] program and gui configuration.

2004-11-23 Thread Antoon Pardon

This may be slightly off topic but I have no idea
where else to search, so here goes.


I'm writing a program in which the data is arranged
in a certain topology. This topology is read in from
a configuration file at start up. 

The problem is I need two kinds of information.
The first is just the logical topology like node
1 has node 8, 9, 46 and 58 as neighbours and the
kind of connection between nodes.
The second is GUI information, like where in the
window to display the node, what image to use
for displaying this node etc.

Now my questions.

What would be best? Have two information structures
in the program, one that contains the logical info
and the other containing the GUI information or
put all information in one structure, where every
instance contains both its logical as its GUI information.

For the moment I'm leaning to the first option since
I would like to use the same datastructures in components
that don't use a GUI. If I choose for this first option,
should I also seperate the config file in two?

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


[pygtk] How to use show signal

2004-11-23 Thread Martijn Brouwer
I do not succeed in using the show signal. To isolate my problem I
have written this Hello World program:

import gtk
import gtk.glade

def HelloWorld(widget):
print Hello World!

dic={on_window1_show: HelloWorld}
Widgets=gtk.glade.XML(onshow.glade, window1)
Widgets.signal_autoconnect(dic)

gtk.main()

In my glade file I have connected the show signal of the mainwindow to
the on_window1_show handler.
When I run this program, the window (which only shows a label) is showed
correctly, but the HelloWorld function is not called.
Where is my mistake?

Thanks in advance for helping,

Martijn Brouwer



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


Re: [pygtk] How to use show signal

2004-11-23 Thread Gustavo J. A. M. Carneiro
On Tue, 2004-11-23 at 20:51 +0100, Martijn Brouwer wrote:
 I do not succeed in using the show signal. To isolate my problem I
 have written this Hello World program:
 
 import gtk
 import gtk.glade
 
 def HelloWorld(widget):
   print Hello World!
 
 dic={on_window1_show: HelloWorld}
 Widgets=gtk.glade.XML(onshow.glade, window1)
 Widgets.signal_autoconnect(dic)
 
 gtk.main()
 
 In my glade file I have connected the show signal of the mainwindow to
 the on_window1_show handler.
 When I run this program, the window (which only shows a label) is showed
 correctly, but the HelloWorld function is not called.
 Where is my mistake?

  You are connecting the signal _after_ it being emitted.   Try setting
the 'visibile' property of window to false, in glade.  Then, in the
code, connect your signal and then manually show the window, with
Widgets.get_widget(window1).show().  Your callback will then be
invoked.

 
 Thanks in advance for helping,
 
 Martijn Brouwer
 
 
 
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Gustavo J. A. M. Carneiro
[EMAIL PROTECTED] [EMAIL PROTECTED]
The universe is always one step beyond logic

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


Re: [pygtk] How to use show signal

2004-11-23 Thread Martijn Brouwer
On Tue, 2004-11-23 at 21:20 +, Gustavo J. A. M. Carneiro wrote:
 On Tue, 2004-11-23 at 20:51 +0100, Martijn Brouwer wrote:
   You are connecting the signal _after_ it being emitted.   Try setting
 the 'visibile' property of window to false, in glade.  Then, in the
 code, connect your signal and then manually show the window, with
 Widgets.get_widget(window1).show().  Your callback will then be
 invoked.
 

Thanks for your fast answer. Your suggestion works partially. I changed
my test program to what is shown below.
import gtk
import gtk.glade 
import time 

def HelloWorld(widget):
print Hello World!

dic={on_window1_show: HelloWorld}
Widgets=gtk.glade.XML(onshow.glade, window1)
Widgets.signal_autoconnect(dic) 

print show the window
Widgets.get_widget(window1).show()
time.sleep(1)
print hide the window
Widgets.get_widget(window1).hide()
time.sleep(1)
print show it again
Widgets.get_widget(window1).show()
gtk.main()

When I run this program, the output on the console is:
show the window
hide the window
show it again
Hello World!

The program window only appears after the *second* invocation of show(),
just as Hello World! is only printed the second time. Apperently, the
connection of the signal works. By why is nothing happening on the first
invocation?

Bye,

Martijn


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


Re: [pygtk] How to use show signal

2004-11-23 Thread Chris Lambacher
Did you set window1 invisible in your glade file?


On Tue, 23 Nov 2004 23:19:24 +0100, Martijn Brouwer
[EMAIL PROTECTED] wrote:
 On Tue, 2004-11-23 at 21:20 +, Gustavo J. A. M. Carneiro wrote:
  On Tue, 2004-11-23 at 20:51 +0100, Martijn Brouwer wrote:
You are connecting the signal _after_ it being emitted.   Try setting
  the 'visibile' property of window to false, in glade.  Then, in the
  code, connect your signal and then manually show the window, with
  Widgets.get_widget(window1).show().  Your callback will then be
  invoked.
 
 
 Thanks for your fast answer. Your suggestion works partially. I changed
 my test program to what is shown below.
 import gtk
 import gtk.glade 
 import time
 
 def HelloWorld(widget):
 print Hello World!
 
 dic={on_window1_show: HelloWorld}
 Widgets=gtk.glade.XML(onshow.glade, window1)
 Widgets.signal_autoconnect(dic)
 
 print show the window
 Widgets.get_widget(window1).show()
 time.sleep(1)
 print hide the window
 Widgets.get_widget(window1).hide()
 time.sleep(1)
 print show it again
 Widgets.get_widget(window1).show()
 gtk.main()
 
 When I run this program, the output on the console is:
 show the window
 hide the window
 show it again
 Hello World!
 
 The program window only appears after the *second* invocation of show(),
 just as Hello World! is only printed the second time. Apperently, the
 connection of the signal works. By why is nothing happening on the first
 invocation?
 
 Bye,
 
 Martijn
 
 
 
 
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
 


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


[pygtk] GtkTreeView Oddness

2004-11-23 Thread Robert Uhl
I've a GtkTreeView with a GtkTreeStore as its model, and I've noticed
something extremely odd: the first column will appear or disappear as I
mouseover it, or shrink or expand the column.  Has anyone any idea what
might be causing this?  I've never seen it happen before, and it's
driving me quite batty.

-- 
Robert Uhl [EMAIL PROTECTED]
OTOH there are some of us in .UK who would rather like NAFTA to
become the North Atlantic Free-Trade Area, and for .UK to sign
up to it instead of us piddling around on the periphery of some
wannabe second-rate-superpower European bureaucracy that, in all
honesty, couldn't come to a consensus on how many primary colours
there are.   --Tanuki
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] GtkTreeView Oddness

2004-11-23 Thread Dave Aitel
Robert Uhl wrote:
I've a GtkTreeView with a GtkTreeStore as its model, and I've noticed
something extremely odd: the first column will appear or disappear as I
mouseover it, or shrink or expand the column.  Has anyone any idea what
might be causing this?  I've never seen it happen before, and it's
driving me quite batty.
 

I use gtktreeview a lot and I've never seen this happen - but it doesn't 
show/update unless it gets mouseovered for me, which may be a clue in 
the puzzle. :
-dave

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


Re: [pygtk] GtkTreeView Oddness

2004-11-23 Thread Niklas Volbers
I had something similar lately: The expander icon would appear or 
disappear!!! Finally I realized this was a bug in the GTK-theme I was 
using.  Switching to another theme solved my problem.

If this is not your problem you might want to post the initialization 
code for your treeview.

Niklas Volbers.
Robert Uhl wrote:
I've a GtkTreeView with a GtkTreeStore as its model, and I've noticed
something extremely odd: the first column will appear or disappear as I
mouseover it, or shrink or expand the column.  Has anyone any idea what
might be causing this?  I've never seen it happen before, and it's
driving me quite batty.

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


Re: [pygtk] How to use show signal

2004-11-23 Thread Martijn Brouwer
Yes, I did.

Martijn


On Tue, 2004-11-23 at 17:28 -0500, Chris Lambacher wrote:
 Did you set window1 invisible in your glade file?
 
  Thanks for your fast answer. Your suggestion works partially. I changed
  my test program to what is shown below.
  import gtk
  import gtk.glade 
  import time
  
  def HelloWorld(widget):
  print Hello World!
  
  dic={on_window1_show: HelloWorld}
  Widgets=gtk.glade.XML(onshow.glade, window1)
  Widgets.signal_autoconnect(dic)
  
  print show the window
  Widgets.get_widget(window1).show()
  time.sleep(1)
  print hide the window
  Widgets.get_widget(window1).hide()
  time.sleep(1)
  print show it again
  Widgets.get_widget(window1).show()
  gtk.main()
  
  When I run this program, the output on the console is:
  show the window
  hide the window
  show it again
  Hello World!
  
  The program window only appears after the *second* invocation of show(),
  just as Hello World! is only printed the second time. Apperently, the
  connection of the signal works. By why is nothing happening on the first
  invocation?


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