Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why MOUSE_CLICK didn't work? #11

Open
kylin30 opened this issue May 27, 2019 · 0 comments
Open

why MOUSE_CLICK didn't work? #11

kylin30 opened this issue May 27, 2019 · 0 comments

Comments

@kylin30
Copy link

kylin30 commented May 27, 2019

  sctr1 := TSciter.Create(Self);
  sctr1.Parent := Self;
  sctr1.Visible := True;
  sctr1.Align := alClient;
  sctr1.LoadURL(ExtractFilePath(ParamStr(0)) + 'index.html');

  ele := sctr1.Root.CreateElement('div','text');
  ele.Attr['class'] := 'app';
  sctr1.Root.AppendChild(ele);
  sctr1.Root.SubscribeMouse('.app',MOUSE_CLICK,OnElementMouse);

no response on click div.app.

modified code to:

  sctr1 := TSciter.Create(Self);
  sctr1.Parent := Self;
  sctr1.Visible := True;
  sctr1.Align := alClient;
  sctr1.LoadURL(ExtractFilePath(ParamStr(0)) + 'index.html');

  ele := sctr1.Root.CreateElement('div','text');
  ele.Attr['class'] := 'app';
  sctr1.Root.AppendChild(ele);

  showmessage('a'); // <-- add this line

  sctr1.Root.SubscribeMouse('.app',MOUSE_CLICK,OnElementMouse);

it work now~why? please help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant