WoW:UIHANDLER OnTabPressed: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page UIHANDLER OnTabPressed to UIHANDLER OnTabPressed without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{wowapi}}
{{widgethandler}}
Fires when tab is pressed
EditBox:OnTabPressed(self)


EditBox:OnTabPressed()
== Example ==
 
  EditBox:SetScript("OnTabPressed", function(self)
You can only append or prepend a tab no matter what. I don't think there's a way to insert a tab at the cursor position,
    self:Insert("   "); -- ''(4 spaces)''
unless there's a function that will get the position of the cursor. [[User:Egingell|Egingell]] 09:27, 13 April 2007 (EDT)
 
Possible for inserting a tab character("\t")?
  EditBox:SetScript("OnTabPressed", function()
  this:SetText(this:GetText().."\t");
  end;
  end;
-- As documented by [[user:egingell|egingell]]
OnTabPressed event, insert an indent with:
EditBox:Insert("    "); ''(4 spaces)''
This will insert 4 spaces at your cursor's position. A tab character or \t will not work, therefore spaces are used.
This will insert 4 spaces at your cursor's position. A tab character or \t will not work, therefore spaces are used.
--[[user:Muckles|Muckles]]
{{DEFAULTSORT:OnTabPressed}}

Latest revision as of 04:49, 15 August 2023

Widget handlers < OnTabPressed

Fires when tab is pressed

EditBox:OnTabPressed(self)

Example[edit]

EditBox:SetScript("OnTabPressed", function(self)
    self:Insert("    "); -- (4 spaces)
end;

This will insert 4 spaces at your cursor's position. A tab character or \t will not work, therefore spaces are used.