def on_title_changed(self, title):
        if title == 'null':
            return
        print('MSG:', title)
        if title.startswith("got-a-move:test-widget"):
            xy = title.split('-')[-1]
            x, y = [int(i)-20 for i in xy.split(',')]
            msg =  'document.getElementById("test-widget").style.left = "%ipx";' % x
            msg += 'document.getElementById("test-widget").style.top = "%ipx";' % y
            self.web_send(msg)
            print(title)
            
        if title == "got-a-click:messages":
            #self.web_send("confirm('Please confitm');")
            #self.web_send("alert('wooot');")
            
            self.web_send("""
                        $(document.body).append("<div id='test-widget' class='draggable'>This is a paragraph</div>");
                        $("#test-widget").css({   "width": "100px", 
                                                    "height": "35px",
                                                    "position":"absolute",
                                                    "top":"100px",
                                                    "left":"100px",
                                                    "background": "red",
                                                    "overflow":"hidden",
                                                    "user-select": "none",
                                                    "handle": "",
                                                    "cursor": "move",
                                                });
                        // Implement some dragging (sort of)
                        $("#test-widget")._down = false;
                        $("#test-widget").mousedown(function(e){this._down=true});
                        $("#test-widget").mouseup(function(e){this._down=false});
                        $("#test-widget").mouseleave(function(e){this._down=false});
                        $("#test-widget").mousemove(function(e){if (this._down) {got_a_move(e);}});
                        
                        """)
dataset/ETHPy150Open zoofIO/flexx/exp/wgui.py/Main.on_title_changed/original