custom contextual menus

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

custom contextual menus

Post by reelstuff » Fri Jan 07, 2011 1:00 am

I am interested in learning about how to create a custom contextual menu so I can manage and integrate repetitive tasks without having to
access the standard menu bar. I should also say that my goal would be to use the same code across platforms, at least for windows and MAC OSX

I looked into the dictionary and could find no information on this, I also checked the PDF users manual and searched but was unable to find any meaningful information.

If anyone knows of a resource not listed that could guide me in the right direction, please let me know.

Tim

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: custom contextual menus

Post by RRobert » Fri Jan 07, 2011 3:25 am

I should also say that my goal would be to use the same code across platforms, at least for windows and MAC OS X.
No way.

In Windows, it is a Registry entry with a command line. Mac OS X needs a custom plugin and under Linux it depends which desktop environment you use (Gnome, KDE, …).

It is doable but with custom platform specific code.

Windows
Mac OS X [1] [2]
Linux (Gnome) [1] [2]

Under Linux I would investigate the gnome-open-terminal plugin for Nautilus.

Robert

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: custom contextual menus

Post by FourthWorld » Fri Jan 07, 2011 3:33 am

Tim, did you mean within your app or system-wide?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: custom contextual menus

Post by reelstuff » Fri Jan 07, 2011 3:41 am

Hi, thanks for the reply, I was hoping to find a method of using it from within a standalone app, I was looking at some other methods of doing that, I just could not find anything in black and white, on creating a custom contextual menu item, thanks for any suggestion, I appreciate it,

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: custom contextual menus

Post by Klaus » Fri Jan 07, 2011 1:48 pm

Tim,

we still have no idea about what you want to do with these contextmenus?
See Richards question!


Best

Klaus

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: custom contextual menus

Post by reelstuff » Fri Jan 07, 2011 2:27 pm

Oh yes, I see, pardon, now that I look at it again, so a contextual menu only inside my app, will only be available to my app, and no where else.

where as system wide, (say a utility for launching an app or performing a scripted function) would be available even as sort of a standalone context menu.

I can see a use for both of those situations, I think being able to define a scripted function to be added to a contextual menu, would be the ideal approach.

for example, if I have a list of data in txt format, and I want to launch and then define that action, so that it is available to the contextual menu,

crude apple script, I imagine there should be some equiv live code script for doing the same thing.

Code: Select all

set urlList (variable of urls from urlList.txt) set numURLs to (count urlList)
set url List to myvarlist.txt tell application "Safari|Firefox"
  activate
 tell application "System Events"
 keystroke (item 1 of urlList)
    key code 36
    repeat with i from 2 to (numURLs)

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: custom contextual menus

Post by reelstuff » Fri Jan 07, 2011 2:31 pm

RRobert wrote:
I should also say that my goal would be to use the same code across platforms, at least for windows and MAC OS X.
No way.

In Windows, it is a Registry entry with a command line. Mac OS X needs a custom plugin and under Linux it depends which desktop environment you use (Gnome, KDE, …).

It is doable but with custom platform specific code.

Windows
Mac OS X [1] [2]
Linux (Gnome) [1] [2]

Under Linux I would investigate the gnome-open-terminal plugin for Nautilus.


Thanks Robert, I missed your reply, I can see how that would work, and thanks for the links I will investigate those now

Robert

Post Reply