icreator Posted February 8, 2011 Share Posted February 8, 2011 наткнулась на такую штуку - если в разных аддонах сделать инициализацию драг+дроп: Code: wtShowHideBtn = getNamedChild(mainForm, "Show" , false ) DnD:Init( 555, wtShowHideBtn, wtShowHideBtn, true ) то будут одновременно оба виджета двигаться! - хотя они принадлежат разным аддонам! но ведь LibDnD.lua у каждого свой?? ил нет? получается что создавая любую переменную Global мы можем через нее передавать данные между разными аддонами... так? походу предложение для LibDnD.lua - сделать там локальный массив данных Code: local _DnD = {}... _DnD.Widgets = {} _DnD.Widgets.wtReacting = wtReacting _DnD.Widgets.wtMovable = wtMovable or wtReacting ... Quote Link to comment Share on other sites More sharing options...
duvo Posted February 8, 2011 Share Posted February 8, 2011 Quote: создавая любую переменную Global мы можем через нее передавать данные между разными аддонами... так? Нет. Для каждого аддона создается своя "песочница". Обмен осуществляется с помощью событий.LibDnD давно пора перевести в аддон. Это уже предлагалась, как минимум, тут. Quote Link to comment Share on other sites More sharing options...
Setras Posted February 9, 2011 Share Posted February 9, 2011 userMods.sendEvent - копай Quote Link to comment Share on other sites More sharing options...
icreator Posted February 11, 2011 Author Share Posted February 11, 2011 хорошо - вот можем же мы в один и тот же виджет закатать данные - в EditLine например! и что самое интересное потом можно оттуда их взять! любой другой программе-аддону. а так же есть подстановки в мета таблицах. например я заменила стандартные методы в системном чате-окне для того чтобы считать сколько строк положили в контейнер: Code: wtChat:CountItemsInit() if not mt.CountItems then mt.CountItems = function ( self, count ) if count then countItems = countItems + count end return countItems end end if not mt.CountSetItems then mt.CountSetItems = function ( self, count ) countItems = count end end if not mt._RemoveItems then mt._RemoveItems = mt.RemoveItems mt.RemoveItems = function ( self ) self:_RemoveItems() self:CountSetItems(0) end end if not mt._PushFrontValuedText then mt._PushFrontValuedText = mt.PushFrontValuedText mt.PushFrontValuedText = function ( self, VOText ) self:_PushFrontValuedText( VOText ) self:CountItems(1) end end if not mt._PushFrontRawText then mt._PushFrontRawText = mt.PushFrontRawText mt.PushFrontRawText = function ( self, VOText ) self:_PushFrontRawText( VOText ) self:CountItems(1) end end if not mt._PushBackValuedText then mt._PushBackValuedText = mt.PushBackValuedText mt.PushBackValuedText = function ( self, VOText ) self:_PushBackValuedText( VOText ) self:CountItems(1) end end if not mt._PushBackRawValuedText then mt._PushBackRawValuedText = mt.PushBackRawValuedText mt.PushBackRawValuedText = function ( self, VOText ) self:_PushBackRawValuedText( VOText ) self:CountItems(1) end end if not mt._PopFront then mt._PopFront = mt.PopFront mt.PopFront = function ( self ) self:_PopFront( ) self:CountItems(-1) end end if not mt._PopBack then mt._PopBack = mt.PopBack mt.PopBack = function ( self ) self:_PopBack( ) self:CountItems(-1) end end но как оказалось - там будет все равно храниться значение только для моего аддона ((( использование методов виджета в других аддонах не изменилось - подсчет положенных строк в окно контейнер - не происходит (( Quote Link to comment Share on other sites More sharing options...
icreator Posted February 11, 2011 Author Share Posted February 11, 2011 это не для моей задачи - мне нужно из системного скрипта данные выкачать Quote Link to comment Share on other sites More sharing options...
Recommended Posts