Re: [pygtk] problem with focus in notebook

2009-06-05 Thread Rob Brown-Bayliss
On Thu, 2009-06-04 at 08:52 -0400, Mike Bernson wrote:

 
 Walter Leibbrandt wrote:
  Mike Bernson wrote:
  I have a notebook that I want to control where the focus goes on page 
  switches.


Have a similar need to know when a user clicks on a tab to activate the
page.

I place an event box in the tap, and the label in the event box like so:



evb = gtk.EventBox()
evb.set_visible_window(False)
lab = gtk.Label(self.label)
evb.show()
lab.show()
evb.add(lab)
evb.connect(button_release_event, self.on_tab_button_pressed)
# call on user click
self.page.reparent(self.main_notebook)  # adding page to not
book
self.main_notebook.set_tab_label(self.page, evb)  # setting the
evb as label for page.




--
Rob Brown-Bayliss

http://globalvillage.sourceforge.net 
The world at your finger tips...



The reasonable person adapts to the
world; the unreasonable one persists
in trying to adapt
the world to themselves. Therefore,
all progress depends on unreasonable
people.


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

Re: [pygtk] Adding menu items at runtime

2009-06-05 Thread Alessandro Dentella
On Wed, Jun 03, 2009 at 01:01:44PM +0200, Johannes Bauer wrote:
 Hello list,
 
 I have a Pyton application which reads in some plugins and needs to add
 items to a plugins menu accordingly at runtime. Now I expected to to a
 builder/get for the MenuItem parent entry and then use add (as
 MenuItem inherits from Bin).
 
 But - weird: Although in the glade-File I see my Plugins_MenuItem as
 of type GtkMenuItem, in the generated XML it is of type GtkAction
 (and is so also during runtime). I cannot add children to a GtkAction,
 however...

I don't use glade, so I can't be of help with that, but testing it with
glade I don't get GtkAction entries. 

I only recently started using the gtk.UIManager() object and that's in my
opinion the better way to go if you want a simple and dynamic solution.

sandro
*:-)
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] Adding menu items at runtime

2009-06-05 Thread Alexandre González
Hi!
I'm newbie in python and Gtk programming, but I thinks that this can solver
you problem.

I have a Class Widgets that load (with GtkBuilder) my glade file, and in
this class I have a method __getitem__ that return
self.builde.get_object(key) so if you use this mehod, you cand work with the
Gtk Menu to .add .remove or what you like to do with it.

If you have more troubles I can send you my first python+glade project to
see how I do it.

Regards,
Alex Gonzalez

On Fri, Jun 5, 2009 at 19:28, Alessandro Dentella san...@e-den.it wrote:

 On Wed, Jun 03, 2009 at 01:01:44PM +0200, Johannes Bauer wrote:
  Hello list,
 
  I have a Pyton application which reads in some plugins and needs to add
  items to a plugins menu accordingly at runtime. Now I expected to to a
  builder/get for the MenuItem parent entry and then use add (as
  MenuItem inherits from Bin).
 
  But - weird: Although in the glade-File I see my Plugins_MenuItem as
  of type GtkMenuItem, in the generated XML it is of type GtkAction
  (and is so also during runtime). I cannot add children to a GtkAction,
  however...

 I don't use glade, so I can't be of help with that, but testing it with
 glade I don't get GtkAction entries.

 I only recently started using the gtk.UIManager() object and that's in my
 opinion the better way to go if you want a simple and dynamic solution.

 sandro
 *:-)
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/




-- 
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx
http://mirblu.com
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

[pygtk] A timer to refresh my app controls?

2009-06-05 Thread Alexandre González
Hi!

I like to know the best way to refresh my buttons... I go to explain. I'm
developing a frontend, so I depend that the backend change some values, so
after a little time I need to read some propertys from the backend and setup
my frontend button. What's the best way to do it and don't use a lot of CPU.

Thank you!

-- 
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx
http://mirblu.com
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/