summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/pmenudta.pm
blob: f98acf919fe8b78ac6e748e74caf43b667fd4df8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
&::PukeSendMessage($PUKE_WIDGET_LOAD, 
		   $PUKE_CONTROLLER, 
		   $PWIDGET_MENUDATA,
		   "pmenudta.so",
		   sub { my %ARG = %{shift()};
			 if($ARG{'iArg'} == 1){
			   print "*E* PMenuData Load failed!\n";
			 }
		       }
		  );

package PMenuData;
use strict;

#
# Only methods, constructor must create $self elsewhere and must of PBase type
#

sub new {
  print "*E* Can't call new for this class\n";
}

sub insertText {
  my $self = shift;

  my $text = shift;
  
  my %ARG = $self->sendMessage('iCommand' => $::PUKE_MENUDATA_INSERT_TEXT,
                               'cArg' => $text,
                               'WaitFor' => 1);

  return $ARG{'iArg'};
}

sub insertPixmap {
  my $self = shift;

  my $text = shift;
  
  my %ARG = $self->sendMessage('iCommand' => $::PUKE_MENUDATA_INSERT_PIXMAP,
                               'cArg' => $text,
                               'WaitFor' => 1);

  return $ARG{'iArg'};

}

sub removeItem {
  my $self = shift;

  my $id = shift;
  
  my %ARG = $self->sendMessage('iCommand' => $::PUKE_MENUDATA_REMOVE_ITEM,
                               'iArg' => $id);

}

package main;

1;