Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: Perl/Tk Oddities

by TomKane (Beadle)
on Jul 23, 2008 at 09:33 UTC ( #699570=note: print w/replies, xml ) Need Help??

in reply to Re^2: Perl/Tk Oddities
in thread Perl/Tk Oddities

Thanks for the feedback, Zentara. You led me indirectly to the answer that I was looking for.

As I was formerly a C++ programmer, I am familiar with the concept of overriding functionality. I just hadn't done it in Perl and had been hesitant to start digging down to that level when it came to base functionality of the language. But I started looking into some of the code and then discovered As I was looking at that bunch I discovered that whenever I used an XDialogBox widget, it always resulted in having an extra icon at the bottom of the screen, which is exactly what I've been trying to avoid. Then I saw that there were a couple of commented out lines of code and tried uncommenting them. It turns out that the Toplevel->transient() function was one of them and when I turned it back on, voila, no icon.

So, the quick and simple answer to my long search was there all along. Even in "Mastering Perl/Tk", Lidie doesn't mention that particular functionality (the index has the wrong page number, it's really p. 246) for making a new Toplevel appear as a part of the main. That is, the new Toplevel is a "transient" but detached widget within the "master" module that opened the new Toplevel.

Now the fun begins, however, because if I use a Toplevel as a dialog box, then I have to have a button or something that will "close" the dialog -- which is done really with the withdraw() function. But this doesn't tell the "master" module that it's closed. As long as the "master" is itself a module and can have a function accessible to the transient Toplevel, the latter can call the former with the message that it (the transient Toplevel) has "closed".

I better look into the grab() methods now.

Thanks again.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://699570]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-07-17 19:36 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (374 votes). Check out past polls.