Oh, I see.  IsPrinterAvailable() is an active call!  Cool~.

We can do this:

   #ifdef WIN32 || __BEOS__
     if (disable_print || !IsPrinterAvailable())
   #else
     if (disable_print)
   #endif
       tool_avail[TOOL_PRINT] = 0;

but it might be more elegant (and extensible) to do this instead:

   if(disable_print || !IsPrinterConnected())
     tool_avail[TOOL_PRINT] = 0;

   /* ... then later define the following ... */

   int IsPrinterConnected(void)
   {
     #ifdef WIN32 || __BEOS__
       return IsPrinterAvailable();
     #else
       return 1;
     #endif
   }

but which obviously takes more space.  I recommend the latter but I'm not
sure how you feel about it.  Let me know!

-Mark


On Thu, 13 May 2004, Bill Kendrick wrote:

> On Thu, May 13, 2004 at 04:03:06PM -0700, Mark K. Kim wrote:
> > Does this look okay?:
> >
> >    disable_print = disable_print || !IsPrinterAvailable();
> >
> > Let me know if it looks okay and I'll commit the changes. I can't test it
> > since I don't have VC++ but it looks right... -_-'  Same change is needed
> > for the BeOS section, too, it looks like.
>
> I had thought of that initially, but I'd rather not have the printer
> become _always_ unavailable, just because it was unavailable once.
>
> In other words:
>
>   if (disable_print)
>     ... "Print" button off
>   else
>     if (not_available)
>       ... "Print" button off
>     else
>       ... "Print" button on
>
>
> So in most situations, Print button will be on.  If the printer gets
> disconnected, the "Print" button might go off.  Reconnect the printer,
> and hopefully the button will come back on.  (In the "||" suggestion
> above, it would never be able to come back on w/o restarting Tux Paint.)
>
> However, if "noprint=yes", it will ALWAYS be off.
>
>
> -bill!
> _______________________________________________
> Tuxpaint-dev mailing list
> [EMAIL PROTECTED]
> http://tux4kids.net/mailman/listinfo/tuxpaint-dev
>

-- 
Mark K. Kim
AIM: markus kimius
Homepage: http://www.cbreak.org/
Xanga: http://www.xanga.com/vindaci
Friendster: http://www.friendster.com/user.jsp?id=13046
PGP key fingerprint: 7324 BACA 53AD E504 A76E  5167 6822 94F0 F298 5DCE
PGP key available on the homepage
_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to