<@U01819B63HP>: Here's an odd thing that happened...
# xschem
t
@Stefan Schippers: Here's an odd thing that happened to somebody I have been exchanging emails with. This happened on a Mac. When the graph symbol is double-clicked, instead of getting the
.graphdialog
window, he got a text input window with contents that appear to correspond to the information the graph symbol is storing. The only thing I can think of is that the Mac (XQuartz presumably being the culprit?) does not interpret the "Double-Button-" event from Tk correctly. But then, there's nothing that I can figure out to do that would bring up the text window with that content ("q" on the graph window just brings up an empty text window). So I'm not sure what callback function got executed. Apparently not
graph_edit_properties
, though.
h
@Stefan Schippers @Tim Edwards Mac here 🙂 I tested this just now. When I click on a symbol, I get the properties dialog (I think this is intended).
t
@Harald Pretl: The question is what do you get when you click on a waveform graph.
h
This. I think that is the intended operation to set the graph options, but on the other hand, I never used the embedded graphs in xschem so far, so little do I know… 🙂
t
The graph is supposed to be handled differently so that when you double-click you get a special dialog window that interprets the graph options and creates a GUI out of them. Apparently that function does not work on the Mac.
h
Oh. This fancy window I definitely DON’T get 😳
The
XQartz
implementation is but funky, I have to add. It is quite slow and sometimes shows updating artifacts (this means, window parts are NOT updated, resulting in missing menu items, etc.)
t
The only thing I can think of is that XQuartz is not recognizing Tk's code for the double-click (or, rather, there is no code for a double-click, so it is something that Tk interprets by measuring the time between timestamps associated with mouse button press events. So it could be that XQuartz gets the timestamps wrong or something like that).
h
If you have something to test I can help you out (like catching an error log or whatever), you just need to tell me EXACTLY what I need to do.
t
I think it would be easy enough to copy a double-click binding to some unused key and make sure that works.
@Harald Pretl: You can try modifying
xschem.tcl
(
/usr/local/share/xschem/xschem.tcl
on Linux systems; might be the same install path on Mac OS) line 4654; just copy that line
Copy code
bind $topwin <Double-Button-1> "xschem callback %W -3 %x %y 0 %b 0 %s"
and assign the same callback function to an unused key or key combination, like:
Copy code
bind $topwin <Control-q> "xschem callback %W -3 %x %y 0 %b 0 %s"
and then see if that one works where the double-button doesn't.
Well, that doesn't work for me, so I'm maybe not understanding how the callback works. Probably better to let Stefan weigh in.
h
Ok
t
One thing I did find is that you can enter
graph_edit_properties 0
on the command line, and the window pops up. That definitely pins down the problem as an issue with the double-click binding, since all the callback does is to figure out which graph has been clicked on and then call
graph_edit_properties
.
h
Confirmed, same here. Entering
graph_edit_properties 0
pops up the window, but super small (one has to increase window size manually for the dialog window). Maybe a hint?
s
@Tim Edwards @Harald Pretl The intended behavior in xschem is: • If no .raw simulation file is loaded double clicking in a graph rectangle shows the rectangle attributes. A graph is just a grey rectangle object, it just has additional attributes that xschem understands to display a graph in it. For example if you open a schematic with graphs with a very old xschem version that does not have the graph function it will display the empty grey rectangle. Same happens for embedded png images. • If a .raw simulation file is loaded and double clicking the interior of the graph then xschem bring up the graph dialog box window. In general if you assume the .raw simulation data is loaded and you double click the interior of the graph and no grah dialog box appears, the most likely situation is that no .raw file has been loaded (not found/wrong format....?) Xschem assumes binary raw files. (surprisingly the binary raw format is much simpler to load and of course more compact). You can check if a raw file is loaded with
xschem raw_query loaded
. It returns the hierarchy level (starts at 0) where the raw file has been loaded or -1 if no raw file is in memory. All what the dialog box window does is setting the rectangle set of attributes according to user selections in the dialog box. You can always manually edit the attributes as raw text even if .raw file is loaded: • single left button click the area shown in the attached image. • hit '`q`' or
Properties->Edit
Usually mouse actions inside a graph when a graph is shown (.raw data loaded) perform graph actions (move/zoom/select/measure waveforms). however a single click in area shown below selects the graph object as a whole. See the manual for more.
t
@Stefan Schippers: (1) That's not exactly the behavior I observe (on a Linux system). If I double-click on a graph, I get the graph dialog whether or not a raw file is loaded. If the raw file is not loaded, I just have an empty list of signals. (2) The problem at hand is that there is a completely broken behavior on Mac OS in which it is impossible to raise the graph dialog at all. I do not think this is the fault of Xschem. I think that the fault lies with either Tk or Xquartz in the way that they work together for Tk to recognize a "double-click" event. Mostly I'm just looking for a workaround that will work on the Mac, maybe by duplicating the double-click event callback on the graph window with another callback that uses a different key/button combination (not involving double-clicks).
s
@Tim Edwards please see this short video. does it correspond to what you see on a linux system? Of course I understand your point, about MacOS/Xquartz not correctly reporting events.
For the double button event we shoud try to start
wish
on the MacOS and give this command:
bind . <Double-Button-1> {puts hello}
does the system print
hello
when the user double clicks in the wish toplevel window?
A behavior I don't like in tcl-tk is that a double button event also implies a single button event: One double click in the wish toplevel window triggers both <Button-1> and <Double-Button-1> events. There is probably no way to avoid that unless all button events are delayed to understand if it is a double click or single click, so may be this is all in all the best behavior. Would be interesting to see MacOS behavior.
t
@Stefan Schippers: I pulled the latest xschem and recompiled, and the behavior went away. The problem was that
xschem raw_query loaded
was returning
0
. I think I just had an outdated version (I failed to practice what I preach. . .).
h
Mac OS here: Just tested the
wish
thing, and yes it does show the hello string.
Next test on macOS: Used the
test_nmos.sch
, ran sim, loaded data, double-clicked the graph window. The dialog pops up, but in miniatutized form (look closely in left top corner). When one manually extends the window it looks fine. @Stefan Schippers So the actual bug is: The window is miniature on double-click.
Actually, the graphing feature is quite useful. I really need to start using it 🙂
t
Okay, thanks for all the help. I think the original issue with the person I was emailing was that they did not have a valid raw file and it did not load. But then I over-complicated things by having an outdated version of xschem and not being able to reproduce his issue, so I mis-diagnosed the issue. It all makes sense now.
s
@Harald Pretl on MacOS, if you click on a component and press 'q' the edit attributes dialog box is sized normally, right? I need to understand why for the graph dialog box the windows is miniaturized that way. It does not happen on my system (and -maybe- on linux in general), so this is interesting.
h
Yes, pressing
q
works fine.
s
@Harald Pretl, i think I found the issue. Can you please locate this line in src/xschem.tcl:
toplevel .graphdialog  -width 1 -height 1
and replace with:
toplevel .graphdialog
then rebuild xschem . I don't remember why i did create the toplevel window with 1x1 size and resize it later (it seems a bug to me, may be the reason was to avoid some flickering, I dont remember), so I think I will remove that upstream too. I am surprised it does not show as 1x1 on Linux too, may be the window manager kicks in after the creation and resets the size. [Edit] Its funny, but the behavior you saw on MacOS (miniaturized graph dialog) seems the correct one. I have fixed this upstream too. Thank you for reporting that.
h
@Stefan Schippers Built and tested
cb1b8a09a65b565646d5cada2f81a2570d495ba0
works like a charm. Case closed.
s
Thanks, committed upstream too.
✅ 1