Why the menus look horrible...
Spoiler:
Quote:
It is important to make the distinction between what GTK+ controls and what the window manager controls. You are able to make recommendations and requests for the size and placement of top-level widgets. However, the window manager has ultimate control of these
features.
Conversely, you can use GTK_WINDOW_POPUP to create a pop-up window, although its name is somewhat misleading in GTK+. Pop-up windows are used for things that are not normally thought of as windows, such as tooltips and menus. Pop-up windows are ignored by the window manager, and therefore, they have no decorations or border frame.
There is no way to minimize or maximize a pop-up window, because the window manager does not know about them. Resize grips are not shown, and default key bindings will not work.
GTK_WINDOW_TOPLEVEL and GTK_WINDOW_POPUP are the only two elements available in the GtkWindowType enumeration. In most cases, you will want to use GTK_WINDOW_TOPLEVEL, unless there is a compelling reason not to.
Note You should not use GTK_WINDOW_POPUP if you only want window manager decorations turned off for the window. Instead, use gtk_window_set_decorated (GtkWindow *window, gboolean show) to turn off window decorations.
|
Code to start splatting stuff back into gtk into helpful pieces...
Spoiler:
Code:
#!python
# encoding: utf-8
# encoding declaration as specified here http://www.python.org/dev/peps/pep-0263/
import soundcloud
import subprocess
import sys
import os
from time import sleep
import random
# create client object with app and user credentials
client = soundcloud.Client(client_id='8c882aabb8d9314021b236a291cd874c',
client_secret='blahbebalh')
tracks = client.get('/tracks', q = sys.argv[1], limit=5,filter="streamable")
generator = random.Random()
i = 1
temp = {} #initalize dictionary
for track in tracks:
# temptrk = u'[{2}] Title: {0}\n ID: {1}'.format(track.title.encode('utf-8'), track.id, i)
titleage = track.title.encode('utf-8')
tempy = titleage+'\n'
temp.update({i:track.id}) #set dictionary key
i=i + 1
# print tempy
#Let's just play the last one for now
#return full list of links
for listing in range(1,i):
queryb = listing
trackid = temp.get(queryb) #retrieve key
track = client.get('/tracks/{0}'.format(trackid))
#tempart = "Artist: {0}\nDuration (in secs): {1}".format(track.user.get(u'username'), (track.duration/1000))
temptitle= track.title.encode('utf-8')
stream_url = client.get(track.stream_url, allow_redirects=False)
# this next bit actually gets returned.
print "{0}¬{1} &".format(temptitle,stream_url.location)
#print "Track Loading complete"
Thoughts on delimiters. and why we have chosen ¬
Okay long story short - I got it all working again. but this time with no stupid lag or asynchrous menuing (well, so far) attached final pic of working playback menu.
next up.. searching.