widget

Update Matplotlib 3D Graph Based on Real Time User Input

醉酒当歌 提交于 2020-01-05 05:45:09
问题 I am trying to get matplotlib to create a dynamic 3d graph based on user input - but I can't get the graph to update. If I use the exact same code but without the "projection='3d'" setting, the program works correctly - but as soon as the graph is changed to display in 3d - it doesn't work. Any help would be greatly appreciated. 3D Graph Code (graph doesn't update) import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider from mpl_toolkits.mplot3d import Axes3D

How to keep some text relative to the line into the plot when the plot changes

爱⌒轻易说出口 提交于 2020-01-05 05:32:25
问题 I would like to put some text below a horizontal line in a plot that changes with changing two parameters. I use a function to plot and python widgets to set two controls that change the plot and at the same time change the distances of the x and y-axis. My iPhyton code is: from ipywidgets import widgets from IPython.display import display import matplotlib.pyplot as plt import numpy as np %matplotlib notebook def update_plot(h1, h2): plt.figure( figsize = (9,4) ) ax=plt.subplot(111) D = np

Performance RemoteViews in Android

半世苍凉 提交于 2020-01-05 04:28:13
问题 I am trying to write a small application in Android. My application is on Widgets. I have a basic doubt on using RemoteViews. I found that whenever , I update some button or some UI layout a new object of the remoteviews is created . Will that be a problem with the performance? an example code is this: http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_message); even for updating the

Highlighting a clicked line in an unfocused Tkinter text widget

耗尽温柔 提交于 2020-01-04 17:46:12
问题 I'd like to keep focus on the entry text widget, which will pass whatever's entered into a separate display text widget. I have that part working. I can't figure out how to make it so that when someone clicks on the display text widget the line clicked is highlighted (or the line changes background color) but focus is returned to the entry widget. I also need to store a reference to that line so that i can manipulate it with other Widgets. Here's some sample code so you can see how I have it

Looping over widgets in Tkinter

给你一囗甜甜゛ 提交于 2020-01-04 05:31:11
问题 here's the issue I'm thinking of: I have a number of similar widgets in the frame(e.g. Lables). I update them every iteration of the algorithm (using root.update() in the relevant function. What I'd like to know, is how to loop through each Label. Of course, they were created with something like self.var1=IntVar() self.lab1=Label(frame,textvariable=self.var1) self.lab1.grid() So each of the lables are named lab1,lab2, etc. I'm quite sure there should either be a better way of naming them, so

How to setup custom css with bokeh serve

雨燕双飞 提交于 2020-01-03 18:33:04
问题 How to assign css proprties to a custom class assigned to a widget through css_classes if I'm serving my app through bokeh serve --show ? from bokeh.models import Button button = Button(label="Press Me", css_classes=['myclass']) curdoc().add_root(button) 回答1: If you dont mind using a html template, once you define your css classes, their styles can be set in a css file. (If you want to include the css styles from within python this answer wont help you) This can be included in the html

Creating composite Javascript/HTML “widgets”

╄→гoц情女王★ 提交于 2020-01-03 17:48:32
问题 What I would like to do is be able to dynamically a block of self-contained HTML that has additional properties. I'm not sure what to call it, as "widget" now implies it is something like flair or a badge to put on your blog. I am talking about a reusable, customizable, "composite" JS/HTML(/CSS) object. For example, a simple date picker. document.body.appendChild(new DatePicker()); Would generate <div class="datepicker" name="..."> <select class="datepicker_monthSelect"> <option value="0"

Django: Require Checkbox to be ticked to Submit Form

混江龙づ霸主 提交于 2020-01-03 14:54:12
问题 I'm creating a form in Django (using ModelForm). There are many checkboxes, and I want to make it so that one of these must be selected in order to submit the form. I don't mean any one checkbox, but one specific box. I can't find anything in the Django documentation. Any help would be appreciated. 回答1: Something like from django import forms class MyForm(forms.Form): check = forms.BooleanField(required = True) # your other form fields For a BooleanField, required = True will check if the box

Android emulator 4.2.2 not showing add widget option in lock screen [closed]

若如初见. 提交于 2020-01-03 13:57:15
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . In newer android versions you can add a widget to the homescreen AND the lock-screen. To be able to test this during development it would be good to be able to add these to the emulator-lock-screen as well. This

How to solve Android screen size for different mobile devices?

孤人 提交于 2020-01-03 10:59:13
问题 I am testing the Android application in a small screen mobile. If I use Samsung tablets like other landscape mobile to test my android application the contents are moved slightly. How do I solve the screen resolution in Android? 回答1: I think you should better check it in the Developer's website, where you have all the information. Here it is Supporting Multiple Screens In Android 回答2: use this in manifest.xml <supports-screens android:resizeable="true" android:smallScreens="true" android