Re: [pygtk] Tooltips on MenuItem and ui_manager

2010-09-08 Thread Alessandro Dentella
Hi. Sorry for reposting. But it seems strange to me that such an ordinary
feature of Actions/MenuItem tooltip is not known by anybody.

Most of the application I see do have tooltips on menuItems: I can't believe
I should copy tooltips from action to MenuItem by hand...


I've searched in the docs to see if there is a flag that enables them w/o
finding anything.

sandro
*:-)

On Thu, Sep 02, 2010 at 10:13:37AM +0200, Alessandro Dentella wrote:
 Hi again,
 
 
 I use  UIManager() + group_action.add_actions() to create MenuItems and
 ToolItems. I set tooltips as required by actiongroup.add_actions( 5^ field).
 
 These tooltip show correctly for toolitems but they won't for menu
 entries. Is it the desired behaviour? What can I do to have tooltips for
 MenuItems as well? Note that
 
   ui_manager.get_action(action_name).props.tooltip
 
 shows the tooltip correctly while *both* menyitem and toolitem don't (but
 toolitem shows the tooltip correctly):
 
   ui_manager.get_widget(menu_entry_name).props.tooltip_text   ### None
   ui_manager.get_widget(tool_entry_name).props.tooltip_text   ### None
  
 
 .set_tooltip_text() works correctly in menu items, but it's terribly
 inconvenient to set them one by one when I already set tooltips in the
 actions, I guess I'm missing something!
 
 
 any hints?
 
 thanks
 
 sandro
 *:-)
 
 
 
 
 -- 
 Sandro Dentella  *:-)
 http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
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] Tooltips on MenuItem and ui_manager

2010-09-08 Thread Alessandro Dentella
here is the code that shows what I mean. The action 'Test' has a tooltip in
the ToolButton and not in the meny entry:

thanks in advance for any possible hint/explanation

import gtk

GENERAL_UI = '''
  menubar name=Main
 menu action=File
menuitem action=Test/
/menu
  /menubar
  toolbar name=TbMain
 toolitem action=Test/
  /toolbar
 '''

class Test(object):

def __init__(self):
w = gtk.Window()
h = gtk.VBox()
w.add(h)

actions = gtk.ActionGroup('test')
actions.add_actions([
('File', None, 'FILE'),
('Test', gtk.STOCK_ABOUT, 'Test name', None, 'Tooltip for test', 
self.debug),
])

ui_manager = gtk.UIManager()
ui_manager.add_ui_from_string(GENERAL_UI)
ui_manager.insert_action_group(actions)

menu= ui_manager.get_widget('/Main')
toolbar = ui_manager.get_widget('/TbMain')

h.add(menu)
h.add(toolbar)
w.resize(200, 60)
w.show_all()

def debug(self, action):
print action

t = Test()

gtk.main()


On Wed, Sep 08, 2010 at 09:26:52AM +0200, Alessandro Dentella wrote:
 Hi. Sorry for reposting. But it seems strange to me that such an ordinary
 feature of Actions/MenuItem tooltip is not known by anybody.
 
 Most of the application I see do have tooltips on menuItems: I can't believe
 I should copy tooltips from action to MenuItem by hand...
 
 
 I've searched in the docs to see if there is a flag that enables them w/o
 finding anything.
 
 sandro
 *:-)
 
 On Thu, Sep 02, 2010 at 10:13:37AM +0200, Alessandro Dentella wrote:
  Hi again,
  
  
  I use  UIManager() + group_action.add_actions() to create MenuItems and
  ToolItems. I set tooltips as required by actiongroup.add_actions( 5^ field).
  
  These tooltip show correctly for toolitems but they won't for menu
  entries. Is it the desired behaviour? What can I do to have tooltips for
  MenuItems as well? Note that
  
ui_manager.get_action(action_name).props.tooltip
  
  shows the tooltip correctly while *both* menyitem and toolitem don't (but
  toolitem shows the tooltip correctly):
  
ui_manager.get_widget(menu_entry_name).props.tooltip_text   ### None
ui_manager.get_widget(tool_entry_name).props.tooltip_text   ### None
   
  
  .set_tooltip_text() works correctly in menu items, but it's terribly
  inconvenient to set them one by one when I already set tooltips in the
  actions, I guess I'm missing something!
  
  
  any hints?
  
  thanks
  
  sandro
  *:-)
  
  
  
  
  -- 
  Sandro Dentella  *:-)
  http://sqlkit.argolinux.orgSQLkit home page - 
  PyGTK/python/sqlalchemy
  ___
  pygtk mailing list   pygtk@daa.com.au
  http://www.daa.com.au/mailman/listinfo/pygtk
  Read the PyGTK FAQ: http://faq.pygtk.org/
 
 -- 
 Sandro Dentella  *:-)
 http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
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] Tooltips on MenuItem and ui_manager

2010-09-08 Thread Timo

On 08-09-10 09:51, Alessandro Dentella wrote:

here is the code that shows what I mean. The action 'Test' has a tooltip in
the ToolButton and not in the meny entry:

thanks in advance for any possible hint/explanation
   
Connect the uimanager to the connect-proxy signal, there you can set 
tooltips to the menuitems.

See in-code for a working implementation.

Note: this maybe can be easier, I just modified it from my code where I 
show a statusbar message when the mousepointer goes over the menuitems.


Cheers,
Timo


import gtk

GENERAL_UI = '''
   menubar name=Main
  menu action=File
 menuitem action=Test/
 /menu
   /menubar
   toolbar name=TbMain
  toolitem action=Test/
   /toolbar
  '''

class Test(object):

 def __init__(self):
 w = gtk.Window()
 h = gtk.VBox()
 w.add(h)

 actions = gtk.ActionGroup('test')
 actions.add_actions([
 ('File', None, 'FILE'),
 ('Test', gtk.STOCK_ABOUT, 'Test name', None, 'Tooltip for test', 
self.debug),
 ])

 ui_manager = gtk.UIManager()
   

ui_manager.connect('connect-proxy', self.uimanager_connect_proxy)

 ui_manager.add_ui_from_string(GENERAL_UI)
 ui_manager.insert_action_group(actions)

 menu= ui_manager.get_widget('/Main')
 toolbar = ui_manager.get_widget('/TbMain')

 h.add(menu)
 h.add(toolbar)
 w.resize(200, 60)
 w.show_all()
   

def uimanager_connect_proxy(self, uimgr, action, widget):
tooltip = action.get_property('tooltip')
if isinstance(widget, gtk.MenuItem) and tooltip:
widget.set_tooltip_text(tooltip)

 def debug(self, action):
 print action

t = Test()

gtk.main()


On Wed, Sep 08, 2010 at 09:26:52AM +0200, Alessandro Dentella wrote:
   

Hi. Sorry for reposting. But it seems strange to me that such an ordinary
feature of Actions/MenuItem tooltip is not known by anybody.

Most of the application I see do have tooltips on menuItems: I can't believe
I should copy tooltips from action to MenuItem by hand...


I've searched in the docs to see if there is a flag that enables them w/o
finding anything.

sandro
*:-)

On Thu, Sep 02, 2010 at 10:13:37AM +0200, Alessandro Dentella wrote:
 

Hi again,


I use  UIManager() + group_action.add_actions() to create MenuItems and
ToolItems. I set tooltips as required by actiongroup.add_actions( 5^ field).

These tooltip show correctly for toolitems but they won't for menu
entries. Is it the desired behaviour? What can I do to have tooltips for
MenuItems as well? Note that

   ui_manager.get_action(action_name).props.tooltip

shows the tooltip correctly while *both* menyitem and toolitem don't (but
toolitem shows the tooltip correctly):

   ui_manager.get_widget(menu_entry_name).props.tooltip_text   ### None
   ui_manager.get_widget(tool_entry_name).props.tooltip_text   ### None


.set_tooltip_text() works correctly in menu items, but it's terribly
inconvenient to set them one by one when I already set tooltips in the
actions, I guess I'm missing something!


any hints?

thanks

sandro
*:-)




--
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
   

--
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
 
   


___
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] Tooltips on MenuItem and ui_manager

2010-09-08 Thread Alessandro Dentella
On Wed, Sep 08, 2010 at 12:12:06PM +0200, Timo wrote:
 On 08-09-10 09:51, Alessandro Dentella wrote:
 here is the code that shows what I mean. The action 'Test' has a tooltip in
 the ToolButton and not in the meny entry:
 
 thanks in advance for any possible hint/explanation
 Connect the uimanager to the connect-proxy signal, there you can set
 tooltips to the menuitems.
 See in-code for a working implementation.

Thanks Timo. This solves my need.

I still don't understand the logig behind the fact that tooltips are only
activated for Tool items and not for menu Items...


sandro
*:-)
-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
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] Tooltips on MenuItem and ui_manager

2010-09-08 Thread Timo

On 08-09-10 15:39, Alessandro Dentella wrote:

On Wed, Sep 08, 2010 at 12:12:06PM +0200, Timo wrote:
   

On 08-09-10 09:51, Alessandro Dentella wrote:
 

here is the code that shows what I mean. The action 'Test' has a tooltip in
the ToolButton and not in the meny entry:

thanks in advance for any possible hint/explanation
   

Connect the uimanager to the connect-proxy signal, there you can set
tooltips to the menuitems.
See in-code for a working implementation.
 

Thanks Timo. This solves my need.

I still don't understand the logig behind the fact that tooltips are only
activated for Tool items and not for menu Items...


   
I don't know, but I never saw a program with tooltips on the menuitems, 
they always show up in the statusbar. Maybe it is against some (GNOME?) 
guidelines to do it.


Well, glad it helped.
Cheers,
Timo


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] Tooltips on MenuItem and ui_manager

2010-09-08 Thread Alessandro Dentella
On Wed, Sep 08, 2010 at 06:54:46PM +0200, Timo wrote:
 On 08-09-10 15:39, Alessandro Dentella wrote:
 On Wed, Sep 08, 2010 at 12:12:06PM +0200, Timo wrote:
 On 08-09-10 09:51, Alessandro Dentella wrote:
 here is the code that shows what I mean. The action 'Test' has a tooltip in
 the ToolButton and not in the meny entry:
 
 thanks in advance for any possible hint/explanation
 Connect the uimanager to the connect-proxy signal, there you can set
 tooltips to the menuitems.
 See in-code for a working implementation.
 Thanks Timo. This solves my need.
 
 I still don't understand the logig behind the fact that tooltips are only
 activated for Tool items and not for menu Items...
 
 
 I don't know, but I never saw a program with tooltips on the
 menuitems, they always show up in the statusbar. Maybe it is against
 some (GNOME?) guidelines to do it.

Ubuntu - System - * all do have tooltips

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


[pygtk] Tooltips on MenuItem and ui_manager

2010-09-02 Thread Alessandro Dentella
Hi again,


I use  UIManager() + group_action.add_actions() to create MenuItems and
ToolItems. I set tooltips as required by actiongroup.add_actions( 5^ field).

These tooltip show correctly for toolitems but they won't for menu
entries. Is it the desired behaviour? What can I do to have tooltips for
MenuItems as well? Note that

  ui_manager.get_action(action_name).props.tooltip

shows the tooltip correctly while *both* menyitem and toolitem don't (but
toolitem shows the tooltip correctly):

  ui_manager.get_widget(menu_entry_name).props.tooltip_text   ### None
  ui_manager.get_widget(tool_entry_name).props.tooltip_text   ### None
 

.set_tooltip_text() works correctly in menu items, but it's terribly
inconvenient to set them one by one when I already set tooltips in the
actions, I guess I'm missing something!


any hints?

thanks

sandro
*:-)




-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/