widget

Updating widgets in kivy (python)

感情迁移 提交于 2019-12-31 05:10:52
问题 Can anyone explain to me how you update widgets in kivy? I have a code sample here: class Game(Widget): def __init__(self, **kwargs): super(Game, self).__init__(**kwargs) with self.canvas: Color(*sky_color) Rectangle(pos=(0, 0), size=self.size) with self.canvas: Color(*grass_color) Rectangle(pos=(0,0), size=(800,75)) with self.canvas: Label(text='Funky Chicken', font_size='50sp', pos=(360, 400)) with self.canvas: Button(text='Play', font_size='20') class FunkyChickenApp(App): def build(self):

Is it possible to create dynamically pluggable GWT widgets/portlets in separate war files?

浪尽此生 提交于 2019-12-30 18:54:31
问题 Is it possible to create widgets / portlets in GWT that can be dynamically loaded and added to a GWT web application, and where the GWT widgets can reside in a separate war files? To clarify my question: JSR168/JSR286 compliant portals make it possible to create portlets in separate projects (war files) and to dynamically load these into a portal page. Suppose you want to do something similar in a GWT application. So suppose we made a portal using only GWT for the GUI (no JSP or alike) and we

How do I set the width of an Tkinter Entry widget in pixels?

徘徊边缘 提交于 2019-12-30 08:50:08
问题 I noticed that the width argument for the Tkinter entry widget is in characters, not pixels. Is it possible to adjust the width in pixels? 回答1: You cannot specify the worth in pixels using the '-width' option, but there are ways to accomplish the same thing. For example, you could pack an entry in a frame that has no border, turn off geometry propagation, then set the width of the frame in pixels. 回答2: You can also use the Place geometry manager: entry.place(x=10, y=10, width=100) #width in

Displaying radio button in elements in Shiny in a horizontal order instead of default vertical view

情到浓时终转凉″ 提交于 2019-12-30 08:15:24
问题 I'm working on a Shiny app that enables folk to browse some time series data. I have a number of widgets that enable people to select variables and type of analysis. In between, I have a modest radioButton mechanism that allows users to select time series for some variables: radioButtons("radio_year_select","Year", c("1999" = "1999", "2001" = "2001"))), The code generates a simple widget: In the context of this particular application, I would like to have the options presented in a horizontal

Qt: Resize borderless widget

六眼飞鱼酱① 提交于 2019-12-30 04:59:14
问题 My question is basically the same as this one, but applied to the Qt C++ framework. I am implementing a popup window by inheriting QWidget with flags Qt::QPopup | Qt::QWindow. I would like this window to be moveable and resizeable, I'm currently achieving this by using the mouse events in the following code: void TextPopup::mousePressEvent(QMouseEvent* event) { offset = event->pos(); QWidget::mousePressEvent(event); } void TextPopup::mouseMoveEvent(QMouseEvent* event) { if(event->buttons() &

ipywidgets: Update one widget based on results from another

寵の児 提交于 2019-12-30 03:23:04
问题 I am using widgets in IPython that allows the user to repeatedly search for a phrase and see the results (different titles) in another widget (a selection widget) and then select one of the results. In short: search_text = widgets.Text(description = 'Search') search_result = widgets.Select(description = 'Select table') def search_action(sender): phrase = search_text.value df = search(phrase) # A function that returns the results in a pandas df titles = df['title'].tolist() search_result

Validating multiselect with jquery validation plugin

笑着哭i 提交于 2019-12-29 09:08:12
问题 Trying to figure out why my recipient multiselect isn't validating on form submission. Should be atleast 1 person chosen. I have it set to be required true but yet its still not displaying the error. http://jsfiddle.net/mMZYT/ JS: var validateform = $("#pmForm").validate({ rules: { recipient: { required: true }, bcc: { required: true }, subject: { required: true }, message: { required: true } }, invalidHandler: function(form, validator) { var errors = validator.numberOfInvalids(); if (errors)

How to post toast from non ui Widget thread

我的未来我决定 提交于 2019-12-29 08:23:09
问题 I am trying to post a toast after calling a function from a non UI thread in a widget. I've read multiple ways of doing this (post/new handler/broadcast) but most methods seem to be aimed at activities rather than widget classes and I can't get any to work. I have some basic code below... Can anyone tell me the best way to do what I need to do and maybe provide an example... Thank you (obviously I've taken out all the unnecessary bits... I know you can't use runOnUiThread in a widget but what

Dashboard Cross-domain AJAX with jquery

≡放荡痞女 提交于 2019-12-29 07:55:08
问题 Hey everyone, I'm working on a widget for Apple's Dashboard and I've run into a problem while trying to get data from my server using jquery's ajax function. Here's my javascript code: $.getJSON("http://example.com/getData.php?act=data",function(json) { $("#devMessage").html(json.message) if(json.version != version) { $("#latestVersion").css("color","red") } $("#latestVersion").html(json.version) }) And the server responds with this json: {"message":"Hello World","version":"1.0"} For some

Read HTML content of webview widgets

蹲街弑〆低调 提交于 2019-12-29 07:08:38
问题 I want to read HTML content of webview widgets. Is there any property or method which can be used to fetch the HTML of the currently open page? 回答1: You can inject a javascript into webView and get the html element. Check below code... class MyJavaScriptInterface { @SuppressWarnings("unused") @JavascriptInterface public void showHTML(final String html) { //HTML content of the page } } mWebView.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT"); mWebView.loadUrl("javascript:window