How to use checkable auto-exclusive buttons - python

I hope find an answer. I have created an application with Python and PyQt4, and I have made the buttons checkable to select a file or folder from the treeview, and all button are auto-exclusive. The problem is when I choose another tab and check a button from there, the button in the first tab is still checked and I can't call setchecked(False). Any idea how to solve this problem ?
archive with the code and the ui used : sorry i don't know how to insert the code here .
enter link description here

Related

How to click on QTextEdit with cursor in PyQT5 code

I have a QTextEdit acting as a input field of sorts so whenever you click the post button, it posts whatever is in that QTextEdit. However after I hit post, the text edit deselects which is annoying to have to keep clicking on it before I type more. Is there a method or way in PyQT5 to click on that text box automatically in my code without having to manually move my mouse?
I looked into QTextCursor but that appears to be more for the actual text inside of the text box instead of the box itself. If there's a way to do this, I would greatly appreciate it, thank you!

"Browse file" window freeze code execution in pywinauto

I am working on automating program that requires choosing file path.
After I click the browse button using code:
dlg.child_window(auto_id='btnBrwsBinFile').click()
browse window opens and freeze execution of code and I cannot control the popup window.
I have tried also different approach. I have edited text filed using code:
dlg['Edit'].set_text(path)
but then program do not see the path, it treats the field like it was never edited, like it was empty
I would like to ask if someone solved this issue before.
try:
dlg.child_window(title='btnBrwsBinFile').click_input()
pywinauto documentation:https://pywinauto.readthedocs.io/en/latest/code/pywinauto.findwindows.html
You can use UISpy.exe to get the title, class name

Is there any to access textinput (widget)'s text into another class in kivy of python 3?

i am getting a problem in my project this is the little bit information regarding that:--
link given below is the link to my project. For running it you should have to download all the files in a same folder.
the main problem is when you run it you will get three icons one of them is binoculars you have to click on it after that a new screen will be opened in that screen you will have two text input widget including 4 small icons
what i want is:-- whenever i will click on rocket icon i should get the text of upper text input widget is there any way to do so .
link to my project :-----
https://github.com/themockingjester/search_in_depth_app/tree/master/venv
I think this might work (haven't tested it):
def go(self):
# here i want to print entry1 objectproperty value
print(self.info_page.entry1.text)

Create button to browse folders and select a file in python

I'm developing a python widget using tkinter where I need a button which will operate like any of the open button we see today. Basically I want it to help users to browse a file, select it and click ok. What i want is , as soon as the user clicks 'ok', it'll copy the file from that location and save it into a particular location in a particular name, which will be then used by rest of my widget.
Thanks in advance.
Take a look at the various widgets in tkFileDialog. They could be very useful. Particularly, you might want askopenfilename which will pop up a dialog where you can browse for a particular file -- When the user hits OK it returns a filename which you can do whatever you want with.

close button in pygtk about dialog not closing dialog

I'm drawing an interface for a pygtk application using glade, and I've made an about dialog. I'm having trouble with the close button in the about dialog. The close button in the credits operates as expected, but in the about dialog the button does nothing, so it has to be closed with the windows manager. I went to select the button by clicking on it and by expanding the items contained in the GtkHButtonBox, but I can't expand it in the top right section, and if I click on it it just selects the GtkHButtonBox. I've looked it up and found
GtkAboutDialog Close Button Bug and
About Dialog
I tried following those instructions, but thought they seemed a bit funny since it puts destroy immediately after show, and that's exactly what it's doing, it just destroys it straight away after showing it. I also looked in the pygtk tutorial but that hasn't been updated since 2005, so doesn't have anything about the about dialog.
filename = "sudoku_gui.glade"
builder = gtk.Builder()
builder.add_from_file(filename)
builder.connect_signals(self)
aboutWindow = builder.get_object('about_Sudoku')
aboutWindow.show()
Please help me with it, I'll be much appreciated.
Solution:
Because the solution doesn't directly provide the detail needed, I'll put it in here for reference. The last line should be changed to
aboutWindow.run()
not show(), then add
aboutWindow.destroy()
which will close the dialog when the close button is clicked.
Try this page : http://zetcode.com/tutorials/pygtktutorial/dialogs/
Hope this helps.

Categories