<?php
/*
Plugin Name: My List Table Plugin
Author: scribu
Version: 2.0
*/

class My_Admin_Screen {

	private $my_list_table;

	function __construct() {
		add_action( '_admin_menu', array( $this, '_init' ) );
	}

	function _init() {
		$screen_id = add_menu_page( 'Test', 'Test', 'manage_options', 'test', array( $this, 'display' ) );

		add_action( "load-$screen_id", array( $this, '_init_list_table' ) );
	}

	// The list table class has to be instantiated before screen_meta() is called
	function _init_list_table() {
		require_once dirname( __FILE__ ) . '/my-list-table-class.php';
		$this->my_list_table = new My_List_Table();
	}

	function display() {
		echo "<div class='wrap'>\n";
		echo "<h2>Test</h2>\n";

		$this->my_list_table->prepare_items();
		$this->my_list_table->display();

		echo "</div>\n";
	}
}

new My_Admin_Screen();

