Gtk2-Ex-ICal-Recur

 view release on metacpan or  search on metacpan

lib/Gtk2/Ex/ICal/Recur.pm  view on Meta::CPAN

		my $brother = $self->{recurbox}->{buttons}->[$level]->[0]->{type};
		if ($brother eq 'bymonth') {
			$label->set_markup('<span foreground="red">choose another month</span>');
			$label->set_alignment(0, 0.5);	
			$menu_tree = [
				'^'  => {
					item_type  => '<Branch>',
					children => [
						'by month of the year' => {
							item_type  => '<Branch>',
							children => $self->{icalselection}->month_of_the_year($callback),
						},
					],
				},
			];
		} elsif ($brother eq 'byweekno'){
			$label->set_markup('<span foreground="red">choose another weeknumber</span>');
			$label->set_alignment(0, 0.5);	
			$menu_tree = [
				'^'  => {
					item_type  => '<Branch>',
					children => [
						'by weeknumber of the year' => {
							item_type  => '<Branch>',
							children => $self->{icalselection}->weeknumber_of_the_year($callback),
						},
					],
				},
			];
		} elsif ($brother eq 'byyearday'){
			$label->set_markup('<span foreground="red">choose another day</span>');
			$label->set_alignment(0, 0.5);	
			$menu_tree = [
				'^'  => {
					item_type  => '<Branch>',
					children => [
						'by day of the year' => {
							item_type  => '<Branch>',
							children => $self->{icalselection}->day_of_the_year($callback),
						},
					],
				},
			];
		}				
	}

	my $menu = Gtk2::Ex::Simple::Menu->new(menu_tree => $menu_tree);
	my $temphash = {};
	$temphash->{simplemenu} = $menu;
	$temphash->{label} = $label;
	return $temphash;
}

1;

__END__

=head1 NAME

Gtk2::Ex::ICal::Recur - A widget for scheduling a recurring 
set of 'events' (events in the calendar sense). Like a meeting
appointment for example, on all mondays and thursdays for the next 3
months. Kinda like Evolution or Outlook meeting schedule.

=head1 DESCRIPTION

=head1 SYNOPSIS

	my $recur = Gtk2::Ex::ICal::Recur->new;
	my $model = {
		'dtstart' => { 
			year => 2000,
			month  => 6,
			day    => 20,
		},
		'count' => 17,
		'freq' => 'yearly',
		'interval' => '5',
		'byweekno' => [1, -1],
		'byday' => ['su','fr', 'mo'],
	};
	$recur->set_model($model);

	my $window = Gtk2::Window->new;
	$window->signal_connect(destroy => sub { Gtk2->main_quit; });

	my $vbox = Gtk2::VBox->new(FALSE);
	my $hbox = Gtk2::HBox->new(FALSE);
	my $preview = Gtk2::Button->new_from_stock('gtk-preview');
	$preview->signal_connect('clicked' => 
		sub {
			$recur->update_preview;		
		}
	);

	my $done = Gtk2::Button->new_from_stock('gtk-done');
	$done->signal_connect('clicked' => 
		sub {
			print Dumper $recur->get_model;
		}
	);

=head1 METHODS

=head2 Gtk2::Ex::ICal::Recur->new()

Accepts no arguments. Returns the object.

=head2 Gtk2::Ex::ICal::Recur->set_model($model)

The C<model> is designed based on the the ICal spec. Please look at the 
C<DateTime::Event::ICal>. The structure of this hash is based on that module.

	my $model = {
		'dtstart' => { 
			year => 2000,
			month  => 6,
			day    => 20,
		},
		'count' => 17,
		'freq' => 'yearly',



( run in 2.256 seconds using v1.01-cache-2.11-cpan-f56aa216473 )