title: How do I make a media player control notification in Gtk?
body: <p>In Rhythmbox (GNOME's music player), when it's playing music, you can open the notifications panel and control the music playback from there. Here's a screenshot. The playback controls are bordered in orange; they have a little music note icon:</p>
  <p><a href="https://i.stack.imgur.com/WEcTX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WEcTX.png" alt="enter image description here" /></a></p>
  <p>This is what I want to make; the media playback controls. Note that, while it <em>is</em> in the notifications panel, it's not technically a notification, because it never pops up on the screen, and you can't make it go away. In the screenshot, you can see the actual notification, which I don't want to make, <em>below</em> the controls.</p>
  <p>I know that there's a <code>Gio.Notification</code>, but it's not quite what I need (unless I'm very much mistaken). I searched in <code>Gio</code>, <code>Gdk</code>, and <code>Gtk</code>, but I didn't find anything. I also searched, among other things, <code>[gtk] media control</code> and <code>[gtk] media notification</code> on Stack Overflow, but I didn't find anything there either.</p>
  <p>Thanks to the help of <a href="https://stackoverflow.com/users/6575139/bobmorane">BobMorane</a>, I've now figured out that Rhythmbox uses <code>libnotify</code> for its player controls. I know how to create actions using <code>Notify.Notification</code>, and I can make them have images, etc., but what I still haven't figured out is how to:</p>
  <ol>
  <li>Make the notification so that it can't be closed;</li>
  <li>Make it so that the action buttons are <em>next</em> to the icon and text, not under;</li>
  <li>Keep the notification on top of all the others in the notifications panel.</li>
  </ol>
  <p>Using Python's <code>help()</code> function to look at <code>gi.repository.Notify.Notification</code>, the only methods I see that seem to have potential are <code>add_action()</code> (particularly its <code>user_data</code> parameter) and <code>set_hint()</code> (and its variants). Could these be used to achieve my goal?</p>
  <p>How do I make a media-control &quot;notification&quot; in Gtk with Python, as explained above?</p>