I was just working on this myself a week ago.
Here is the basic of what I have:
//
// 1. Register an admin panel
//
add_action('admin_menu', 'myplugin__admin_menu');
function myplugin__admin_menu(){
// adding the admin panel
$panel_hook = add_submenu_page('edit.php', 'My Panel', 'My Panel', 9, dirname(__FILE__).'/admin-panel.php');
//
// 2. Register to add the needed javascript to your admin panel
//
add_action('admin-panel.php', 'myplugin__admin_print_scripts');
//
// 3. Register to add the needed CSS to your admin panel
//
add_action('admin_print_styles-admin-panel.php', 'myplugin__admin_print_styles');
}
function au_chapter_description__admin_print_scripts(){
//
// 4. Add the following javascripts to the page
//
wp_enqueue_script('jquery');
wp_enqueue_script('tiny_mce');
wp_enqueue_script('thickbox');
// thickbox is not totally required, but you never know
}
function myplugin__admin_print_styles(){
//
// 5.Add the following stylesheets to the page
//
wp_enqueue_style('thickbox');
}
Then in your admin-panel.php:
<?php
// I found that you at least need to have div#editorcontainer
// wrapping the textarea.
?>
<div id="editorcontainer"><textarea name="myplugin_field" type="text" id="myplugin_field" cols="80" rows="20"><?php print $myplugin_field; ?></textarea></div>
<?php
// Then run this to turn it into the wysiwyg
?>
<script type="text/javascript">
tinyMCE.execCommand('mceAddControl', true, 'myplugin_field');
</script>
This does not add the top bar with insert media and switch html/visual buttons. For what I was doing, I did not need them so I didn’t go any further.