I begin with Python programming and I need some help!
Actually I'm working on a graphical application using wxpython and I would like to be able to change dynamically the size & color of the border of any widgets like a "TextCtrl", a "Panel" and a "ListBox".
Have you any ideas about this ?
Thanks
You should check out the Widget Inspection Tool (http://wiki.wxpython.org/Widget%20Inspection%20Tool). It has a highlight function that basically does what you need. The wxPython demo has it in the Help menu, but you can add it to your own code. Just check out the instructions in the link above.
Related
I have C# experience, and I'm making my first Python app. I'm part way done the UI in QT Designer, and soon I'll try PyQt to integrate it with my code. This is a general guidance question for best approach.
I have a tab widget containing various things in each tab. I would like the entire tab widget to be duplicatable with a plus button. So basically, a scroll view containing as many of these tab widgets as the user wants. The user could duplicate an existing one as a new instance, or create a blank one.
Could someone please help me understand how to accomplish this? Does it work like this?
Create the scroll view.
Put the tab widget inside the scroll view.
Add duplicate and delete buttons in the corner of the tab widget.
Put a plus button just outside the scroll view.
Accomplish all of the rest via python code? Or would I be missing out on some Qt Designer tricks?
Any tips on how to do this in QT Designer and also coding in PyQt would be appreciated.
Additionally, perhaps off topic, but any general tips on PyQt installation and usage would be nice. v5 not v4? I'm running Python 3.6 32 bit, which I was told should run 3.5 packages fine (but 64 bit may not).
Thanks,
First the out of topic : use PyQt5 if you start a new project. Qt 4 has reached end of life and won't see any new release unless it's a critical security fix.
As for most of your questions: if you want to use Designer then you should start by taking a look at Qt Designer's documentation. It will get you started nicely.
As for 5, it depends on tastes. Developers have been using both for various reasons. It's really up to you decide which style fits your needs best. There's no tricks in designer that you can't accomplish in code.
What is the best way to a text based output in a Qt widget? what I mean by this is... like in win RAR or some windows installers where there is a drop down arrow showing more details and it shows live text output of files modified and things of that nature. how would I go about doing that in a Qt app?
I was thinking maybe a none editable multiple line text box... but I'm not sure, because I don't wan't it to be editable.
any help on this would be greatly appreciated.
QLabel
QTextDocument
QTextEdit
Almost all of the options above, can be configured to be "Read-only" or even unclickable by making them disabled.
QTextStream is also a really useful class.
Hope that helps.
Does anyone know if it's possible to add a label to a single tool in a wx.ToolBar? I've found a global setting but no option to set it for a single tool.
I have a feeling that's a limitation of the native widget. It's an all or nothing affair. You could make the label a part of the image on the tool item though. Or you might be able to do it with FlatMenu which has a Toolbar widget equivalent that's written in pure Python, so you can hack it. See the wxPython demo for an example of its API.
I am trying to extend a unity appindicator for project hamster. What I want to do is have a text entry directly in the indicator menu. I have seen this for example in the ubuntu memenu, but I cannot figure out how to get it to work with pygtk. I have searched for a while and found nothing. Does anyone know how to do this?
I'm pretty sure there is no way to add that in a menu in PyGTK, but you might try a borderless window popup.
In order to indicate activity, some applications (e.g. Pidgin) highlight their entry in GNOME's Window List panel widget (e.g. via bold font or flashing color). This indication is reset automatically when the window is activated.
I have a terminal application for which I would like to achieve the same thing (preferably via Perl, but Python would work too) - but I have no idea where to start. I imagine I'd first have to find the terminal window (based on window title) and then trigger some kind of GTK action.
Any help would be greatly appreciated!
In a GTK application, use gtk_window_set_urgency_hint(). If you have a terminal application, you can't really do that - with libwnck you can get information about other application's windows, but as far as I know you can't get a GtkWindow pointer to another application's window.
May I suggest using the terminal beep? Of course this isn't a sure way to attract the user's attention, but some terminals are able to flash the title bar instead of beeping, or such things.
I'm not really into GTK programming, but as far as i know you want to set an "URGENT"-Flag for the Window which should be highlighted. Maybe this will get you any further. :)