I have developing an app for various different purposes with PyQt5 and it is going very well. I know how to resize a widget (like QLineEidit, or QTextBrowser), however, I would like to know how I would be able to allow the USER to resize these widgets to their liking. I'm sorry that I do not provide any code, I have not fully started this project, I would like to know if what I am trying to do is possible. It would be really helpful if you provided a small chunk of code that does this. Thank you in advance.
I'm not sure what exactly you are asking. You'd usually put your widgets in a layout, and then they resize when the user resizes the window.
You can also use a QSplitter so the user can resize two widgets relative to each other.
If you want the user to be able to resize any widgets in your window: I'm sure that'd be possible somehow, but I don't know how. However, that sounds like a rather bad UI to me.
Related
My problem is when somebody runs my tkinter gui (in Windows 7) and has larger display settings (125%), the gui doesn't look well (buttons are closer to each other, end of text cannot be seen, etc.). I use place method with x - y coordinates to place the widgets.
Maybe using pack method could solve this, but it is easier to use place for me, because there are lots of labels and buttons with exact places.
Another solution can be if the display settings could be checked with pywin32 and resize everything if needed. If it is possible, please confirm and help, what is the related function or if you have any other idea/advice, please share it.
This is one of the reasons why place is a poor choice. You should switch to using grid and/or pack. They are specifically designed to handle different screen sizes, different resolutions, different widget styles, and different fonts.
I want to make a heads-up display that pops up it's frame, taking focus from the previous application and then gives focus back to that application when it's done.
wxPython frames have Hide and Show methods that work but don't focus the application. Also, there's SetFocus which you'd think would do it but doesn't.
Update
I found a nasty hack that works. Rather than hide and show the frame, you save the app state and close the app instead of hiding. Then when you want to show again you spark a new one in a new multiprocessing.Process. Hardly ideal though. I hope someone has something better.
Clarification
To clarify, I'm trying to get the keyboard focus, not just to get the frame on top of the stack.
This issue might be specific to OS X.
You might be able to steal focus by calling Raise on the frame. There is the wx.STAY_ON_TOP style flag that could also be applied. Then you might be able to just use the frame's Show and Hide methods to make it work.
Depending on what exactly you want to do, you might take a look at the ToasterBox widget. I can't recall if it actually steals focus, but it just pop up and go away on its own, which is handy in some cases.
I am trying to make a widget exactly like this,
I want mine to be exactly the same (same font, picture, ect). Does anyone know how I can do this? I think it is a wx.ListCtrl but I cant find an example on how to make it look like this.
Can you provide me an example on how to make this widget?
Thanks.
It's a report list. Don't forget to keep a reference to the image list yourself since the bindings are stupid and don't incref it when you assign it to the list.
If the widget brings up different panels when you click on the image, then it's probably a Listbook, not a ListCtrl. Plus those are images from the wxPython demo for the Listbook AND the Toolbook AND the Treebook demos, so I'm guessing it's one of those.
I want to set the resolution of my application as per the resolution of the system screen its running on. i want to be on top and also in full screen covering even the taskbar as i am using windows. i want the app to open like the ATM interface, so the app should fill the entire screen.
please help me to find the solution.
thanks
The frame object has a "ShowFullScreen" method that you could use. I just tested it and it works alright, although it doesn't show the title bar of the app. I don't know if you care about that though.
EDIT: Uh, to call a method on the frame object, you would do something like
self.ShowFullScreen(True)
or
myFrame.ShowFullScreen(True)
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. :)