highlighting a window in GNOME's window list - python

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

Related

Open new window - tkinter/tk taskbar/dock

How can I can a function and create a function for the icon context menu? I want to make the iconic Open New Window function pop-up when you right click on the icon menu in the taskbar/dock. See this question for more info on this kind of question.
Places I have looked but found nothing:
https://www.tcl.tk/man/tcl8.5/TkCmd/tk_mac.html#M15
https://pyinstaller.org/en/stable/feature-notes.html#open-event-handling-in-a-tkinter-based-gui-application
While there are a tiny subset of apple events that you can benefit from the DockMenu is not accessible directly via tkinter. Turns out mac is not really open for modifications and even smaller tasks can be hard. You could consider to use a system tray icon instead.

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

python drop down menu attached to the windows taskbar

I'm currently working on a timer application on python 3, basically is for you to keep track of how many time spend doing something. I'm in the part of the process where i need to create an interface probably with tkinter, with a drop down menu that lists all the things i need to keep track of (lets call those things "statuses").
Now, my question is, is there a way to add that the drop down menu with the statuses in the task bar on windows? so that a user does not have to go the interface and change status, but most importantly, the current status can be always on sight.
Is this even possible? If it is, I just need a few hints please! :)
Am not sure about adding a drop down menu to the taskbar icon(like the one you get with Microsoft lync taskbar icon to change status, hope u need something like this), but i would suggest(incase this helps) to add menu at right click over the taskbar icon.
wxPython might help.
see this article.
http://codeboje.de/MailSneaker-Part-3-SystemTrayTaskBar-Icons-with-Python-and-wxPython/
Hope this helps.

Create a little python applet in a linux task bar

I would like to create for my linux task bar a little applet in python, which simply display an icon that could change of color, and when we click on it, which show a simple information menu.
But I have no idea about the resources I could use to perform it.
I started with gtk and in particular I found the gtk.status_icon_new_from_file to display an svg icon. But I can't dynamically change the icon's color through the svg. I have to modify the colors in my file, and then to reload it. Is there a way to give directly the data of the icon rather than the name of it ?
Besides, I don't know where to continue then to code my menu. Any idea ?
Finally, is it possible to some text above an icon ?
Edit : I would like to have solution about a generic taskbar, since I'm using tint2 (with openbox) under archlinux. So I need solutions compatible with the freedesktop recommendations and not specific to Gnome or Ubuntu. Maybe solutions with a xfce4 desktop.
Status icon is most generic solution, but legacy.
Appindicator was designed for ubuntu to easy keep icon and menu in taskbar.
There is examples in several languages
http://developer.ubuntu.com/resources/technologies/application-indicators/
What is your Desktop Shell? Each shell has a better way to keep applet on taskbar. Some of these solutions has compatibility with other shells (appindicator has support in KDE, Gnome2, Gnome Shell and maybe others).

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

Categories

Resources