Lisp HUG Maillist Archive

capi:show-pane & friends

Hello all,

I'm trying to implement the following behavior:
Upon some action that may take a while, a progress bar appears within a
given interface (and the interface already exists and is displayed). The
progress bar progresses until completion, and when the action is done, the
progress bar disappears. This behavior is exemplified by the progress bar
in Firefox (on Mac OS X at least) that is shown when loading a page.

Here's how I'm trying to do it:

(capi:define-interface progress () ()
  (:panes
   (pb capi:progress-bar
       :start 0 :end 100 :slug-start 0)))

(defmethod capi:interface-display :after ((p progress))
  "Hide the progress bar until it's needed."
  (capi:hide-pane (slot-value p 'pb)))

(let ((p (make-instance 'progress)))
  (capi:display p)
  ;; the pane appears with the progress bar hidden, as I would expect...
  (capi:apply-in-pane-process
   p #'capi:show-pane (slot-value p 'pb))
  ;; but it still looks the same...
  ;; (execute-with-interface doesn't help either)
  (capi:redisplay-interface p)
  ;; even after manually redisplaying
  )

The idea is that there is an interface with a progress bar. The progress bar
is hidden when the interface is displayed and would be shown again when
needed, using capi:show-pane. I can't get the thing to show up again though.
It occurs to me that I might be misunderstanding the purpose
of show- and hide- pane; perhaps they are meant to hide the interface containing
pane, as show and hide interface would, but this doesn't seem to be the case
as show-pane hides *only* the specified pane, and not the interface.
Any thoughts?

I'm working on Mac OS X 10.4.7 in Lispworks 4.4.6.

Thanks!

-- 
=====================
Joshua Taylor
tayloj@rpi.edu


Re: capi:show-pane & friends


On Aug 7, 2006, at 1:42 PM, Taylor, Joshua wrote:

> The idea is that there is an interface with a progress bar. The  
> progress bar
> is hidden when the interface is displayed and would be shown again  
> when
> needed, using capi:show-pane. I can't get the thing to show up  
> again though.
> It occurs to me that I might be misunderstanding the purpose
> of show- and hide- pane; perhaps they are meant to hide the  
> interface containing
> pane, as show and hide interface would, but this doesn't seem to be  
> the case
> as show-pane hides *only* the specified pane, and not the interface.
> Any thoughts?
>
> I'm working on Mac OS X 10.4.7 in Lispworks 4.4.6.

I'm not sure about the hide-pane part, but I think the larger problem  
you face is getting the progress bar to update properly on OS X.  
Search the archives for several discussions about this. I had no luck  
getting progress bars or other CAPI elements (e.g. title pane text)  
to update during lengthy operations on the Mac. I was using execute- 
with-interface from a secondary process performing the operation.

The good news is that everything appears to be fixed now with  
LispWorks 5.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: capi:show-pane & friends

Actually, I'm having no trouble updating the progress bar. Maybe
I'm not doing it the way I'm supposed to, but I'm scheduling a timer
which periodically updates the progress bar. I'm only using the progress
bar to indicate how much time something has taken of its alloted time.
E.g., making a call to some external system which might time out. If the
time out is in 10 seconds, the progress bar might move 10% every second
for 10 seconds.

The show and hide pane is still an issue though...

On 8/7/06, John DeSoi <desoi@pgedit.com> wrote:
>
> On Aug 7, 2006, at 1:42 PM, Taylor, Joshua wrote:
>
> > The idea is that there is an interface with a progress bar. The
> > progress bar
> > is hidden when the interface is displayed and would be shown again
> > when
> > needed, using capi:show-pane. I can't get the thing to show up
> > again though.
> > It occurs to me that I might be misunderstanding the purpose
> > of show- and hide- pane; perhaps they are meant to hide the
> > interface containing
> > pane, as show and hide interface would, but this doesn't seem to be
> > the case
> > as show-pane hides *only* the specified pane, and not the interface.
> > Any thoughts?
> >
> > I'm working on Mac OS X 10.4.7 in Lispworks 4.4.6.
>
> I'm not sure about the hide-pane part, but I think the larger problem
> you face is getting the progress bar to update properly on OS X.
> Search the archives for several discussions about this. I had no luck
> getting progress bars or other CAPI elements (e.g. title pane text)
> to update during lengthy operations on the Mac. I was using execute-
> with-interface from a secondary process performing the operation.
>
> The good news is that everything appears to be fixed now with
> LispWorks 5.
>
>
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
>
>


-- 
=====================
Joshua Taylor
tayloj@rpi.edu


Re: capi:show-pane & friends

Sorry to repost on the same subject, but the conversation sort of
drifted off to getting
progress bars to work (which is good to hear about; I do have some
recollection of the
difficulty in that from previous discussions on the list). The issue
in the original question,
however, was about the use of show- and hide- pane.

The condensed version of the question is:

Can hide-pane and show-pane be used to make hide and show a pane
within an interface
while the interface is on screen? If that is not the purpose, then
what exactly is hide pane
doing in the following example, and would there be a way to undo and
redo its effect?

Thanks!

(capi:define-interface progress () ()
 (:panes
  (pb capi:progress-bar
      :start 0 :end 100 :slug-start 0)))

(defmethod capi:interface-display :after ((p progress))
 "Hide the progress bar until it's needed."
 (capi:hide-pane (slot-value p 'pb)))

(let ((p (make-instance 'progress)))
 (capi:display p)
 ;; the pane appears with the progress bar hidden, as I would expect...
 (capi:apply-in-pane-process
  p #'capi:show-pane (slot-value p 'pb))
 ;; but it still looks the same...
 ;; (execute-with-interface doesn't help either)
 (capi:redisplay-interface p)
 ;; even after manually redisplaying
 )


-- 
=====================
Joshua Taylor
tayloj@rpi.edu


Updated at: 2020-12-10 08:47 UTC