~ubuntu-branches/ubuntu/gutsy/tk8.4/gutsy-updates

« back to all changes in this revision

Viewing changes to macosx/tkMacOSXEmbed.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-05 15:56:45 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070105155645-8srmlwqo7m1q86qi
Tags: 8.4.14-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * See the file "license.terms" for information on usage and redistribution
15
15
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
 *
17
 
 *  RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.2.2.1 2005/08/09 07:39:54 das Exp $
 
17
 *  RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.2.2.3 2006/04/22 04:12:25 das Exp $
18
18
 */
19
19
 
20
 
#include "tkInt.h"
21
 
#include "tkPort.h"
22
 
#include "X11/X.h"
23
 
#include "X11/Xlib.h"
24
 
#include <stdio.h>
25
 
 
26
 
#include <Carbon/Carbon.h>
27
20
#include "tkMacOSXInt.h"
28
21
 
29
22
/*
236
229
                                 * for tkwin;  must be an integer value. */
237
230
{
238
231
    TkWindow *winPtr = (TkWindow *) tkwin;
 
232
    TkWindow *usePtr;
239
233
    MacDrawable *parent, *macWin;
240
234
    Container *containerPtr;
241
235
    XEvent event;
242
 
    int result;
243
236
 
244
237
    if (winPtr->window != None) {
245
238
        Tcl_AppendResult(interp, "can't modify container after widget is created", (char *) NULL);
256
249
     *
257
250
     */
258
251
     
259
 
    if (Tcl_GetInt(interp, string, &result) != TCL_OK) {
 
252
    if (Tcl_GetInt(interp, string, (int*) &parent) != TCL_OK) {
260
253
        return TCL_ERROR;
261
254
    }
262
255
 
263
 
    parent = (MacDrawable *) result;
 
256
    usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, (Window) parent);
 
257
    if (usePtr != NULL) {
 
258
        if (!(usePtr->flags & TK_CONTAINER)) {
 
259
            Tcl_AppendResult(interp, "window \"", usePtr->pathName,
 
260
                    "\" doesn't have -container option set", NULL);
 
261
            return TCL_ERROR;
 
262
        }
 
263
    }
 
264
    
 
265
    /* 
 
266
     * The code below can probably be simplified given we have already
 
267
     * discovered 'usePtr' above.
 
268
     */
264
269
 
265
270
    /*
266
271
     * Save information about the container and the embedded window
332
337
         */
333
338
        
334
339
        if (gMacEmbedHandler == NULL ||
335
 
                gMacEmbedHandler->registerWinProc(result, (Tk_Window) winPtr) != TCL_OK) {
 
340
                gMacEmbedHandler->registerWinProc((int) parent,
 
341
                (Tk_Window) winPtr) != TCL_OK) {
336
342
            Tcl_AppendResult(interp, "The window ID ", string,
337
343
                    " does not correspond to a valid Tk Window.",
338
344
                     (char *) NULL);