redisplay
redisplay(x) redisplay(d::Display, x) redisplay(mime, x) redisplay(d::Display, mime, x)
By default, the redisplay functions simply call display. However, some display backends may override redisplay to modify an existing display of x (if any). Using redisplay is also a hint to the backend that x may be redisplayed several times, and the backend may choose to defer the display until (for example) the next interactive prompt.
Examples
-
Call
redisplaywith a single argument:julia> redisplay("Hello, Julia!")This code snippet calls the
redisplayfunction with a single argument. By default, it behaves the same as thedisplayfunction and displays the provided object. -
Call
redisplaywith aDisplayobject and an argument:julia> d = display("Hello, Julia!"); julia> redisplay(d, "Modified display")In this example, we first create a
Displayobject using thedisplayfunction. Then, we callredisplaywith theDisplayobject and a modified argument. This can be used to update or modify an existing display. -
Call
redisplaywith a MIME type and an argument:julia> redisplay("text/html", "<h1>Hello, Julia!</h1>")Here, we use the
redisplayfunction with a specific MIME type and an argument. This can be useful when working with different types of content or when targeting specific display backends. -
Call
redisplaywith aDisplayobject, MIME type, and an argument:julia> d = display("text/plain", "Hello, Julia!"); julia> redisplay(d, "text/html", "<h1>Modified display</h1>")This example combines a
Displayobject, a specific MIME type, and an argument to update an existing display with a different content type.
Note: The behavior of redisplay may vary depending on the display backend being used and how it implements the function.
See Also
:@printf, :@sprintf, display, displayable, dump, info, isprint, print, println, print_escaped, print_joined, print_shortest, print_unescaped, print_with_color, pushdisplay, redisplay, show, showall, showcompact, sprint, versioninfo,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.