Comments (3)
@taylorh140 Have you got a sample program that highlights the issue?
from tkd.
module main;
import std.ascii;
import std.array;
import std.stdio;
import std.xml:Element,ElementParser,Tag,Document,DocumentParser;
import std.string;
import std.conv;
import std.typecons;
import std.uni;
import tkd.tkdapplication; // Import Tkd.
alias TextBox = tkd.widget.Text;
alias isAlpha = std.uni.isAlpha;
TextBox xmlTextBox;
TextBox registerTextBox;
TextBox bitFieldsTextBox;
TextBox mutabilityTextBox;
TextBox dTextBox;
class Application : TkdApplication // Extend TkdApplication.
{
public void regmodifyText(CommandArgs args)
{
try{
xmlTextBox.appendText("Good");
}catch(Throwable s){
xmlTextBox.appendText("Bad");
}
}
override protected void initInterface() // Initialise user interface.
{
auto panedwindow = new PanedWindow(Orientation.horizontal).pack(10, 0, GeometrySide.bottom, GeometryFill.both, AnchorPosition.northWest, true);
auto FirstF = new Frame(panedwindow,4, ReliefStyle.groove);
auto SecondF = new Frame(panedwindow,4, ReliefStyle.groove);
auto ThirdF = new Frame(panedwindow,4, ReliefStyle.groove);
auto FourthF = new Frame(FirstF,4, ReliefStyle.groove).pack(10, 0, GeometrySide.top, GeometryFill.both, AnchorPosition.northWest, true);
auto reglabel = new Label(FourthF,"register").pack(10);
registerTextBox = new Text (FourthF).setHeight(0).bind("<<Modified>>", &this.regmodifyText ).pack(10, 0, GeometrySide.bottom, GeometryFill.both, AnchorPosition.northWest, true);
auto FifthF = new Frame(FirstF,4, ReliefStyle.groove).pack(10, 0, GeometrySide.top, GeometryFill.both, AnchorPosition.northWest, true);
auto blabel = new Label(FifthF,"Bit Fields").pack(10);
bitFieldsTextBox = new Text (FifthF).setHeight(0).pack(10, 0, GeometrySide.bottom, GeometryFill.both, AnchorPosition.northWest, true);
auto SixthF = new Frame(FirstF,4, ReliefStyle.groove).pack(10, 0, GeometrySide.top, GeometryFill.both, AnchorPosition.northWest, true);
auto mlabel = new Label(SixthF,"Mutability").pack(10);
mutabilityTextBox = new Text (SixthF).setHeight(0).pack(10, 0, GeometrySide.bottom, GeometryFill.both, AnchorPosition.northWest, true);
auto xmllabel = new Label(SecondF,"xml").pack(10);
xmlTextBox = new Text (SecondF).bind("<<Modified>>", &this.regmodifyText ).pack(10, 0, GeometrySide.left, GeometryFill.both, AnchorPosition.northWest, true);
auto dlabel = new Label(ThirdF,"D Registers").pack(10);
dTextBox = new Text (ThirdF).pack(10, 0, GeometrySide.left, GeometryFill.both, AnchorPosition.northWest, true);
panedwindow
.addPane(FirstF)
.addPane(SecondF)
.addPane(ThirdF);
}
}
void main ()
{
auto app = new Application(); // Create the application.
app.run(); // Run the application.
}
from tkd.
I was assuming this was like an onChange event for the text element, and it works that way for the first input change. But for subsequent changes no event occurs. Is there a flag that needs to be reset?
The <<Modified>>
virtual event flags that particular widget as being modified. So in this case, when you type in your widgets, they have indeed been modified. This is normal behaviour. There are Tcl/Tk commands that enable you to read this flag later.
For your particular use case try using the <KeyRelease>
event instead.
from tkd.
Related Issues (20)
- Build of example fails on Mac OSX 10.11 HOT 1
- Example fails to run on Windows but build fine HOT 1
- Add note for linker flags in windows needed to prevent console window. HOT 2
- commandCallbackHandler catches Throwable making unrecoverable Errors impossible HOT 5
- lib found but undefined references HOT 5
- start TK in D Programming ! HOT 4
- Feature Request: add OpenGL capabilites HOT 4
- Changing Widget Background Color HOT 3
- MDI Support HOT 3
- Color methods have been added to widgets that can't use them
- does canvas use the gpu to draw? HOT 1
- Error: module `tkdapplication` is in file 'tkd\tkdapplication.d' which cannot be read HOT 4
- Windows requires Microsoft Visual C++ Redistributable HOT 2
- How to install this in Windows ? HOT 3
- Segmentaiton Fault after Choosing a File via OpenFileDialog HOT 2
- Rebinding default tk keys does not work HOT 9
- How can I get currently selected tab in NoteBook widget? HOT 1
- Has this been abandoned? HOT 3
- Simple Q: is the final app using this lib completely native? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tkd.