widget

tkinter widget interface interactive button

纵饮孤独 提交于 2020-02-08 04:26:29
问题 I am very new to interactive python programming so please bear with me. I am using PyCharm with Python 3.3. I am attempting to build the following: I want to generate an a function that pulls up interactive window with two text input fields and two buttons: -The first button (START) runs a small text-search function (which I already wrote and tested), while the second button (QUIT) will quit the app. -The first text input field takes a string to be searched (ex: "Hello Stack World"), while

Hybris widget connection through socket id

夙愿已清 提交于 2020-02-05 03:20:34
问题 I'm trying to create a widget that can communicate with another one through sockets. I've followed the documentation from here but I couldn't understand how their example works. I've created the definition.xml where I've defined the inputs/outputs, mychat.zul and the controller . But I couldn't find anywhere in the platform the tag <widget-connection> to see that the widget is actually connecting the inputs/outputs to something.. or isn't this the purpose of the tag above? I've added the

Flutter: Block Gestures to underneath widgets

醉酒当歌 提交于 2020-02-04 12:16:27
问题 I have a stack with some widget, and I want tat the most in top widget blocks all the gestures to the underneath widgets. I've tried with a GestureDetector and opaque behaviour but does not work. What is the correct approach? 回答1: If you have shared some code, that would be better, so now I can just give you an idea, you can try AbsorbPointer . AbsorbPointer(child: YourWidget()) 回答2: You can use the IgnorePointer widget to block any gesture for it's child. IgnorePointer( child: MyWidget(),

No way to color the border of a Tkinter Button?

岁酱吖の 提交于 2020-02-02 04:06:26
问题 It works with some other widgets, but not with Buttons. from Tkinter import * root = Tk() root.geometry("600x300+400+50") btn_up = Button(root, text='Go UP') btn_up.config(highlightbackground="red", highlightcolor="red", highlightthickness=10, relief=SOLID) btn_up.pack() root.mainloop() Python 2.7 - Windows 10 回答1: I am using linux and when I run your code, I get a button with a thick red border, so it looks like that the default Windows theme does not support highlightthickness while the

Get the chosen values from FilteredSelectMultiple widget in Django

天涯浪子 提交于 2020-02-01 09:39:28
问题 In Django admin , does anyone know how can i get the chosen values from FilteredSelectMultiple widget in, when the form is saved? class ControllerForm(forms.ModelForm): terminal = forms.ModelMultipleChoiceField(queryset=[]) def __init__(self, *args, **kwargs): super(ControllerForm, self).__init__(*args, **kwargs) self.fields['terminal'].widget = widgets.FilteredSelectMultiple('terminals', False) self.fields['terminal'].help_text = "Select the terminals which are to be added to the group."

Get the chosen values from FilteredSelectMultiple widget in Django

浪尽此生 提交于 2020-02-01 09:39:14
问题 In Django admin , does anyone know how can i get the chosen values from FilteredSelectMultiple widget in, when the form is saved? class ControllerForm(forms.ModelForm): terminal = forms.ModelMultipleChoiceField(queryset=[]) def __init__(self, *args, **kwargs): super(ControllerForm, self).__init__(*args, **kwargs) self.fields['terminal'].widget = widgets.FilteredSelectMultiple('terminals', False) self.fields['terminal'].help_text = "Select the terminals which are to be added to the group."

How to force calling of QWidget::paintEvent() when its hovered by other window?

帅比萌擦擦* 提交于 2020-01-30 13:15:10
问题 I have occured a problem: I'm writing a widget, which displays current date's day number. It's like a button, but it's not derived from QPushButton class. Just from QWidget . So I reimplemented enterEvent() , leaveEvent() , mousePressEvent() , mouseReleaseEvent() . I call update() inside these methods and widget has realistic button behavior ( paintEvent() is reimplemented too). But when I change system date and hover that widget with other window, my widget doesn't calls paintEvent() and

Why does pack and grid override the parent widget's predefined dimensions?

谁都会走 提交于 2020-01-30 11:28:27
问题 I noticed each time I create a Tkinter widget and set its dimensions either during the widget instantiation or by configuring them later, these last ones take no effect as soon as I add child widgets inside the parent one where I organize them using the grid layout manager. My question: I rather ask my question just to be sure as I am a beginner: does this mean that using the grid layout manager overrides the predifined parent widget's dimensions ? May be some explanation on how this works ?

Why does pack and grid override the parent widget's predefined dimensions?

蹲街弑〆低调 提交于 2020-01-30 11:28:06
问题 I noticed each time I create a Tkinter widget and set its dimensions either during the widget instantiation or by configuring them later, these last ones take no effect as soon as I add child widgets inside the parent one where I organize them using the grid layout manager. My question: I rather ask my question just to be sure as I am a beginner: does this mean that using the grid layout manager overrides the predifined parent widget's dimensions ? May be some explanation on how this works ?

kivy custom widget bind error

99封情书 提交于 2020-01-30 05:14:31
问题 I am trying to make a small tetris game for learning python with kivy. I am trying to create a custom widget with size 20,20. When I add it to the float layout and run the below code I receive the following error: Error: File "D:\OS Files\workspace\Tetris\holder.py", line 10, in __init__ self.add_widget(c) File "C:\Kivy180\kivy\kivy\uix\floatlayout.py", line 115, in add_widget pos_hint=self._trigger_layout) TypeError: descriptor 'bind' of 'kivy._event.EventDispatcher' object needs an argument