Re: Status report re PR #3911

2024-05-26 Thread Thomas Passin
I forgot to write that the body of an *@item* node contains the item's 
label  that you see when you open the menu.

On Sunday, May 26, 2024 at 11:38:47 PM UTC-4 Thomas Passin wrote:

> For those who haven't defined a custom menu in *myLeoSettings.leo* 
> before, here is a screenshot of what I've got in my setting tree.  It 
> defines a menu named "Local", which displays just before (to the left of) 
> Leo's standard "Help" menu.  The string after the *@item* in each 
> headline is the name of a minibuffer command.
>
> I like to use a prefix to help remind me which commands are mine and which 
> are Leo's. Most of mine are prefixed by *tp-* or *x*-*.* My commands used 
> in the custom menus are defined under the *@commands* node in 
> *myLeoSettings.leo*.
>
>
>
> On Sunday, May 26, 2024 at 6:54:12 PM UTC-4 iamap...@gmail.com wrote:
>
>> The 6.8.0 docs will mention the show-qt-widgets command. That should 
>> suffice.
>>
>> > Nice. Thanks, Edward,
>>
>> For commands that I think I might use often enough, I add them to my 
>> "Local" menu, which I define in myLeoSettings.leo.  It's a handy way to 
>> deal with those things that don't rate a button or keyboard shortcut but 
>> that I want to remember.
>>
>> > Nice tip! My toolbar buttons are a little too crowded at the moment. 
>> Just need this. Thanks Thomas
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/be472e11-dc35-4c5f-939f-ea02267a969en%40googlegroups.com.


Re: Status report re PR #3911

2024-05-26 Thread Thomas Passin
For those who haven't defined a custom menu in *myLeoSettings.leo* before, 
here is a screenshot of what I've got in my setting tree.  It defines a 
menu named "Local", which displays just before (to the left of) Leo's 
standard "Help" menu.  The string after the *@item* in each headline is the 
name of a minibuffer command.

I like to use a prefix to help remind me which commands are mine and which 
are Leo's. Most of mine are prefixed by *tp-* or *x*-*.* My commands used 
in the custom menus are defined under the *@commands* node in 
*myLeoSettings.leo*.



On Sunday, May 26, 2024 at 6:54:12 PM UTC-4 iamap...@gmail.com wrote:

> The 6.8.0 docs will mention the show-qt-widgets command. That should 
> suffice.
>
> > Nice. Thanks, Edward,
>
> For commands that I think I might use often enough, I add them to my 
> "Local" menu, which I define in myLeoSettings.leo.  It's a handy way to 
> deal with those things that don't rate a button or keyboard shortcut but 
> that I want to remember.
>
> > Nice tip! My toolbar buttons are a little too crowded at the moment. 
> Just need this. Thanks Thomas
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/eec1a785-0c02-4ed2-9df9-054ecfa66025n%40googlegroups.com.


Re: [Simplified] Script To Move Nav Frame Between Secondary And Primary Splitters

2024-05-26 Thread Thomas Passin
It can be done without the import, making the script two lines shorter:

"""Move Nav frame between main and secdary splitters."""
gui = g.app.gui

ms = gui.find_widget_by_name(c, 'main_splitter')
ss = gui.find_widget_by_name(c, 'secondary_splitter')
lf = gui.find_widget_by_name(c, 'logFrame')

nav_in_secondary = ss.findChild(type(lf), "logFrame")
target = ms if nav_in_secondary else ss
target.addWidget(lf)

# Equalize sizes - "10" must be larger than any of the widgets...
# and well less than MAX_INT
target.setSizes([100_000] * len(target.sizes()))


On Sunday, May 26, 2024 at 6:54:49 PM UTC-4 Thomas Passin wrote:

> In practice, this means changing which panel the Nav frame shares:
> 1. Next (usually to the right) to the body editor; or
> 2. Next (usually below) the tree.
>
> With the old nested splitter layout Leo had for so long, it was possible 
> to get this arrangement using the context menu of the splitter bar, but it 
> wasn't very obvious how.
>
> With the new layout code and the retirement of the nested splitter and the 
> splitter bar menu, can this be done? Yes, here is a script.  It could be 
> used as a model for moving other frames.  Each time it is run, the Nav 
> frame trades places.
>
> """Move Nav frame between main and secondary splitters."""
> from leo.core.leoQt import QtWidgets
> QFrame = QtWidgets.QFrame
>
> gui = g.app.gui
>
> ms = gui.find_widget_by_name(c, 'main_splitter')
> ss = gui.find_widget_by_name(c, 'secondary_splitter')
> lf = gui.find_widget_by_name(c, 'logFrame')
>
> nav_in_secondary = ss.findChild(QFrame, "logFrame")
> target = ms if nav_in_secondary else ss
> target.addWidget(lf)
>
> # Equalize sizes - "10" must be larger than any of the widgets...
> # and well less than MAX_INT
> target.setSizes([100_000] * len(target.sizes()))
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/29238529-78bb-4b10-b57b-84220be08c1dn%40googlegroups.com.


Re: Aha: the Nav pane discourages people from using clones

2024-05-26 Thread Thomas Passin
Hear, hear!

On Sunday, May 26, 2024 at 6:57:16 PM UTC-4 gates...@gmail.com wrote:

> As a daily user of Leo for well over a decade, I do not (often) use 
> clones.  I do understand that clones are a fundamental feature of Leo, but 
> they are rarely useful for me outside of boilerplate code or documentation. 
>  Honestly, in most cases where clones would perhaps serve the purposes I 
> have, I usually just write a quick script instead.
>
> On the other hand, I am a heavy user (abuser?) of the Nav pane.  Leo would 
> be severely less useful for me without it.  I do not find any confusion 
> about clones in the Nav pane when I am using them, but I admit I may not be 
> representative of the cloneless Leonistas out there.
>
> I suspect this thread will reveal two things:
>
> 1) Your (Edward) way of heavily using clones to organize your thoughts and 
> code is perhaps less universal than you’d otherwise think, and,
>
> 2) A not-insignificant amount of people are somewhere in the middle, using 
> clones ‘occasionally’.
>
> The beauty and power of Leo is in that it offers many ways of customizing 
> itself to its user’s whims.  Clones and the Nav pane are both great 
> examples of this, and should be allowed to coexist.  It’s not invalid to 
> use Leo without clones any more than it’s invalid to use Leo for PIM and 
> not programming.  From my 2013 blogpost, “Leo is Love”.
>
> —>Jake
>
> On May 26, 2024, at 5:47 PM, Edward K. Ream  wrote:
>
> 
>
> The Nav pane shows all clones of a node. Showing all the clones could be 
> called a feature, but imo it's confusing.
>
> I suspect that this confusion creates a divide between those who love 
> clones and those that don't.
>
> I'm not sure what could or should be done. All of your comments are 
> welcome.
>
> Edward
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to leo-editor+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/leo-editor/18abfdaa-16b1-4d3a-8956-5db5f491e89dn%40googlegroups.com
>  
> 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0e65a832-3ec3-4fad-91ca-dc726aaec969n%40googlegroups.com.


Re: Aha: the Nav pane discourages people from using clones

2024-05-26 Thread Thomas Passin
I have hardly even noticed this.  I usually start from the top of the 
listing and work down.  If I were to hit a clone, I would probably notice 
it was the same and skip it.

It's true, I am one of those who has not taken to clones.  I haven't built 
up the knack of using them effectively.  With the Nav frame, I rarely need 
to make or use clones.  I combine the Nav panel with setting bookmarks - 
not using the bookmark plugin but just the basic Leo marking if a node.  I 
have a key shortcut to toggle a mark, one to skip to the next mark , and 
one to clear all marks.

I wouldn't say this "discourages" me, but it reduces the number of times it 
would be helpful.  So it simplifies my life.

On Sunday, May 26, 2024 at 5:47:40 PM UTC-4 Edward K. Ream wrote:

> The Nav pane shows all clones of a node. Showing all the clones could be 
> called a feature, but imo it's confusing.
>
> I suspect that this confusion creates a divide between those who love 
> clones and those that don't.
>
> I'm not sure what could or should be done. All of your comments are 
> welcome.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/64f1fa10-dceb-46eb-a832-22d6327cc26dn%40googlegroups.com.


Re: Aha: the Nav pane discourages people from using clones

2024-05-26 Thread Jacob Peck
As a daily user of Leo for well over a decade, I do not (often) use clones.  I do understand that clones are a fundamental feature of Leo, but they are rarely useful for me outside of boilerplate code or documentation.  Honestly, in most cases where clones would perhaps serve the purposes I have, I usually just write a quick script instead.On the other hand, I am a heavy user (abuser?) of the Nav pane.  Leo would be severely less useful for me without it.  I do not find any confusion about clones in the Nav pane when I am using them, but I admit I may not be representative of the cloneless Leonistas out there.I suspect this thread will reveal two things:1) Your (Edward) way of heavily using clones to organize your thoughts and code is perhaps less universal than you’d otherwise think, and,2) A not-insignificant amount of people are somewhere in the middle, using clones ‘occasionally’.The beauty and power of Leo is in that it offers many ways of customizing itself to its user’s whims.  Clones and the Nav pane are both great examples of this, and should be allowed to coexist.  It’s not invalid to use Leo without clones any more than it’s invalid to use Leo for PIM and not programming.  From my 2013 blogpost, “Leo is Love”.—>JakeOn May 26, 2024, at 5:47 PM, Edward K. Ream  wrote:The Nav pane shows all clones of a node. Showing all the clones could be called a feature, but imo it's confusing.I suspect that this confusion creates a divide between those who love clones and those that don't.I'm not sure what could or should be done. All of your comments are welcome.Edward



-- 
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/18abfdaa-16b1-4d3a-8956-5db5f491e89dn%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/8265CA72-9F1B-4D0A-9953-07DFA6E95ADB%40gmail.com.


Script To Move Nav Frame Between Secondary And Primary Splitters

2024-05-26 Thread Thomas Passin
In practice, this means changing which panel the Nav frame shares:
1. Next (usually to the right) to the body editor; or
2. Next (usually below) the tree.

With the old nested splitter layout Leo had for so long, it was possible to 
get this arrangement using the context menu of the splitter bar, but it 
wasn't very obvious how.

With the new layout code and the retirement of the nested splitter and the 
splitter bar menu, can this be done? Yes, here is a script.  It could be 
used as a model for moving other frames.  Each time it is run, the Nav 
frame trades places.

"""Move Nav frame between main and secondary splitters."""
from leo.core.leoQt import QtWidgets
QFrame = QtWidgets.QFrame

gui = g.app.gui

ms = gui.find_widget_by_name(c, 'main_splitter')
ss = gui.find_widget_by_name(c, 'secondary_splitter')
lf = gui.find_widget_by_name(c, 'logFrame')

nav_in_secondary = ss.findChild(QFrame, "logFrame")
target = ms if nav_in_secondary else ss
target.addWidget(lf)

# Equalize sizes - "10" must be larger than any of the widgets...
# and well less than MAX_INT
target.setSizes([100_000] * len(target.sizes()))

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9274247d-27f8-4ba0-b6ca-12732f2e694fn%40googlegroups.com.


Re: Status report re PR #3911

2024-05-26 Thread HaveF HaveF
The 6.8.0 docs will mention the show-qt-widgets command. That should
suffice.

> Nice. Thanks, Edward,

For commands that I think I might use often enough, I add them to my
"Local" menu, which I define in myLeoSettings.leo.  It's a handy way to
deal with those things that don't rate a button or keyboard shortcut but
that I want to remember.

> Nice tip! My toolbar buttons are a little too crowded at the moment. Just
need this. Thanks Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CA%2BUQrQx3DMv1PrtoQ2nOoCs5AH9KS6zPLfYFwmBNvBgiWhqr%2Bw%40mail.gmail.com.


Aha: the Nav pane discourages people from using clones

2024-05-26 Thread Edward K. Ream
The Nav pane shows all clones of a node. Showing all the clones could be 
called a feature, but imo it's confusing.

I suspect that this confusion creates a divide between those who love 
clones and those that don't.

I'm not sure what could or should be done. All of your comments are welcome.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/18abfdaa-16b1-4d3a-8956-5db5f491e89dn%40googlegroups.com.


Re: Status report re PR #3911

2024-05-26 Thread Thomas Passin
For commands that I think I might use often enough, I add them to my 
"Local" menu, which I define in myLeoSettings.leo.  It's a handy way to 
deal with those things that don't rate a button or keyboard shortcut but 
that I want to remember.

On Sunday, May 26, 2024 at 1:48:17 PM UTC-4 Edward K. Ream wrote:

> On Sun, May 26, 2024 at 8:06 AM HaveF HaveF  wrote:
>
>> Thanks Edward and Thomas.
>>
>> Btw, do we need to put Leo's Qt Widget hierarchy Code 
>>  to 
>> the doc? I believe it is very useful.
>>
>
> The 6.8.0 docs will mention the show-qt-widgets command. That should 
> suffice.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/73d0db0d-33d8-4401-9988-37f3e523cfbfn%40googlegroups.com.


Re: ENB: Ahas re finding definitions

2024-05-26 Thread Thomas Passin
D'accord.

On Sunday, May 26, 2024 at 1:51:56 PM UTC-4 Edward K. Ream wrote:

> On Sunday, May 26, 2024 at 12:42:11 PM UTC-5 Edward K. Ream wrote:
>
> > I don't like returning the results as cloned nodes...The Nav tab is 
> better.
>
> I'm going to do the following:
>
> - Use the Nav tab If the quicksearch plugin is active.
> - Otherwise use clones.
>
> That should make most people happy without the need for more settings or 
> commands.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/201f71e4-47c2-4c8e-8f50-f7ab5d0bf00bn%40googlegroups.com.


Re: ENB: Ahas re finding definitions

2024-05-26 Thread Edward K. Ream
On Sunday, May 26, 2024 at 12:42:11 PM UTC-5 Edward K. Ream wrote:

> I don't like returning the results as cloned nodes...The Nav tab is 
better.

I'm going to do the following:

- Use the Nav tab If the quicksearch plugin is active.
- Otherwise use clones.

That should make most people happy without the need for more settings or 
commands.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/587b7926-6712-4345-8059-d84f4755be24n%40googlegroups.com.


Re: Status report re PR #3911

2024-05-26 Thread Edward K. Ream
On Sun, May 26, 2024 at 8:06 AM HaveF HaveF  wrote:

> Thanks Edward and Thomas.
>
> Btw, do we need to put Leo's Qt Widget hierarchy Code
>  to
> the doc? I believe it is very useful.
>

The 6.8.0 docs will mention the show-qt-widgets command. That should
suffice.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0_vFgtX0PbbvKT_NTbyzRc31-R%3DQFkUKB4YOawdaPD5Q%40mail.gmail.com.


Re: ENB: Ahas re finding definitions

2024-05-26 Thread Edward K. Ream
On Sun, May 26, 2024 at 7:39 AM Thomas Passin  wrote:

> I don't like returning the results as cloned nodes.  That changes the
> outline, and a search should not do that.  The search will change the focus
> to the new cloned results, which is distracting and unexpected. And later
> the user has to remember to find and delete those clones without
> accidentally deleting something that should remain.
>
> The format used by the Nav tab is ideal (and highly readable, better than
> cloning nodes) and that's what I would greatly prefer.  No need for a new
> setting and setting-toggle command, no need to step from one instance to
> the next or back, no need to insert any new nodes.
>

Thanks for your comments. Let me think about this.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3WTQORRfvhQOEKNYf61_ztpnfUsZHKJm-7UpYK%2BrcoXg%40mail.gmail.com.


Re: Status report re PR #3911

2024-05-26 Thread HaveF HaveF
Thanks Edward and Thomas.

Btw, do we need to put Leo's Qt Widget hierarchy Code
 to
the doc? I believe it is very useful.

I let AI add some nice `|` or `-`, it works, but it remove Edward's useful
'if 1, else' part 🤭

```python
# Clear the console
g.cls()

# Global total counter for the number of objects processed
total = 0

# Function to get the name of a widget
def w_name(w):
name = w.objectName() or 'no name'
return f"<{name}>:{w.__class__.__name__}"

# Function to print information about a widget
def dump(tag, w, level=0, is_last=True, prefix=""):
global total
total += 1
connector = "└── " if is_last else "├── "
indent = prefix + connector
print(f"{id(w):<14} lvl {level:2}: {indent}{tag}:{w_name(w)}")
prefix += "" if is_last else "│   "
return prefix

# Function to recursively dump children of a widget
def dump_children(w, level=0, prefix=""):
wanted_classes = (
'DynamicWindow', 'Frame', 'Layout',
'Splitter', 'Stacked', 'Text', 'Widget'
)
children = [child for child in w.children()
if any(cls in child.__class__.__name__ for cls in
wanted_classes)]
for i, child in enumerate(children):
is_last = (i == len(children) - 1)
new_prefix = dump(f"child {i}", child, level + 1, is_last, prefix)
dump_children(child, level + 1, new_prefix)

# Function to perform a full dump starting from a widget
def full_dump(tag, w):
print(f"\nFull dump of {w_name(w)} at {id(w)}...\n")
dump(tag, w, level=0, is_last=True)
dump_children(w, level=0)


full_dump('c.frame.top.parent()', c.frame.top.parent())
print(f"\ntotal objects: {total}")
```

*Here is the output:*

```
6176345456 lvl  0: └──
c.frame.top.parent()::QStackedWidget
6176345616 lvl  1: ├── child 0::QStackedLayout
5375113840 lvl  1: └── child 1::DynamicWindow
6176345776 lvl  2: ├── child 0:<_layout>:QLayout
5375113360 lvl  2: └── child 1::QWidget
5375113040 lvl  3: ├── child 0::QSplitter
5375106960 lvl  4: │   ├── child 0::QFrame
5375107120 lvl  5: │   │   ├── child 0::QFrame
5375107280 lvl  6: │   │   │   ├── child
0::QStackedWidget
6176346256 lvl  7: │   │   │   │   ├── child 0::QStackedLayout
5375105840 lvl  7: │   │   │   │   └── child
1::QWidget
5375105680 lvl  8: │   │   │   │   ├── child
0::QVBoxLayout
5375105200 lvl  8: │   │   │   │   └── child 1::LeoLineTextWidget
5375103760 lvl  9: │   │   │   │   ├── child 0::QHBoxLayout
5375106320 lvl  9: │   │   │   │   └── child
1::LeoQTextBrowser
5375103440 lvl 10: │   │   │   │   ├── child
0::QWidget
6176346416 lvl 10: │   │   │   │   ├── child
1::QWidget
6176346896 lvl 11: │   │   │   │   │   └── child
0::QBoxLayout
6176346736 lvl 10: │   │   │   │   └── child
2::QWidget
6176346896 lvl 11: │   │   │   │   └── child
0::QBoxLayout
5375105520 lvl  6: │   │   │   └── child
1::QGridLayout
5375105360 lvl  5: │   │   └── child 1::QGridLayout
5375112880 lvl  4: │   ├── child
1::QSplitter
5375114800 lvl  5: │   │   ├── child 0::QFrame
5375111760 lvl  6: │   │   │   ├── child
0::QFrame
5375111920 lvl  7: │   │   │   │   ├── child
0::QTabWidget
6176346736 lvl  8: │   │   │   │   │   └── child
0::QStackedWidget
6175371216 lvl  9: │   │   │   │   │   ├── child
0::LeoQuickSearchWidget
6175371376 lvl 10: │   │   │   │   │   │   ├── child
0::QVBoxLayout
6175371536 lvl 11: │   │   │   │   │   │   │   └── child
0::QGridLayout
6175372016 lvl 10: │   │   │   │   │   │   └── child
1::QListWidget
6176346576 lvl 11: │   │   │   │   │   │   ├── child
0::QWidget
6176347216 lvl 11: │   │   │   │   │   │   ├── child
1::QWidget
6176347696 lvl 12: │   │   │   │   │   │   │   └──
child 0::QBoxLayout
6176347056 lvl 11: │   │   │   │   │   │   └── child
2::QWidget
6176348016 lvl 12: │   │   │   │   │   │   └──
child 0::QBoxLayout
6175361616 lvl  9: │   │   │   │   │   ├── child
1::LeoTagWidget
6175361136 lvl 10: │   │   │   │   │   │   ├── child
0::QVBoxLayout
6175370256 lvl 11: │   │   │   │   │   │   │   └── child
0::QVBoxLayout
6175369456 lvl 12: │   │   │   │   │   │   │   ├──
child 0::QHBoxLayout
6175369936 lvl 12: │   │   │   │   │   │   │   └──
child 1::QHBoxLayout
6175370736 lvl 10: │   │   │   │   │   │   └── child
1::QListWidget
6176347056 lvl 11: │   │   │   │   │   │   ├── child
0::QWidge

Re: ENB: Ahas re finding definitions

2024-05-26 Thread Thomas Passin
I don't like returning the results as cloned nodes.  That changes the 
outline, and a search should not do that.  The search will change the focus 
to the new cloned results, which is distracting and unexpected. And later 
the user has to remember to find and delete those clones without 
accidentally deleting something that should remain.

The format used by the Nav tab is ideal (and highly readable, better than 
cloning nodes) and that's what I would greatly prefer.  No need for a new 
setting and setting-toggle command, no need to step from one instance to 
the next or back, no need to insert any new nodes.   Perfect.

On Sunday, May 26, 2024 at 7:10:16 AM UTC-4 Edward K. Ream wrote:

> On Sunday, May 26, 2024 at 6:02:37 AM UTC-5 Edward K. Ream wrote:
>
> > *Aha 3*: Let the top-level results node (of either type) tell the user 
> about the new setting and the command to change it.
>
> On second thought, delivering multiple results as cloned nodes (as in the 
> the clone-find command) should suffice. The find-all command delivers 
> results in a less permanent and less pleasant format.
>
> Using a single results format eliminates the need for new settings or 
> commands. If somebody thinks differently, they can always create a PR :-)
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f0048914-7c83-4776-a8a0-a831fafe9024n%40googlegroups.com.


Re: Status report re PR #3911

2024-05-26 Thread Thomas Passin
That seems fine.  It can be done a little easier with the new method  
find_widget_by_name():

from leo.core.leoQt import QtWidgets
QSplitter, QTextEdit = QtWidgets.QSplitter, QtWidgets.QTextEdit

gui = g.app.gui
w = gui.find_widget_by_name(c, '*main_splitte*r')
something_log = w.findChild(QTextEdit, "something_log")
if something_log == None:
something_log = QtWidgets.QTextEdit()
something_log.setObjectName('something_log')
w.addWidget(something_log)

If you ever want to delete your added widget, remember to call 
deleteLater() on it as the last thing.  This will cause Qt to delete the 
underlying C++ widget.  Otherwise only the Python widget wrapper will get 
deleted.
On Sunday, May 26, 2024 at 5:17:22 AM UTC-4 iamap...@gmail.com wrote:

> I haven't kept up with the latest progress. In my previous code, I created 
> a textedit panel to output something.
>
> ```python
>  w = c.frame.body.widget
>  while not isinstance(w, NestedSplitter):
>  w = w.parent()
>  something_log = w.find_child(QtWidgets.QTextEdit, "something_log")
>  if something_log == None:
>  self.something_log = QtWidgets.QTextEdit()
>  self.something_log.setObjectName('something_log')
>  w.insert(-1, self.something_log)
> ```
> Regarding the recent changes, I try to fix it.
>
> ```python
> w = c.frame.body.widget
> while not isinstance(w, QSplitter):
> w = w.parent()
> something_log = w.findChild(QtWidgets.QTextEdit, "something_log")
> if something_log == None:
> self.something_log = QtWidgets.QTextEdit()
> self.something_log.setObjectName('something_log')
> w.addWidget(self.something_log)
> ```
>
> It works. But I'm not sure, is there anything else I need to pay attention 
> to? The original code maybe copy from Thomas, I don't remember :D I don’t 
> have the guts to study layout yet
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/adb1a981-427b-4af1-814d-4358e6a86f8dn%40googlegroups.com.


Re: ENB: Ahas re finding definitions

2024-05-26 Thread Edward K. Ream
On Sunday, May 26, 2024 at 6:02:37 AM UTC-5 Edward K. Ream wrote:

> *Aha 3*: Let the top-level results node (of either type) tell the user 
about the new setting and the command to change it.

On second thought, delivering multiple results as cloned nodes (as in the 
the clone-find command) should suffice. The find-all command delivers 
results in a less permanent and less pleasant format.

Using a single results format eliminates the need for new settings or 
commands. If somebody thinks differently, they can always create a PR :-)

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a5c9bd7b-1f94-4a6a-a858-7b3198ab5cbbn%40googlegroups.com.


Re: Status report re PR #3911

2024-05-26 Thread Edward K. Ream
On Sun, May 26, 2024 at 4:17 AM HaveF HaveF  wrote:

> I haven't kept up with the latest progress. In my previous code, I created
> a textedit panel to output something.
>
...

It works. But I'm not sure, is there anything else I need to pay attention
> to? The original code maybe copy from Thomas, I don't remember :D I don’t
> have the guts to study layout yet
>

Looks good to me. QSplitters manage their children automatically. No new
layouts should be needed, nor any changes to layouts.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3JeNHzES9mY4sgqT_jg_gGzyB52VSYk-c8w_dsR07pDA%40mail.gmail.com.


Re: Status report re PR #3911

2024-05-26 Thread HaveF HaveF
I haven't kept up with the latest progress. In my previous code, I created 
a textedit panel to output something.

```python
 w = c.frame.body.widget
 while not isinstance(w, NestedSplitter):
 w = w.parent()
 something_log = w.find_child(QtWidgets.QTextEdit, "something_log")
 if something_log == None:
 self.something_log = QtWidgets.QTextEdit()
 self.something_log.setObjectName('something_log')
 w.insert(-1, self.something_log)
```
Regarding the recent changes, I try to fix it.

```python
w = c.frame.body.widget
while not isinstance(w, QSplitter):
w = w.parent()
something_log = w.findChild(QtWidgets.QTextEdit, "something_log")
if something_log == None:
self.something_log = QtWidgets.QTextEdit()
self.something_log.setObjectName('something_log')
w.addWidget(self.something_log)
```

It works. But I'm not sure, is there anything else I need to pay attention 
to? The original code maybe copy from Thomas, I don't remember :D I don’t 
have the guts to study layout yet


-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4df970b3-2070-4224-8f3c-fd3682a856fdn%40googlegroups.com.