summaryrefslogtreecommitdiffstats
path: root/control-center2
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-01-04 23:18:26 +0000
committerdamien <damien@mandriva.com>2001-01-04 23:18:26 +0000
commit229962be2a5ffb47eff52c392ea01ad637d8b558 (patch)
treeba4163bf090a7b2d06448635735fce8f35eb0619 /control-center2
parent51bf1398172c17ef5f90f28be8d063c1a2677da8 (diff)
downloadcontrol-center-229962be2a5ffb47eff52c392ea01ad637d8b558.tar
control-center-229962be2a5ffb47eff52c392ea01ad637d8b558.tar.gz
control-center-229962be2a5ffb47eff52c392ea01ad637d8b558.tar.bz2
control-center-229962be2a5ffb47eff52c392ea01ad637d8b558.tar.xz
control-center-229962be2a5ffb47eff52c392ea01ad637d8b558.zip
updated
Diffstat (limited to 'control-center2')
-rwxr-xr-xcontrol-center251
1 files changed, 28 insertions, 23 deletions
diff --git a/control-center2 b/control-center2
index 748ce4e5..331adb72 100755
--- a/control-center2
+++ b/control-center2
@@ -73,25 +73,14 @@ my @item_factory_entries = (
my ($accel_group, $item_factory, $box1, $label, $box2);
my ($separator, $button, $dummy);
-# $item_factory_window = new Gtk::Window('toplevel');
-# signal_connect $item_factory_window destroy => \&destroy_window, \$item_factory_window;
-# signal_connect $item_factory_window "delete-event" => \&destroy_window, \$item_factory_window;
-
$accel_group = new Gtk::AccelGroup;
$item_factory = new Gtk::ItemFactory('Gtk::MenuBar', "<main>", $accel_group);
-#$window_global->set_data('<main>', $item_factory);
$accel_group->attach($window_global);
-#$item_factory->create_items();
foreach (@item_factory_entries) {
$item_factory->create_item($_, \&item_factory_cb);
}
-# $item_factory_window->set_title("Item Factory");
-# $item_factory_window->set_border_width(0);
-
-# $box1 = new Gtk::VBox(0, 0);
-# $item_factory_window->add($box1);
$vbox_global->pack_start($item_factory->get_widget('<main>'), 0, 0, 0);
$hseparator_global = new Gtk::HSeparator;
$vbox_global->pack_start($hseparator_global, 0, 1, 0);
@@ -150,22 +139,25 @@ my $num=0;
my $group;
for ( $group=0; $group<$tree{nb_groups}; $group++) {
print "group : $group\n";
- # print Data::Dumper->Dump([$v], ['v']) . "\n";
-
-# print Data::Dumper->Dump([[$tree{$arg}]], ['tree-->']) . "\n";
- draw_icon(56, 36, 'item', 0, "");
-
-
+ draw_icon(56, 36, 'item', 0, "", $group);
for ($item=0; $item<$tree[$group]{nb_applis}; $item++) {
print "item : $item\n";
draw_icon(56, 36, 'item', 1, $tree[$group]{applis}[$item]{name}, $num);
$num++;
}
}
+print Data::Dumper->Dump([$tree[0]{applis}[0]], ['tree-applis->0-->']) . "\n";
#########
+#my $rc = "control-center.rc";
+#Gtk::Rc->parse($rc);
$window_global->show_all;
+for (my $i=0; $i<$tree{nb_groups}; $i++) {
+ for (my $j=0; $j<$tree[$i]{nb_applis}; $j++) {
+ $tree[$i]{applis}[$j]{darea}->hide;
+ }
+}
print "num : " . $notebook_global->page_num($vbox_about) . "\n";
$notebook_global->set_page(0);
Gtk->main;
@@ -183,9 +175,6 @@ sub draw_icon {
$socket->realize;
print ("The XID of the sockets window n°$arg is [" . $socket->window->XWINDOW . "]\n");
system ( $exec_string . " --embedded " . $socket->window->XWINDOW . "&");
- $hash=$tree[$group]{applis}[$item];
- } else {
- $hash=$tree[$group];
}
$hash{PIX_W} = $width;
$hash{PIX_H} = $height;
@@ -194,6 +183,9 @@ sub draw_icon {
$hash{anim_idle}=undef;
$hash{timeout}=undef;
$hash{darea} = new Gtk::DrawingArea;
+ if ($exec_string) {
+ $tree[$group]{applis}[$item]{darea} = $hash{darea};
+ }
$hash{darea}->set_usize($width,$height);
$hash{darea}->set_events(['exposure_mask', 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]);
$hash{darea}->signal_connect
@@ -244,10 +236,23 @@ sub draw_icon {
if ($exec_string) {
$hash{darea}->signal_connect(button_release_event => sub { $notebook_global->set_page($number+1); });
} else {
- $hash{darea}->signal_connect(button_release_event => sub { $notebook_global->set_page($number+1); });
+ $hash{darea}->signal_connect(button_release_event => sub {
+ print "group : $number\n";
+ for (my $i=0; $i<$tree{nb_groups}; $i++) {
+ for (my $j=0; $j<$tree[$i]{nb_applis}; $j++) {
+ if ($i==$number) {
+ #print "yep i : $i ; j : $j\n";
+ #print Data::Dumper->Dump([$tree[$i]{applis}[$j]{darea}], ['darea-->']) . "\n";
+ $tree[$i]{applis}[$j]{darea}->show;
+ } else {
+ #print "nope i : $i ; j : $j\n";
+ $tree[$i]{applis}[$j]{darea}->hide;
+ }
+ }
+ }
+ });
}
- $vbox_global_left->pack_start($hash{darea},0,1,5);
- print Data::Dumper->Dump([$hash], ['hash-->']) . "\n";
+ $vbox_global_left->pack_start($hash{darea},0,1,0);
}
sub item_factory_cb {