realbasic-nug
[Top] [All Lists]

Displaying icons in a ContextualMenu (PopUp)

To: realbasic-nug@lists.realsoftware.com
Subject: Displaying icons in a ContextualMenu (PopUp)
From: Lennox Jacob <lenpartico@yahoo.com>
Date: Fri, 27 Feb 2009 11:26:15 -0800 (PST)
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; domainkeys=hardfail (test mode) header.From=lenpartico@yahoo.com
Delivered-to: listarchive@realsoftware.com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=1tVk3+iJGq2s8BlDXkBneby7fFe7OZoQFGHNXF5DN8TX3uO9MkIVta860qUuR2mz6XBhZAFdsOCrbG6Pg+hkvCwhfH+ICCNDEpRJjSKpR9BHdesNvGfRP85XMfY8J5mODXjdO0NsxhHJv4KKxtRFJjk38ehXBfKpLYycmnyWse0=;
Domainkey-status: bad (test mode)
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Hello,

I have this in an ImageWell MouseDoen event:

  // Make the base item, this is what will be doing the popping up
  dim base as new MenuItem
  dim f as folderitem
  f=GetFolderItem("")
  dim i as integer
  f = SpecialFolder.Applications
  // Add some items
  for i = 1 to f.Count
    Dim item As folderitem = f.TrueItem(i)
    If item.Name.Left(1) = "." or item.DisplayName = "Icon" + chr(13) then
      'do not display it
    else
      base.Append( new MenuItem( item.DisplayName) )
    end if
  next i
  
  // Add a Separator
  base.Append( new MenuItem( MenuItem.TextSeparator ) )
  
  // Add a sub menu
  dim submenu as new MenuItem( "SubMenu" )
  submenu.Append( new MenuItem( "SubMenu Test 1" ) )
  submenu.Append( new MenuItem( "SubMenu Test 2" ) )
  submenu.Append( new MenuItem( "SubMenu Test 3" ) )
  base.Append( submenu )
  
  // Add a Separator
  base.Append( new MenuItem( MenuItem.TextSeparator ) )
  
  // Add an item that's on a menu bar so that you can see you don't
  // have to handle every item returned.
  base.Append( UntitledItem )
  
  #if TargetMacOS
    // becuase of how quitting the app is handled on Mac OS you cannot add the 
FileQuit item on OS X
  #else
    base.Append( FileQuit ()
  #endif
  
  // Now display the menu
  dim hitItem as MenuItem
  hitItem = base.PopUp
  
  if hitItem <> nil then MsgBox hitItem.Text
  
  return true


So when the project is built and launched if I hold the mouse down in the 
Imagewell the contents o SpecialFolder.Applications is displayed.

I would like to have their icons(or a picture of their icons) displayed too, 
how can I do that?

Thanks.

Lennox.


      

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>
  • Displaying icons in a ContextualMenu (PopUp), Lennox Jacob <=