Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I wrote a function, name as testingand saved in .m file.

if you evaluate this function, we will get progressBar and corresponding stepNo with in list form.

after that,If you click on Bar,

it checks whether, second argument value is True or not?

if second argument is True, it allows to Action.

if second argument is not equals to True, it doesn't allow anything..

this is my requirement.

for this purposes I wrote the following code.

testing[x_, booleanValue_] :=
  Module[{input = x},
    {EventHandler[Column[{ProgressIndicator[input, {0, 100}]}], 
       {"MouseClicked" :>
         (If[(booleanValue === True), (input = input + 1), ("")])}],
      Dynamic[input]}]  

if you call the above function, we will get output like this.

  testing[3, True]

enter image description here

after that, if you click on the bar, we will get like this.

enter image description here

I call the above function in following code.

 startingNo = 3;
 valuesList = {True, True, True, True, False, True, False, True, False};
 outputValue = {1, 1};
 Dynamic[(
   outputValue = testing[startingNo, Part[valuesList, startingNo]];
   startingNo = Setting[Part[outputValue, 2]];
   Part[outputValue, 1])]

here,startingNo value dynamically change,

whenever we click on the bar, dynamically startingNo value will change, that means automatically barRange also will change. why? because we passing startingNo as a argument. but here barRange doesn't working.

how can I solve this? can anyone help me?

feel free to edit my question.

share|improve this question
5  
hi; is is possible to make a smaller example that illustrate the problem? Actually, many times I find myself, when I want to ask a question, I go to make a small example to show the problem, and when making this small example, I end up finding my problem, because I eliminated many things that made it hard to see the problem, or by just making the small example to reproduce it, it helped me learn what the problem was. May be you can try that? – Nasser Mar 6 at 20:23
2  
Oh man.. it feels like you used 23 whitespaces per indentation level? This is not Haskell! – halirutan Mar 6 at 20:24
@halirutan I assumed when I saw the code that the tab setting in Subbu notebook was misconfigured somehow of he might have changed the setting there to his preference as I never seen M generate such large spaces before. I agree, it makes the code harder to read and understand. – Nasser Mar 6 at 20:38
@Nasser,@halirutan,I edited my question.can you check once. – subbu Mar 7 at 7:14

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.