Public bug reported:

I have written a python program with an application indicator. Sometimes
(about 1 over 3 times the complete program is started afresh), but not
regularly, the indicator menu shows, the items are getting focus, but
nothing happens when clicking.

I started the program from a terminal window, and expect that on
clicking on any of the 4 buttons, output is printed to the terminal
window, and at clicking on button 4 the program is also ended and the
application icon removed. After most starts of the program, that
happens, but sometimes (about 1 in 3) the buttons appear correctly, but
nothing happens when they are clicked.


A simplified version of my program is:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as appindicator

def maken_indicatorscherm():
   APPINDICATOR_ID = 'ID_App_test' 
   indicator = appindicator.Indicator.new(APPINDICATOR_ID, "whatever", 
appindicator.IndicatorCategory.APPLICATION_STATUS)
   indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
   indicator.set_menu(build_menu()) 
   gtk.main()
   
def build_menu():
   menu = gtk.Menu()
   item_open = gtk.MenuItem('Test 1')
   item_open.connect('activate', laat_EA_zien)
   menu.append(item_open)
   item_overzicht = gtk.MenuItem('text 2')
   item_overzicht.connect('activate', overzicht_EA)
   menu.append(item_overzicht)
   item_start = gtk.MenuItem('text 3')
   item_start.connect('activate', verberg_EA)
   menu.append(item_start)
   item_quit = gtk.MenuItem('Quit')
   item_quit.connect('activate', quitGTK)
   menu.append(item_quit)
   menu.show_all()
   return menu
    
def quitGTK(source):
   print "Quit program"
   gtk.main_quit()
   
def laat_EA_zien(source):
   print "show text 1"
   
def overzicht_EA(source):
   print "show text 2"
   
def verberg_EA(source):
   print "show text 3"
   

if __name__ == '__main__':
   maken_indicatorscherm()

I am using ubuntu:
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
with python: 
2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]

** Affects: indicator-application (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to indicator-application in Ubuntu.
Matching subscriptions: dx-packages
https://bugs.launchpad.net/bugs/1712052

Title:
  indicator application menu freezes irregularly

Status in indicator-application package in Ubuntu:
  New

Bug description:
  I have written a python program with an application indicator.
  Sometimes (about 1 over 3 times the complete program is started
  afresh), but not regularly, the indicator menu shows, the items are
  getting focus, but nothing happens when clicking.

  I started the program from a terminal window, and expect that on
  clicking on any of the 4 buttons, output is printed to the terminal
  window, and at clicking on button 4 the program is also ended and the
  application icon removed. After most starts of the program, that
  happens, but sometimes (about 1 in 3) the buttons appear correctly,
  but nothing happens when they are clicked.

  
  A simplified version of my program is:

  import gi
  gi.require_version('Gtk', '3.0')
  from gi.repository import Gtk as gtk
  gi.require_version('AppIndicator3', '0.1')
  from gi.repository import AppIndicator3 as appindicator

  def maken_indicatorscherm():
     APPINDICATOR_ID = 'ID_App_test' 
     indicator = appindicator.Indicator.new(APPINDICATOR_ID, "whatever", 
appindicator.IndicatorCategory.APPLICATION_STATUS)
     indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
     indicator.set_menu(build_menu()) 
     gtk.main()
     
  def build_menu():
     menu = gtk.Menu()
     item_open = gtk.MenuItem('Test 1')
     item_open.connect('activate', laat_EA_zien)
     menu.append(item_open)
     item_overzicht = gtk.MenuItem('text 2')
     item_overzicht.connect('activate', overzicht_EA)
     menu.append(item_overzicht)
     item_start = gtk.MenuItem('text 3')
     item_start.connect('activate', verberg_EA)
     menu.append(item_start)
     item_quit = gtk.MenuItem('Quit')
     item_quit.connect('activate', quitGTK)
     menu.append(item_quit)
     menu.show_all()
     return menu
      
  def quitGTK(source):
     print "Quit program"
     gtk.main_quit()
     
  def laat_EA_zien(source):
     print "show text 1"
     
  def overzicht_EA(source):
     print "show text 2"
     
  def verberg_EA(source):
     print "show text 3"
     

  if __name__ == '__main__':
     maken_indicatorscherm()

  I am using ubuntu:
  Description:  Ubuntu 16.04.2 LTS
  Release:      16.04
  with python: 
  2.7.12 (default, Nov 19 2016, 06:48:10) 
  [GCC 5.4.0 20160609]

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/indicator-application/+bug/1712052/+subscriptions

-- 
Mailing list: https://launchpad.net/~dx-packages
Post to     : dx-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dx-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to