static-sites/bases/do-blog/resources/documents/python/gtk3/tutorial7.py

46 lines
1.7 KiB
Python
Executable File

#+BEGIN_COMMENT
.. title: App chooer and scale buttons
.. slug: 07-app-chooser-scale-button
.. date: 2014-02-07 12:00:00 UTC
.. tags: GTK-3, python, widgets
.. category: python
.. description: Load a glade file displaying some scale buttons get value on change, displays some app selector widgets and open the applications.
.. type: text
#+END_COMMENT
#+CAPTION: Dialog Boxes
[[../../../images/gtk/tut07-appchooser-scale.png]]
#append this to module path so we can load from the parent directory
import sys, os
from scaffold import web
from scaffold.loaders import load, load_partial
class page:
name=__name__
title = 'GTK3 App Chooser and scale buttons'
tags = 'GTK3', 'Python', 'scale' , 'appchooser'
intro = ''
date = '2014-02-07'
path = os.path.abspath('./')
image = web.template.path_image + '/gtk/tut07-appchooser-scale.png'
def create_content(self):
web.images.create(self.image, title='GTK Window')
web.page.section(
web.div.create(
web.images.render()
).set_classes('sources').render()
)
web.paragraph.create(
"""This example program demonstrates the use of appchooser buttons when selecting an application from the drop down launch the application loading a test text file, this could be a video or mp3 or any file type.""")
web.paragraph.append("you can change the application list by modify the content type value in glade this then shows all registered apps for that content type.")
web.page.section(web.paragraph.render())
web.pre.create(load(os.path.abspath('./content/gtk3/tut07/tut07-appchooser-scale.py')))
web.page.section(web.pre.render())