How to set the screen resolution in pythoncard - python

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)

Related

How can draw a figure on top of another application?

enter image description here
enter image description here
I want to draw a figure on another application as above. How can I do that? I tried using a window handle in c#, so I didn't get the result I wanted.
You could draw a transparent window on top of your target application, effectively creating an overlay. This would most likely involve quite a bit direct usage of the Win32 API. See for example enumerating windows of another application.
But it will likely be an unreliable solution since there is a whole bunch of things you need to take into account:
Ensure that the target application still receives all input events.
Ensure that your transparent window stays on top of the target application
Monitor the target application for any window size change, or minimizing/maximizing
Many more things that you will likely discover later
Note that this will likely not work for full screen applications, and while this should allow for an overlay, any data on what or where to draw things need to come from somewhere else.

Maya Python: Custom Window - modelEditor ignores flags

.Hi everyone,
I`m still pretty new to python so, bear with me.
I am trying to setup a custom UI Window in maya, with a custom camera.
For this i am using the panelLayout, modelPanel and modelEditor commands.
Now, it's working so far with one exception.
The flags i've set for the modelEditor seem to be ignored entirely and i dont know why.
So here is the code:
if cmds.window("myWindow", exists=True):
cmds.deleteUI('myWindow')
cmds.window("myWindow")
cmds.paneLayout(configuration="single", w=1000, h=500)
cmds.modelPanel()
cmds.modelEditor(modelPanel="modelPanel4", allObjects=False, polymeshes=True, imagePlane=True, displayAppearance="smoothShaded")
cmds.showWindow("myWindow")
I want only polyMeshes and imgagePlanes to show in this window, aswell as to have the displayAppearance set to "smoothShaded".
Nnothing else, including the grid, should be visible at this point.
but, everything show up in the window, as if i had'nt set a single flag.
any help is much appreciated
All the flags in modelEditor() work fine in Maya 2016.5 and Maya 2018. I've checked it.
import maya.cmds as cmds
if cmds.window("myWindow", exists=True):
cmds.deleteUI('myWindow')
cmds.window("myWindow")
cmds.paneLayout(configuration="single", w=1000, h=500)
cmds.modelPanel()
cmds.modelEditor(modelPanel="modelPanel4",
allObjects=False,
polymeshes=True,
imagePlane=False,
displayAppearance="smoothShaded")
cmds.showWindow("myWindow")
The problem might appear when you click myWindow or press any key. It'll show not perspective view (modelPanel4) but the other view (for instance camera1 view).

wxPython: Minimize a Frame to tray

I am in the process of writing an app that I want to make a GUI for. I've got a little bit of experience with making GUI's in wxpython already, but one thing I have not had to try yet; is minimizing an application to tray. I have been doing my research and figured out how to make the icon, but what I have gotten stuck in the mud with is minimizing the Frame to the tray. I have found no functions that I can use to hide the frame with (wx.Frame.Hide() is not the answer). Do any of you know of any way that I could accomplish this? Thanks!
You need to look at the wxPython demo's source code. Look for the part which mentions the DemoTaskBarIcon. Then you'll want to bind to wx.EVT_ICONIZE. You do end up using the frame's Hide() method within the "iconize" event handler. How else would you hide it? Then to show it again, you'll want to use the menu from your task bar icon (which is technically a system tray icon on Windows). See also:
http://bytes.com/topic/python/answers/699757-wxpython-how-minimize-taskbar
http://wxpython-users.1045709.n5.nabble.com/minimize-to-try-question-td2359957.html

highlighting a window in GNOME's window list

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. :)

Selecting area of the screen with Python

I'm developing a screen shot utility in Python. At the moment it is specifically for Linux. So far I have the ability to take a screen shot of the full desktop, and have it upload to Imgur, then copy the link to clipboard. Now I want to expand into functions such as screen shots of the active window, or of a specific selection. If anyone could help, I'd love to know what kind of module would work best for this, and how to implement such a module.
The functionality will depend on what you are using for image grabbing.
With PIL
http://effbot.org/imagingbook/imagegrab.htm
With GTK
To take a screenshot of active window :
http://faq.pygtk.org/index.py?req=show&file=faq23.039.htp
Also look at the pixbuf api
http://library.gnome.org/devel/gdk-pixbuf/
http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html
Off topic
There are some screen cast tools: http://pypi.python.org/pypi/castro/1.0.4

Categories

Resources