#! /usr/bin/env python
# -*- coding: utf-8 -*-

from dtk.ui.init_skin import init_skin
import os
from deepin_utils.file import get_parent_dir, get_current_dir
app_theme = init_skin(
    "deepin-ui",
    "1.0",
    "default",
    os.path.join(get_parent_dir(__file__, 2), "skin"),
    os.path.join(get_current_dir(__file__), "app_theme"),
)
from dtk.ui.application import Application
from dtk.ui.button import ImageButton
from dtk.ui.dialog import ConfirmDialog
import gtk

if __name__ == "__main__":
    application = Application()
    application.set_default_size(600, 450)
    application.add_titlebar(title="ImageButton example!")

    image_button = ImageButton(
        normal_dpixbuf=app_theme.get_pixbuf("action/play_normal.png"),
        hover_dpixbuf=app_theme.get_pixbuf("action/play_hover.png"),
        press_dpixbuf=app_theme.get_pixbuf("action/play_press.png"),
        insensitive_dpixbuf=None,
        scale_x=False,
        content=None,
    )
Ejemplo n.º 2
0
    )

from dtk.ui.application import Application
from dtk.ui.dragable_tab import TabBox
from dtk.ui.constant import DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT
import gtk

if __name__ == "__main__":
    # Init application.
    application = Application()

    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)

    # Set application icon.
    application.set_icon(os.path.join(get_current_dir(__file__), "icon.ico"))
    
    # Set application preview pixbuf.
    application.set_skin_preview(os.path.join(get_current_dir(__file__), "frame.png"))
    
    # Add titlebar.
    application.add_titlebar(
        ["theme", "max", "min", "close"], 
        os.path.join(get_current_dir(__file__), "logo.png"), 
        "Tab demo",
        "Tab demo",
        )
    
    tabbox = TabBox()
    align = gtk.Alignment()
    align.set(0.5, 0.5, 1, 1)
Ejemplo n.º 3
0
def get_current_dir(filepath):
    print "Please import deepin_utils.file.get_current_dir, this function will departed in next release version."
    return file.get_current_dir(filepath)
Ejemplo n.º 4
0
    )

from dtk.ui.application import Application
from dtk.ui.treeview import TreeView, TextItem
from dtk.ui.constant import DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT
import gtk

if __name__ == "__main__":
    # Init application.
    application = Application()

    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)

    # Set application icon.
    application.set_icon(os.path.join(get_current_dir(__file__), "icon.ico"))
    
    # Set application preview pixbuf.
    application.set_skin_preview(os.path.join(get_current_dir(__file__), "frame.png"))
    
    # Add titlebar.
    application.add_titlebar(
        ["theme", "max", "min", "close"], 
        os.path.join(get_current_dir(__file__), "logo.png"), 
        "TreeView demo",
        "TreeView demo",
        )
    
    # Add TreeView.
    treeview = TreeView()
    treeview.add_items(map(TextItem, ["Node1", "Node2", "Node3"]))
#! /usr/bin/env python
# -*- coding: utf-8 -*-

from dtk.ui.init_skin import init_skin
import os
from deepin_utils.file import get_parent_dir, get_current_dir
app_theme = init_skin(
        "deepin-ui",
        "1.0",
        "default",
        os.path.join(get_parent_dir(__file__, 2), "skin"),
        os.path.join(get_current_dir(__file__), "app_theme"),
        )
from dtk.ui.application import Application
from dtk.ui.button import ImageButton
from dtk.ui.dialog import ConfirmDialog
import gtk

if __name__ == "__main__":
    application = Application()
    application.set_default_size(600, 450)
    application.add_titlebar(title="ImageButton example!")
    
    image_button = ImageButton(
        normal_dpixbuf=app_theme.get_pixbuf("action/play_normal.png"),
        hover_dpixbuf=app_theme.get_pixbuf("action/play_hover.png"),
        press_dpixbuf=app_theme.get_pixbuf("action/play_press.png"),
        insensitive_dpixbuf=None,
        scale_x=False,
        content=None,
        )
Ejemplo n.º 6
0
    )

from dtk.ui.application import Application
from dtk.ui.treeview import TreeView, TextItem
from dtk.ui.constant import DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT
import gtk

if __name__ == "__main__":
    # Init application.
    application = Application()

    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)

    # Set application preview pixbuf.
    application.set_skin_preview(os.path.join(get_current_dir(__file__), "frame.png"))
    
    # Add titlebar.
    application.add_titlebar(
        ["theme", "max", "min", "close"], 
        )
    
    # Add TreeView.
    treeview = TreeView()
    treeview.add_items(map(TextItem, ["Node1", "Node2", "Node3"]))
    treeview.visible_items[0].add_items(map(TextItem, ["Node1 - SubNode1", "Node1 - SubNode2", "Node1 - SubNode3"]))
    treeview.visible_items[1].add_items(map(TextItem, ["Node2 - SubNode1", "Node2 - SubNode2", "Node2 - SubNode3"]))
    treeview.visible_items[2].add_items(map(TextItem, ["Node3 - SubNode1", "Node3 - SubNode2", "Node3 - SubNode3"]))
    
    treeview_align = gtk.Alignment()
    treeview_align.set(0.5, 0.5, 1, 1)
Ejemplo n.º 7
0
def get_current_dir(filepath):
    print "Please import deepin_utils.file.get_current_dir, this function will departed in next release version."
    return file.get_current_dir(filepath)
Ejemplo n.º 8
0
from dtk.ui.application import Application
from dtk.ui.treeview import TreeView, TextItem
from dtk.ui.constant import DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT
import gtk

if __name__ == "__main__":
    # Init application.
    application = Application()

    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)

    # Set application preview pixbuf.
    application.set_skin_preview(
        os.path.join(get_current_dir(__file__), "frame.png"))

    # Add titlebar.
    application.add_titlebar(["theme", "max", "min", "close"], )

    # Add TreeView.
    treeview = TreeView()
    treeview.add_items(map(TextItem, ["Node1", "Node2", "Node3"]))
    treeview.visible_items[0].add_items(
        map(TextItem,
            ["Node1 - SubNode1", "Node1 - SubNode2", "Node1 - SubNode3"]))
    treeview.visible_items[1].add_items(
        map(TextItem,
            ["Node2 - SubNode1", "Node2 - SubNode2", "Node2 - SubNode3"]))
    treeview.visible_items[2].add_items(
        map(TextItem,