473,387 Members | 1,291 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Popup menus without an associated window

Is there a way using any of the Python UI toolkits to generate popup
menus outside the context of an application? For example,
middle-clicking on the desktop shows a list of shortcuts to choose
from.

Pointers to source examples would be appreciated.

--
Cheers,
Rich.

Mar 6 '06 #1
2 1493
Hello Rich,
Is there a way using any of the Python UI toolkits to generate popup
menus outside the context of an application? For example,
middle-clicking on the desktop shows a list of shortcuts to choose
from.

Pointers to source examples would be appreciated.


wxPython:

import wx

class Hidden(wx.Dialog):
def __init__(self):
wx.Dialog.__init__(self, None, -1)
self.menu = wx.Menu()
def add(title):
item = self.menu.Append(-1, title)
return item.GetId()

self.ids = {}

for title in ["One", "Two", "Three"]:
self.ids[add(title)] = title

self.Bind(wx.EVT_MENU, self.OnPopup)

def Go(self):
self.PopupMenu(self.menu)

def OnPopup(self, evt):
print "You selected %s" % (self.ids[evt.GetId()])

app = wx.PySimpleApp()
dlg = Hidden()
dlg.Go()
dlg.Destroy()
HTH,
--
------------------------------------------------------------------------
Miki Tebeka <mt*****@qualcomm.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys
Mar 6 '06 #2
> HTH,

Wonderful Miki, thank you very much!

--
Cheers,
Rich.

Mar 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mica Cooper | last post by:
Hi, I have a series of Select menus on a page. I am trying to allow the user to click on the Select title and have it popup a help window. This works fine with the following code except that all...
4
by: Mel | last post by:
is it possible to have a popup window that is either invisible or 1x1 in total size ? i tried 10x10 and it shows up around 100x20 pixels !!! please help Mel
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
0
by: B Dub | last post by:
I am merging two menus (a and b) into a third menu (c). Menu A is created by one control, and menu b by another. Each control is responsible for updating their menuitems enabled states and so each...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
1
by: Roger Withnell | last post by:
My navbar is in a frame down the left hand side of the window. The frame is 150px wide and the navbar buttons are 100px wide. Hovering over the buttons displays popup menus to the right of the...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
6
by: Mark B | last post by:
I'd like a little window to pop up when a user clicks the hyperlink text "Grade Key": Grade Key Score Range A+ 95% - 100% A 90% - 94%...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.