NexTk/NtkWidget A replacement for Tk ?! 1.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

CS 497C – Introduction to UNIX Lecture 37: - X Windows Chin-Chih Chang
Wir schaffen Wissen – heute für morgen A.C.Mezger, Paul Scherrer Institut, Switzerland caQtDM, an EPICS display manager with Qt Paul Scherrer Institut.
Chapter 3 – Web Design Tables & Page Layout
Tk. Toolkit n Wish - windowing shell –touch fileName –chmod +x fileName –xedit fileName & –#!/usr/local/bin/wish n Widgets - eg Buttons, Labels, Frames.
Tk Widgets This material is best on several sources –Slides by Dr. Ernest J. Friedman-Hill –various Tcl/Tk books.
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CS 112 GUI 06 May 2008 Bilkent. Java GUI API Containers: ◦ contain other GUI components. E.g, Window, Panel, Applet, Frame Dialog. Components: ◦ Buttons,
Graphics and Multimedia. Introduction The language contains many sophisticated drawing capabilities as part of namespace System.Drawing and the other.
Escape A sticky man adventure using TKINTER python module By: Channing Burgess.
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
COMPSCI 101 Principles of Programming
ASP.NET Web Server Controls Basic Web Server Controls.
Tcl/Tk package in R Yichen Qin
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Enhancing the Graphical User Interface Multiple Forms, Controls, and Menus.
PYTHON GUI PROGRAMMING
Objectives of This Session
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
Overview of PVSS 3.6 Oliver Holme IT-CO. 16/11/2006JCOP Project Team Meeting New features in 3.6 New Installer for PVSS on Windows New Qt User Interface.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 9 GUI Programming Using Tkinter 1.
How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Chapter Eleven The X Window System. 2 Lesson A Starting and Navigating an X Window System.
Tkinter Basics. Initial Stuff To get the package: from tkinter import * To make a window, give it a title and operate it: windowVar = Tk() windowVar.title(“your.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
Porting a large scale enterprise application from Tcl/Tk 8.4 to 8.5 Prashant Thakre, Tushar Gupta {prashant_thakre, Gaurav Bansal.
Creating visual interfaces in python
COMPSA Exam Prep Session by Paul Allison On: April 8th from 1:30-3:00 Location TBA Winter 2016CISC101 - Prof. McLeod1.
See Winter 2016CISC101 - Prof. McLeod1.
Innovation Intelligence ® Feb Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. GUI design Controls Toplevel.
Reporting Tools With Tcl. History Start was about 1995 in payed work Client/Server architecture Originally use of socket interface Client as WISE installation.
Itcl-ng Status. History Implementation started about 4 years ago October 2008 Itcl4.0a release December 2008 Itcl4.0b1 February 2009 Itcl4.0b2 October.
Teaching slides Chapter 6. Chapter 6 Software user interface design & construction Contents Introduction Graphical user interface – Rich window based.
CSC 205 Programming II Lecture 5 AWT - I.
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Adobe Photoshop CS5.
Creating a Presentation
Microsoft Foundation Classes MFC
Forms Concepts Triggers Fired when Internal/External events occur
Tk Widgets in Javascript
Event Loops and GUI Intro2CS – weeks
Graphical User Interfaces (GUIs)
Basic Controls and Plugins
Chapter 2 – Introduction to the Visual Studio .NET IDE
Java Look-and-Feel Design Guidelines
WTK for APWTCL (WebTk for APWTCL) 1.
Graphics and Multimedia
Understand Windows Forms Applications and Console-based Applications
Chap 7. Building Java Graphical User Interfaces
GUI Using Python.
Graphical User Interfaces -- Introduction
Fundamentals of Python: From First Programs Through Data Structures
EE 422C Java FX.
Chapter 1 Editing a Photo
This Week: Tkinter for GUI Interfaces Some examples
Tkinter GUIs Computer Science and Software Engineering
.NET and .NET Core 7. XAML Pan Wuming 2017.
Tkinter Widgets CS 260 Dick Steflik.
Working with Symbols and Interactivity
Fundamentals of Programming I Windows, Labels, and Command Buttons
Web Development Using ASP .NET
6. WinForms 2003 C# GUI - Basics.
Visual C# - GUI and controls - 1
CMPE 135: Object-Oriented Analysis and Design March 14 Class Meeting
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

NexTk/NtkWidget A replacement for Tk ?! 1

History of NexTk George Peter Staplin (GPS) started ~ 2 years ago with a system for handling widgets Original title Tk9 Name changed to NexTk NtkWidget is based on NexTk 2

Architecture of TK Based on X11, support for windows and MacOS a lot of years later Basic widgets are implemented completely in C Widget parts are built and displayed using X11 (client- )functions Use of system fonts Options for widgets are additionally using an option database Geometry managers: grid, pack and place No alpha blending, no free rotation of texts 3

Structure of Tk Entry Widget (Tcl-code)‏ Button Widget (Tcl-code)‏ Text Widget (Tcl-code)‏ Entry Widget (C-code)‏ Button Widget (C-code)‏ Text Widget (C-code)‏ Tk Base Layer (C-code)‏ X11 Server (unix/linux)‏ API and GDI (windows)‏ X11/native Server (MacOS)‏ 4

Architecture of NexTk (1)‏ Widgets und widget parts are built as images Widget code is Tcl code Images are built using megimage functions Freetpyeext for fonts/text Geometry managers: grid, pack(planned), place(planned)‏ With alpha blending, with free text rotation 5

Components of NexTk megaimage: pixel image and blending functions freetypeext: extension of freetype fonts for building text images and rotating texts objstructure: extension for building simple objects ntk: the collection of Tcl code building the base widgets 6

Architecture of NexTk (2)‏ Every pixel consists of 4 bytes r/g/b and alpha Ntk package is handling root windows and mouse and key events Use of openGL for displaying Running on linux and win32 at the moment 7

Architecture of ntkWidget (1)‏ Based mostly on NexTk with the following differences Use of itcl instead of objstructure and use of ntkWidgetImage instead of megaimage Use of GLMWFW (Graphic Library Multi Window FrameWork) as common platform independent base for handling root windows and mouse/key events Widget parts are constructed using itcl-ng classes with inheritance instead of objstructure 8

Architecture of ntkWidget (2)‏ In the future: use of ttk(tile) like architecture for handling themes (also using itcl-ng classes)‏ ttk like theme handling implemented about 70%‏ Namespace ensemble subcommands for the functionality, so no need to learn itcl for users of the package Linux only at the moment (no development environment for windows MacOS)‏ 9

Structure of ntkWidget … label button entry … grid render freetype megaimage GLMWFW (Graphic Library Multi Window FrameWork)‏ openGL X11-Server (unix/linux)‏ GDI-Library (win32)‏ X11-Server (MacOS)‏ 10

Building Tk like widgets Widget parts are for example: window, border, text, scrollbar Every widget part is an image (a rectangle, a polygon, a text)‏ Widget parts are put together using blending functions (megaimage)‏ Transparency (alpha factor) is taken care of during blending The root window is also a widget/image which is handled during blending 11

ntkWidget Hierarchy helpers render gridManager gridData window grid theme / ttk theme pack button place 13

ntkWidget base widgets Box Button Checkbox Clock Entry Frame Listbox Menu Text Toplevel 14

ntkWidget commands ::ntk toplevel [options] ntk button [options] ntk checkbox [options] ntk clock [options] : ntk window [options] ntk keyPress [options] ntk mousePress [options] ntk widgetImage [options]

ntkWidget code example package require ntkWidget # set the root windows title ::ntk::glmwfw::Glmwfw setWindowTitle $ntk::_win "NtkWidget Button Demo" proc flipName {win} { set name [$win cget -text] switch $name { Arnulf { $win configure -text Wiedemann } Wiedemann { $win configure -text Arnulf set rotate 0 if {[llength $argv] > 0} { set rotate [lindex $argv 0] set wPath [ntk button .w -width 100 -height 100 -xoffset 50 -yoffset 50 \ -text Arnulf -textcolor [list 0 0 0 255] -bd 2 -bg [list 255 255 255 255]] $wPath configure -command [list flipName $wPath] -rotate $rotate # pack the widget using ntkWidget grid manager ntk grid $wPath

Ttk style -anchor center -padding [list 3 3] -width -9 -relief raised Default style Tbutton options Clam style Tbutton options -anchor center -padding [list 3 3] -width -9 -relief raised -shiftrelief 1 -window #ffffff -frame #d9d9d9 -disabledfg #a3a3a3 -anchor center -padding 5 -width -11 -relief raised -window #ffffff -frame #cdad5 -disabledfg #999999 17

Ttk layout Default layout TButton Clam layout TButton Background Border Focusring Padding Text Background Border Focusring Padding Text 18

Ttk state active alternate background disabled focus invalid pressed readonly selected 19

Ttk style map -background [list disabled #9d9d9d active #ececec] -foreground [list disabled #a3a3a3 -relief [list {pressed !disabled} sunken] 20

Ttk theme names alt aqua clam classic default 21

Ttk like features With ttk like features you can Determine the layout of a widget using a theme Determine the style of a widget using a theme Determine the look of a widget depending on the state No need to change the widget code Different look and feel on platforms dependent on default layout for the platform 22

ntkWidget andTtk like features The currently used theme class in ntkWidget will be replaced by the ttk like features The mechanisms used in Ttk are very similar to the mechanisms used in ntkWidget (widget parts -> layout)‏ The currently used methods in the ntkWidget theme class can be modified to handle styles The rendering can be easily adapted to handle layouts The rendering will be enhanced to handle states 23

itcl-ng addons for ntkWidget methodvariable option delegate method delegate proc delegate option 24

itk and ntkWidget why not use itk? depending on Archetype inheritance of options strange option handling of inherited options depending on Tk no support of themes possible 25

Status NexTk and ntkWidget are work in progress NexTk and ntkWidget developers are working together There exist demos for NexTk There exist small demos for ntkWidget (without ttk like themes)‏ 26

Conclusions NexTk and ntkWidget could be both a replacement for Tk in the future A huge amount of work to be done before usable as replacement for Tk Newer technology, easier to maintain code base Additional developpers would speed up implementation Will be incompatible to Tk on some places 27

ntkWidget „hello world“ Now it is time for some small demo examples 28