Kivy popup contents - python

I am trying to use kivy as the graphical system and yet i dont know how to put inside a button and a label at the same time where label shows text and button closes popup also there is one import ant thing here it must be a function that can have editable title and contents and buttob(text) and can be launched like: self.popup(text1, text1, text3) Does anyone know how do it?

Kivy popup contents: What do you want ? Nobody can answer this !!! Give a precise question (here are some propositions for your next SO post).
I am trying to use kivy as the graphical system: How to use kivy app as a graphical system ?
and yet i dont know how to put inside a button and a label at the same time where label shows text and button closes popup
Kivy: how to add a widget (Label/Button) to an app ?
Kivy: how to change Label text ?
Kivy: how to bind a function on a button click ?
Kivy: How to close a popup ?
also there is one import ant thing here: .
it must be a function that can have editable title and contents and buttob(text):
I think you should check out what theses terms are: POO, Inheritance, attribute, method.

Related

automatically start typing in tkinter Entry

I'm trying to make a input screen with Tkinter that will when i type automatically receive my input without me having to click it first. would this be possible?
I wasn't able to find a tutorial or text document online to do this, and hope someone can help me with this problem! I'm on Windows 10 (bootcamped on a mac) with Python 3.8.3 64-bit.
The concept you are looking for is called "focus". When you type, the widget with the focus will receive the keypress events. So, to let you immediately type into an entry widget, force the UI to set the focus to that widget by using focus_set:
the_entry = Entry(root, ...)
the_entry.focus_set()
When the window as a whole is focused (ie: brought to the front), this will cause the keyboard focus to be set to the entry widget.

Tkinter: What's the difference between grab and focus?

In tkinter I am creating a Toplevel widget to prompt the user with "Are you sure you want to exit?" every time they try to exit my application. While this is happening, I want the Toplevel widget to have full focus of my application and the user to be unable to click anything on the root window, if possible.
While trying to figure out to do this, I discovered grabs and the ability to set the focus of the application. What is the difference between these two things?
Thanks in advance.
Focus means that your window will receive all keyboard events until some other window gets the focus. A grab tells the window manager that your window should have the focus until you explicitly tell it that it is allowed to take it away (ungrab).

Grab the focus from GTK popup menu

In my python GTK project, I have a popup menu which pop-ups while typing in a particular text area. But, when type a letter popup menu get the focus and I can't type anymore in the text area until I click on the text area and grab the focus manually. I want to keep the focus to the text area as I type regularly while popup menu comes. Can anyone give tell me a way to do this. I tried widget.grab_focus() method. But it didn't solve my problem.
Also I want to know how to set the position of the popup menu. It always appears near by mouse pointer. I want it to appear near by my application.
Thanks all.
I ran into the same problem using the C API, the solution was to invoke the following functions, I presume they're approximately similar to the python equivalents:
gdk_pointer_ungrab(GDK_CURRENT_TIME);
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gtk_grab_remove(menu);

wxPython: How to put a textbox control on the popup menu

I can implement a trayicon with popup menu following the code of this topic:
Quick and easy: trayicon with python?
thanks for the guys in that topic very much and now I have another question here:
Could I add a textbox control in the menu to let the user to input something?
What I want is a menu with textbox control:
In the official doc and demo of wxPython we can see the text control added to the menubar, but not the popup menu.
Thanks
Did you try it? I can't think of any limitations on the PopupMenu that would prevent you from doing it. If it doesn't work, try using FlatMenu. That widget is pure Python and can probably be hacked to support it if it doesn't already.

Popup Dialog in Tkinter/Python

I need to add a popup dialog box on my GUI.
So, when ever I hover my mouse over a label, it should be able to show a popup( Like the type we get while hovering over a file in windows).
It should also disappear as soon i move away the mouse.
To start with, I am not even sure which module or class to use. I tried menu, but the results are not what i expected.
I also tried to learn tkCommonDialog, but couldn't understand it properly.
Please Advice!
The little popup window is called a tooltip.
This post may be relevant: http://bytes.com/topic/python/answers/505848-tkinter-button-overrelief
Take a look at the Balloon widget in the Tix package. I think it is just what you are looking for.

Categories

Resources