Hi HMark, I don't think we can currently have controls depending on other controls, but there is a ticket for this. Is this what you are asking about? Unfortunately, our trac server for such things is currently a little wacky, so I can't tell you where to look.
As to examples of other things, Rado Kirov's graph_editor() *only* runs in the notebook for now, and is a nice example of what is possible in the notebook. I hope this helps! - kcrisman On Sep 1, 12:21 pm, HMark <[email protected]> wrote: > Hi, > > I have started using sage a short while ago, after playing with > Mathematica for a while, and I'm impressed! > > One thing I'm missing is a way to change interact widget rendering in > the browser, from within the code. > > So, in the simple example athttp://www.sagenb.org/home/pub/2409/(and > also below), what I'd like to see is that the n_points_local input_box > widget (in this case, but other types of widgets in general) gets > updated every time a new point is added, and n_points_global and > n_points_local get modified. > > Similarly, the code changes the state of the point_operation buttons > to 'Reset' after every time a point is added, but the button widgets > rendering doesn't reflect that. > > 1. is there a way to do this with the built-in functionality, or do I > need to build a custom GUI with widgets rendered outside of @interact > (but within the browser)? > > 2. Regardless, are there examples of custom GUIs, rendered in the > browser (Notebook), interacting with the sage functionality, I can > look at? > > Any pointers would be appreciated. > > # --- global --- > display_points = Graphics() > n_points_global = 5 > > for i in range(n_points_global): > display_points += point((round(10 * random(), 0), round(10 * > random(), 0))) > > @interact > def point_setting( > point_operation = ['Reset', 'Add a point'], > n_points_local = input_box(default = n_points_global, label = > 'number of points:', width = 5) > ): > global display_points, n_points_global > > if point_operation == 'Add a point': > display_points += point((round(10 * random(), 0), round(10 * > random(), 0))) > n_points_global += 1 > n_points_local = n_points_global > point_operation = 'Reset' > > print "number of points = ", len(display_points) > show(display_points, xmin = 0, xmax = 10, ymin = 0, ymax = 10) -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
