widget

updating bokeh plot with a bokeh widget in jupyter notebook

二次信任 提交于 2020-01-13 12:11:32
问题 I want to use bokeh widgets from within a jupyter notebook to update a bokeh plot. My (somewhat hacky) code looks like this: from bokeh.plotting import figure from bokeh.io import output_notebook, push_notebook, show from bokeh.models import CustomJS, Slider output_notebook() power = 0.5 x = [1,2,3] y = [i**power for i in x] fig = figure() plt = fig.circle(x, y) def update_plot(power): x = plt.data_source.data['x'] plt.data_source.data['y'] = [i**power for i in x] push_notebook(handle=bokeh

Two buttons with PendingIntents - Widget

元气小坏坏 提交于 2020-01-13 10:35:52
问题 I'm creating a widget with two buttons. One of them updates the content of the widget and the second one must launch an activity. I have two PendingIntent for each action, but I can't make them both work. If one works the other one doesn't. I've revised the code and can't understand what's wrong. Any help will be very appreciated. This is the code. RemoteViews controls = new RemoteViews(context.getPackageName(), R.layout.miwidget); Intent intent = new Intent("actony.com.ACTUALIZAR_WIDGET");

How to update Flutter Cards in StreamBuilder without reseting state?

强颜欢笑 提交于 2020-01-13 05:26:09
问题 I got the StreamBuilder to work properly. 1 thing, every time 1 of the elements change the entire list resets. So for example each Card has a counter that I would like to see add and subtract without the screen changing. How can I do this? Here is my code (updated with full file stack) ... final FirebaseAuth _auth = FirebaseAuth.instance; final fb = FirebaseDatabase.instance.reference(); final falQuery = fb.child('NumberOnes').orderByChild('Value'); final streamQuery = fb.child('NumberOnes')

Get the text of a button widget

淺唱寂寞╮ 提交于 2020-01-12 14:11:28
问题 I want to get the text from a button to compare it using an if-statement. Say I have this button: my_button = Button(self, text = 'hi') my_button.grid(row = 0, column = 0, sticky = W) And want to do something like this: my_text = my_button.text So that the following if-statement evaluates as True: if my_text == 'hi': # do something How can I do this in an easy way? 回答1: You can simply do: my_text = my_button['text'] Tkinter allows you to access any option of a widget this way ( height , width

Naming convention for Qt widgets

纵饮孤独 提交于 2020-01-12 04:43:05
问题 I'm working with a group of other programmers on an open source project built using C++ and Qt. Now, we need a naming convention for widgets (and other variables generally) to use it as a standard in all of our code so that, the code gets better readability and we get better coordination between programmers. Any advice? EDIT: Am not talking about naming new classes, instead I am talking about naming instances of Qt Widgets, let's say I have a text edit for user name, should I name it

Update TextView text size on AppWidget

北城以北 提交于 2020-01-11 11:33:13
问题 I can not figure this out, I've been struggling with it for days now, and I'm so tired of it.. I'm changing the text size of a TextView on an AppWidget with a Spinner from a Configuration Activity, and I can't get it to update correctly. It does not update the first time I tell it to, but it does update the second and third and every time afterwards. I'll really really appreciate if someone would take a look at my code Thank you very much Config class: public class WidgetConfig extends

The method startActivity(Intent) is undefined for the type?

≡放荡痞女 提交于 2020-01-11 07:54:14
问题 So im trying to start an activity by pressing a widget. I keep running into the error "The method startActivity(Intent) is undefined for the type Photos" any help is much appreciated! My class code is below: package com.natehoch96.widgets.iOS; import android.appwidget.AppWidgetProvider; import android.content.Intent; public class Photos extends AppWidgetProvider { Intent myIntent = new Intent(android.provider.Settings.ACTION_SETTINGS); {startActivity(myIntent); } } 回答1: You need to implement

How do I create unique IDs in a Dojo widget template?

徘徊边缘 提交于 2020-01-10 18:20:07
问题 I have a Dojo widget that I'm writing that adds a label and an input box to the user's page. The for attribute of a label requires an HTML ID value, but a Dojo widget should not contain IDs in case multiple instances are created on the same page. So, does anyone have any suggestions on how to work around these conflicting needs? 回答1: Out the box, this is how the dijit registry sets WidgetID (this.id) if the configuration parameter is not present while constructing: constructor: function(args)

Feedback Widget? [closed]

人走茶凉 提交于 2020-01-07 06:13:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I looked around before asking (used Google and this forum) so I wouldn't double post, (hopefully I'm not) but I couldn't find what I was looking for. Working on a project I was assigned to when I came across something I'd like to have present on my site. It's a little animated '-/+' feedback widget which was

Custom Font on a Android Widget

女生的网名这么多〃 提交于 2020-01-06 21:06:49
问题 I'm trying to create a digital clock widget with custom typeface font. I got clues from here Solution was by extending TextView and put new attribute for custom font typeface. This is a good solution compared to drawing Canvas and Bitmap solution then pass it to RemoteViews. I followed every step, 1. create custom class CustomFont.java 2. define style in attrs.xml 3. then put it in main.xml but I got the following errors WARN/AppWidgetHostView(18681): updateAppWidget couldn't find any view,