… | |
… | |
176 | |
176 | |
177 | return if $FOCUS == $self; |
177 | return if $FOCUS == $self; |
178 | return unless $self->{can_focus}; |
178 | return unless $self->{can_focus}; |
179 | |
179 | |
180 | my $focus = $FOCUS; $FOCUS = $self; |
180 | my $focus = $FOCUS; $FOCUS = $self; |
|
|
181 | |
|
|
182 | $self->emit (focus_in => $focus); |
|
|
183 | |
181 | $focus->update if $focus; |
184 | $focus->update if $focus; |
182 | $FOCUS->update; |
185 | $FOCUS->update; |
183 | } |
186 | } |
184 | |
187 | |
185 | sub focus_out { |
188 | sub focus_out { |
186 | my ($self) = @_; |
189 | my ($self) = @_; |
187 | |
190 | |
188 | return unless $FOCUS == $self; |
191 | return unless $FOCUS == $self; |
189 | |
192 | |
190 | my $focus = $FOCUS; undef $FOCUS; |
193 | my $focus = $FOCUS; undef $FOCUS; |
|
|
194 | |
|
|
195 | $self->emit (focus_out => $focus); |
|
|
196 | |
191 | $focus->update if $focus; #? |
197 | $focus->update if $focus; #? |
192 | } |
198 | } |
193 | |
199 | |
194 | sub mouse_motion { } |
200 | sub mouse_motion { } |
195 | sub button_up { } |
201 | sub button_up { } |
… | |
… | |
1276 | |
1282 | |
1277 | sub _draw { |
1283 | sub _draw { |
1278 | my ($self) = @_; |
1284 | my ($self) = @_; |
1279 | |
1285 | |
1280 | local $self->{fg} = $self->{fg}; |
1286 | local $self->{fg} = $self->{fg}; |
1281 | my $tex = $tex[0]; |
|
|
1282 | |
|
|
1283 | glEnable GL_BLEND; |
|
|
1284 | glEnable GL_TEXTURE_2D; |
|
|
1285 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
|
|
1286 | |
1287 | |
1287 | if ($GRAB == $self) { |
1288 | if ($GRAB == $self) { |
1288 | $self->{fg} = $self->{active_fg}; |
1289 | $self->{fg} = $self->{active_fg}; |
1289 | } |
1290 | } |
1290 | |
1291 | |
1291 | glBindTexture GL_TEXTURE_2D, $tex->{name}; |
1292 | glEnable GL_BLEND; |
|
|
1293 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
|
|
1294 | glEnable GL_TEXTURE_2D; |
1292 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1295 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
|
|
1296 | glColor 0, 0, 0, 1; |
1293 | |
1297 | |
1294 | $tex->draw_quad (0, 0, $self->{w}, $self->{h}); |
1298 | $tex[0]->draw_quad (0, 0, $self->{w}, $self->{h}); |
1295 | |
1299 | |
1296 | glDisable GL_TEXTURE_2D; |
1300 | glDisable GL_TEXTURE_2D; |
1297 | glDisable GL_BLEND; |
1301 | glDisable GL_BLEND; |
1298 | |
1302 | |
1299 | $self->SUPER::_draw; |
1303 | $self->SUPER::_draw; |