Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I just started teaching myself using Gtk-perl, Glade and glade2perl and have a simple problem that is probably stemming from my lack of understanding of how all the modules Glade produced interact or some dilusion I have with objects/classes.

I have 2 windows. The main one loads up, then I have a button that opens the second window (modal) using window2->run (is that the correct way to do it?)

If I then close that window using the 'X' (close icon) provided by the window manager it closes and all the relevant signals get generated.

I want to be able to close this second window via code, so that particular buttons in the window could also close it, but I can't figure out how!

I'd have thought I could call the destory or hide on the window or even emit a delete_event, but it seems from the errors I can't call/do any of these thing on the second window object because I am calling them from within the object and it is therefore not blessed.

Am I using all these modules Glade kindly produced for me incorrectly? or is there a way to call these methods on one's self as it seems that is what I need to do ... and specifically how to do all that and close the window?

Thanks, Ryan

In reply to Closing GTK child windows via code by ryan

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-19 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found