GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Aug 31, 2016 4:02 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Keep showing context menu when a popup window is opened
PostPosted: Mon Sep 16, 2013 6:06 pm 

Joined: Mon Sep 16, 2013 8:54 am
Posts: 1
I am trying to show a calendar from a context menu. At first, I included it as a 'Gtk.MenuItem', but after reading answer, I am now showing the calendar as a popup window when the user hovers over a menu item.

When the user hovers over 'Set due date', the calendar is supposed to show up right beside it. It is shown when 'activate' signal ( 'on_set_due_via_calendar' ) fires from the 'Set due date' menu item. Here's the code for it -

def on_set_due_via_calendar(self, widget):
    rect = widget.get_allocation()
    x, y = widget.window.get_origin()
    menu_width, menu_height = widget.get_toplevel().window.get_size()
    calendar_width, calendar_height = self.calendar.get_size()
    self.calendar.show_at_position(x + rect.x + calendar_width + menu_width,
                                   y + rect.y + calendar_height)

The problem I'm facing is that the menu disappears as soon as the window is shown ( Perhaps it works that way ). I want it to keep getting displayed until the user clicks somewhere else ( i.e. - Treat the calendar as a submenu ).

Here are the screens showing the issue -



Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group