SpeedBar odd behavior

This forum is for general developer support questions.
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

SpeedBar odd behavior

Post by mritter0 »

I am using a speedbar.gadget in text only mode. All is fine until I add a button with text, or more accurately, with a pixel length longer than this text: 12345678901234567890. Doing WWWWWWWWW needs less than 20 of them, but similar length, so it is not a number of characters issue.

What it does is kick the width of the speedbar out by the same width, increasing the window width by same amount, and "locks" it from resizing the window back down to previous size. I close my program, restart, I still can't reduce the window width back down, the speedbar has it "locked" again.

As long as I don't add a button over that pixel count, everything works fine.
Workbench Explorer - A better way to browse drawers
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: SpeedBar odd behavior

Post by broadblues »

As every font is different 12345678901234567890 is bit vague for a size, can you measure the exact amount of pixels where you start to see the effect?

I don't see any problem in AWeb with long buttons. That's the only program I can test them with in text mode. Src is available to that if you want to see how it handles the speedbar (beware direct copying ofcourse due to it's licence).

Are you detaching and reattaching the node list between changes? Most list based gadgets need this unless they have a method for dynamic attachment.
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: SpeedBar odd behavior

Post by mritter0 »

It takes about 165 pixels (the entire button width, not just the text). It will start with a small increase in gadget size, then the more pixels (letters) the bigger the increase.

List is detached and FreeSpeedBarList() before updating the list.

I can add as many buttons as I want that are under the 165 pixels and all is good.
Workbench Explorer - A better way to browse drawers
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: SpeedBar odd behavior

Post by broadblues »

Do you rethink the window after modifying?
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: SpeedBar odd behavior

Post by mritter0 »

Yes
Workbench Explorer - A better way to browse drawers
Post Reply