Tag Info

Hot answers tagged

21

Don't forget, with M we have all of Java at our fingertips with just a few keystrokes. So why don't you use Java Swing, which is a professional UI framework that runs on hundreds of millions of devices. I have ShowProgressBar and DestroyProgressBar in my init.m, because I use them frequently. Needs["JLink`"] ReinstallJava[] ...


18

If you're on version 9, you can use gauges: HorizontalGauge[90, {0, 100}, ScaleRangeStyle -> Red, GaugeMarkers -> "ScaleRange"] I don't fully understand how Mathematica scales and aligns things like gauges (and it's not the sort of thing that's easy to find in the documentation) but I would explore the options using a Manipulate: Manipulate[ ...


17

I know of no method by which to control the color of that element. I'm afraid that it may not be possible. I believe the style of the ProgressIndicator is taken from the OS settings, or rather the ProgressIndicator is rendered by the OS. If you look at the on-line documentation for versions 7, 8, 9 you see that the style changes: 7: 8: 9: Further, I ...


12

For this solution, I've made rasterized versions of ProgressIndicator, replacing green tones by similarly light/dark red tones by means of a function toRed. All other colors used by default are gray levels, i.e. they match the {c_,c_,c_} pattern. This works fine only for the appearance shown third in Mr. Wizard's answer (also seen below). What's left then is ...


10

I decided to create a repository of usually undocumented lists (or just a links to similar topics) of available options: AppearanceElements for Manipulate and friends MouseAppearance styles All Font families All the Properties that ColorData supports? Events for EventHandler. AFAICT additional two that work: "MouseExited"/"MouseEntered" EventHandler ...


10

Update 2: Found a few more and started to document which elements apply to which controls. The total number of elements is now 27 (or 29 if you include All and None). I could not find examples for the InteractiveTradingChart elements or for the UpdateButton. Can anyone help there? appearanceList = {"AutorunPlayButton", "BookmarksButton", ...


10

This answer in not the answer you want. There are almost certainly more options for a button's appearance than are documented in the Help Center. As far a I know there is no way to discover what appearance options apply to buttons. This seems to be a deliberate policy on the part of WRI. I recently had a exchange of email with WRI tech suppor on a related ...


9

The answer is that yes, you can affect the appearance of components of a control but the problem in this case is that your list of appearances appearances = {"DialogBox", "Palette", "FramedPalette", "Frameless"}; are only valid Button appearances and that is why they have no effect of ButtonBar or TabView. When you use valid appearances it works fine: ...


8

You can always create your own custom controls. This is a lot of work, but it also gives you unlimited flexibility. You can even create completely new kinds of control. Scroll down to the last section here to see an example. If you're aiming for a custom TabView-like control, I'd start with PaneSelector. Here's a primitive example (just a start, not ...


6

I guess all the important information can be found in the tutorial, specifically in the subsection Access to the Java Object Layer There, you see that you can easily extract the class that is used for widgets << GUIKit` ref = GUIRun[Widget["Label", {"text" -> "Stay afloat!"}]] First[ref] (* « JavaObject[com.wolfram.guikit.swing.GUIKitJFrame]» ...


5

You might use Row. For example: Manipulate[{u, v}, Row[{Control[{u, 0, 6}], Control[{v, 10, 20}]}, Spacer[10]]]


5

It turns out, after lots of poking around, that the fact that the cell is inline is not really the relevant thing. What is relevant is that each stylesheet has a property, LimitsPositioningTokens, that specifies which symbols should use the off-to-the-side limits positioning by default. For the Text style, that list includes all the usual things, including ...


5

This is different but you may find it useful. The second line will be evaluated in place code with panel, just Ctrl+9 to create an inline cell and type: select this and evaluate in place with Ctrl+Shift+Enter


4

This Answer is based upon Kuba's comment above regarding two InputFields, so credit should go to him for the idea, this is just an implementation. However, the problem interested me because I have a similar issue to solve regarding entering units into answers, and this question and Kuba's comment made me think of a related solution to that. One can use ...


3

It is quite unclear where that element is, so maybe this approach will fit you needs: progress := Clock[1, 1, 1]; nb = CreatePalette[DynamicWrapper[ ProgressIndicator@Dynamic@progress, If[progress == 1, NotebookClose@nb], UpdateInterval -> 1] ]


3

Let's just not draw it if the progress goal is achieved: Dynamic[ x = Clock[3]; If[x < 1, ProgressIndicator[x], Sequence[] ] ] Sequence can be "" or whatever is appropriate in your application.


3

The nested single-element GridBoxes make it likely that this format was generated by code. In fact, the inline cell expression matches exactly that generated by the Equal Symbol Aligned Math Cell from the Writing Assistant palette (in V9, at least):


2

This accepts a plain number or "E" format or "*^" notation.. ClearAll["Global`*"]; SetAttributes[sciInput, HoldFirst]; inst[numstring_] := InputField[numstring, String, FieldSize -> {20, 1}, FieldHint -> "enter a number"]; sciInput[result_] := DynamicModule[{sig, nn}, ...


2

Quick fix is to use Pane[#, ImageMargins -> {{0, 10}, {5, 5}}] & on tabs contents. Not convenient but working. Probably also OS dependent solution... To not copy this I'm using a function which can be used directly on TabView: tabViewFix1 = Function[tabView, MapAt[ Pane[#, ImageMargins -> {{0, 10}, {5, 5}}] &, ...


1

Is this what you want? doStuff := Module[{}, (* do stuff *)]; Button["Do stuff", doStuff] Here you can put whatever you want in doStuff.


1

I reported a problem with Opener and Appearance option, this is the reply: [CASE:2678632] Feedback [...] There is an 'Appearance' issue on the Windows platform and it has been reported already. [...] So I believe it is a subject to change. As a temp. replacement: opF = Opener@False~Rasterize~(ImageSize -> 12); opT = ...


1

The way you want to Export data depends on your tastes and what you plan to do with the XLS file afterwards. But as belisarius said Export is your friend: rawdata = WeatherData["WMO44207", "Temperature", {{2013}, {2013}}] Export["your/Path/rawdata.xls", rawdata, "XLS"] If you want to Export rawdata after making some Mathematica operations on it (e.g. ...


1

Let's try such code: trig = True; pi = Dynamic[If[trig, ProgressIndicator[0.5], ""]]; pi If trig is True, then ProgressIndicator is visible, otherwise it is not.. Playing with value of trig you can dynamically change the state of any visible elements.


1

There are some options to Button that let you change the way a button looks. For example, Appearance and BaseStyle. Also, you can use a Graphics object as the button label, which will give you a lot of control over appearance. See Button for more detail. In particular, look at Option > Neat Examples.



Only top voted, non community-wiki answers of a minimum length are eligible