Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6320743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:01:49+00:00 2026-05-24T16:01:49+00:00

My simple first Palette is suppose to: Append my packages Path to $Path ActionMenu[test,{The

  • 0

My simple first Palette is suppose to:

  • Append my packages Path to $Path

ActionMenu["test",{"The Simple Packages Path":> AppendTo[$Path, ToFileName[{NotebookDirectory[], "02 Simple Packages"}]]}]

  • Get my packages

ActionMenu["Load Packages", {"Get my package":> Get["myPackage`"]}]

  • Place on the selected input cell (or on a new input cell), a given input expression, containing different place holders.

OpenerView[{"my Package", Button["construct", Paste[StandardForm@Defer@construct[Placeholder["description"],Placeholder["another description"]]]]}]

The problem is that I keep getting “shadow” messages when I click on the “get my package” action menu item. And I’m sure I’m not double loading the package intentionally. When I click on “construct”, it writes Global`construct["description","another description"]. But I’m sure I didn’t define it before getting the package (I killed the kernel on my tests).

Do you know what is wrong?

(I use Get on my packages, instead of Needs, to ensure a clean start of the package context)

Also: do you know of a simpler way of doing the Paste[StandardForm@Defer... that ensures both that the expression being paste isn’t evaluated and that it goes into an input cell, even when there’s no cell selected?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:01:50+00:00Added an answer on May 24, 2026 at 4:01 pm

    Ok, it seems that your problem is due to the interplay between parsing and interface creation. What you would like in this case is to delay the parsing of package symbols in your interface – constructing code (package symbols that you use in button action functions), from the interface – creation time, until the “press button” time (assuming that by that time, the package has been loaded). Here is one way to do it:

    Column[{ActionMenu["Load Packages",
       {"Get my package" :> Get["ANOVA`"]}],
       OpenerView[{"ANOVA", Button["construct",
           With[{sym = Symbol["ANOVA"]},
             Paste[StandardForm@Defer@sym[Placeholder["DATA"]]]]]}]}]
    

    What we did here is to use With to inject the symbol into the code for the button function. But, at the time your interface code is parsed, we prevent the creation of the Global symbol with this name – this is what happens otherwise, and this is what causes your problem.

    EDIT

    If you know for sure that you only use symbols (functions) from packages, and not from the Global' context, here is a version that will be “protected” from this problem: it will Remove the generated symbol if its context turns out to be Global' – and thus pressing button before the package has been loaded would result merely in a warning message (I use the symbol package to attach the message to – should be replaced by whatever is the name of your interface – making function):

    package::noload = "Please load the package containing symbol `1`";
    Column[{ActionMenu["Load Packages",
      {"Get my package" :> Get["ANOVA`"]}],
       OpenerView[{"ANOVA", Button["construct",
          With[{sym = Symbol["ANOVA"]},
            If[Context[sym] === "Global`",
              Message[package::noload, Style[ToString[sym], Red]];
              Remove[sym];,
              (* else *)
              Paste[StandardForm@Defer@sym[Placeholder["DATA"]]]]]]}]}]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm playing with Mockito (1.9.5) and stuck at first simple test case: List mockedList
I am trying get my first simple project in rails to run. I have
Hi i am using DirectX 10 and C++ to make a very simple first
I'm building a simple code-first MVC 3 blog like application. My model has three
I'm trying to write my first simple mvc app. I have a Main View
Now on my localhost I'm starting developing first simple web service using ruby 1.9.2
I'm implementing the specification pattern. The NotSpecification seems simple at first: NotSpecification.IsSpecialCaseOf(otherSpecification) return !this.specification.isSpecialCaseOf(otherSpecification)
I developed a simple jQuery animation first and later I create a jQuery function
I'm planning to develop a very simple application (my first Android application) and I'd
First, the simple question. Is it possible to receive an event when MEF (System.ComponentModel.Composition)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.