Thanks for the replies, Khen1950fx and zentara!

Khen1950fx, I think I didn't explain the problem clearly enough. The example I gave is truly a minimal example, in the sense that the sound I/O stuff is necessary in order to produce the buggy behavior. The problem is not that the "foo" button is small and hard to see, it's that it actually isn't rendered at all. If I take your code and put the sound I/O back in, I get this:

#!/usr/bin/perl use strict; use warnings; use Gtk2 '-init'; use IO::File; my $mw = Gtk2::Window->new('toplevel'); my $t = Gtk2::Table->new(1, 2, 0); $mw->add($t); my $label = Gtk2::Label->new('Example'); $t->attach_defaults($label, 0, 1, 0, 1); $label->show; my $button = Gtk2::Button->new('foo'); $t->attach_defaults($button, 0, 1, 1, 2); $button->signal_connect( 'clicked' => sub { exit } ); $button->show; $mw->show_all; my $dsp = new IO::File("</dev/dsp"); my $event_source_tag = Glib::IO->add_watch( fileno($dsp), 'in', sub { my $buff = " " x 1024; my $nread = read($dsp,$buff,1024); return 1; } ); Gtk2->main; 0;

This works on the same machine where my original example works, and fails on the same machine where my original example fails.

Here is a rundown on which machines it works on and which it fails on:

AMD Athlon 64 X2 4200+, Gigabyte GA-M61P-S3, onboard sound, Ubuntu 10.10 -- works

Dell Optiplex GX260, 1.8 GHz P4, 512 Mb, 40 Gb, onboard sound, Ubuntu 10.04 -- fails

Dell Optiplex GX260, 1.8 GHz P4, 512 Mb, 40 Gb, onboard sound, Ubuntu 10.10 -- fails

Core 2 Duo E8400, 3 GHz, Gigabyte EP45-UD3P mobo, onboard sound, Ubuntu 10.04 -- fails

HP, Ubuntu 10.10 -- fails

I suspect that the problem has something to do with event handling in Gtk. Maybe the program gets overloaded with events and never gets a chance to draw the widget? But I don't understand why it's hardware-dependent, and I don't understand how to fix it :-(


In reply to Re^2: mysterious hardware/OSS/Gtk interaction? by bcrowell2
in thread mysterious hardware/OSS/Gtk interaction? by bcrowell2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.