Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!bu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!star.cs.vu.nl!peraue From: peraue@cs.vu.nl (Raue Paul Erik) Newsgroups: comp.sys.amiga.programmer Subject: Re: Help on string gadgets necessary Message-ID: <9518@star.cs.vu.nl> Date: 2 Apr 91 09:14:47 GMT References: <1991Mar20.015546.1131@marlin.jcu.edu.au> Sender: news@cs.vu.nl Lines: 53 s37732v@vipunen.hut.fi (Markus Juhani Aalto) writes: > After playing around with string gadgets for a few weeks I can't get > a couple of things to work. > 1. Having the cursor appear in a specified gadget ie. not having > to select it first. >If you are opening a window with string gadget in it, you have to make >it active via WINDOWACTIVE flag. Then wait for ACTIVEWINDOW message >from IDCMP-port and after that call ActiveGadget()-routine (I don`t >remember exact name now, but it should be something like that.) Well, >atleast it worked for me! ActivateGadget( struct Gadget *g, struct Window *w, struct Requester *r ); So if you're using a regular window (pointer called winptr) and a gadget called StringGadget use the following call: ActivateGadget( &StringGadget, winptr, NULL ); > 2. Gadget in general - After OffGadget i have used OnGaget to > turn it back on and there is still ghosting in the gadget, > the area free of ghosting is where the Gadget Text was, I > have tried RefreshGadgets and RefreshGagetList(?) but they > seem to have no effect, any ideas much appreciated ! >Can`t try it now! But it should work if you first call OnGadget and >then RefreshGadgets. If it wont work, try removing gadget first from >the list and then calling OnGadget and AddingGadget back to the list >and Refreshing them. This might work, but as I said I can`t try it >myself now and because Intuition programming isn`t just piece of cake >I wont give any promises. I've noticed this problem myself. It seems that Intuition only redraws the pieces of a gadget containing an actual image. This means that your string gadget is only redrawn where there is an image, so the border and the text in the gadget is redrawn, but any area where there's no border and no text and is still in the gadget remains ghosted. If the suggestion mentioned in the previous reply doesn't work, you'll probably have to remove the gadgetimage from the screen using RectFill and then calling OnGadget. Good luck, Paul-Erik Raue _______ _______ _______ +-----------------+--------------------+ / ___ /\ / _____/\ / ___ /\ | peraue@cs.vu.nl | Quote by DD.Linder | / /\_/ /_/___ / /\____\/ / /\_/ / / +-----------------+--------------------+ / _____//____// ____/\ / __ _/ / | real programmers don't document code | / /\____\\____/ /\___\/_ / /\_\ \\/ | if it was hard to write, it should | /_/ / /______//_//_/ / \_\ | be hard to read. | \_\/ \______\\_\\_\/ \_\ +--------------------------------------+