testinggtk r334 - trunk/tests



Author: bjornl
Date: Wed Jul  2 20:00:52 2008
New Revision: 334
URL: http://svn.gnome.org/viewvc/testinggtk?rev=334&view=rev

Log:
Test for menubar.select_item

Modified:
   trunk/tests/test_uimanager.py

Modified: trunk/tests/test_uimanager.py
==============================================================================
--- trunk/tests/test_uimanager.py	(original)
+++ trunk/tests/test_uimanager.py	Wed Jul  2 20:00:52 2008
@@ -92,6 +92,39 @@
     menubar = ui.get_widget('/ui/menubar')
     menubar.select_first(False)
 
+ utils fail_on_warnings
+def test_menubar_select_item():
+    '''
+    Ensure that no warning is shown if an item is selected from a menu
+    bar constructed using a ui manager when that items
+    ``hide-if-empty`` property is ``False``.
+
+    :bug: #540618
+    '''
+    xml = '''
+    <ui>
+        <menubar>
+            <menu name = "Menu1" action = "action"/>
+            <menu name = "Menu2" action = "action"/>
+            <menu name = "Menu3" action = "action"/>
+            <menu name = "Menu4" action = "action"/>
+            <menu name = "Menu5" action = "action"/>
+        </menubar>
+    </ui>        
+    '''
+    action = gtk.Action('action', '', '', None)
+    action.set_property('hide-if-empty', False)
+
+    ag = gtk.ActionGroup('default')
+    ag.add_action(action)
+
+    ui = gtk.UIManager()
+    ui.insert_action_group(ag)
+    ui.add_ui_from_string(xml)
+
+    menubar = ui.get_widget('/ui/menubar')
+    menubar.select_item(menubar.get_children()[3])
+
 def test_change_hide_if_empty_updates_visibility():
     '''
     Ensure that when the ``hide-if-empty`` property is updated the



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]