Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Perl/Tk Oddities

by TomKane (Beadle)
on Jul 23, 2008 at 09:33 UTC ( [id://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 DialogBox.pm code and then discovered XDialogBox.pm. 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.

Tom

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://699570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-16 08:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found